PX4 Flight Stack vs. Pixhawk Hardware

Hi all,

I have some questions and could use some clarification that I haven't been able to get through my own reading. My project has essentially gone full-circle and I am questioning the basics.

My project info:

Airframe: DJI F450 frame, motors, ESCs kit

Autopilot: 3DR (genuine) Pixhawk, with 3DR compass/GPS

Radio: DX8

Telemetry: 3DR v2

Goal: to build a platform for experimentation with vision-based autonomy and navigation.

I started my project around a year ago, using a Pixhawk and PX4 software. First assumption - I have been operating on the belief that these are fully compatible. Is that true? I understand that the Pixhawk is derived from and the hardware is very similar to, the PX4 board set.

After trying for three months to get the Pixhawk/PX4 to work, I shelved the project in frustration. Initially, the setup and configuration went really well. The early version of QGroundControl that I had  even had a default PID tune that was a perfect match for my F450. However, there were two features that I couldn't get to work. I couldn't change flight modes, and I couldn't send mission waypoint data to the drone. I could arm/disarm and get perfect telemetry data. I reflashed the PX4 several times; the radios too. I tried four different GCSs on four different computers (2 x86/Windows, 2 Android), but they all had more or less the same problems. I got some expert advice on forums, but no one was able to reproduce my problems.

That was around nine months ago. Recently I got the jones to pick up the project again and gave 3DR tech support a call. They told me I had the wrong software installed on the Pixhawk. I reflashed it with their APM flight stack and the thing works like a top. It still needs some PID tuning, but I've made several successful flights on autopilot.

One might assume case-closed. However I don't want the APM flight stack. This opinion is based on prior reading and a little assumption. My belief is that the PX4 flight stack is a bit more sophisticated than the Ardupilot equivalent. I've done some development on AVR/ATMega and I'm well aware of the limitations. My assumption is that APMCopter for the Pixhawk is a ported version of a flight stack that was written for an 8-bit, 16MHz micro. Is this true? If so, it seems to me that this is a less desirable solution. I would prefer to have software that can take advantage of the more powerful Arm4 and it's co-processor, rather than just running simple code faster.

If my assumptions are correct, then I would still like to get the PX4 flight stack working. I would assume that I'm missing something very basic, since many others apparently find this hardware/software combination routine. So I would like to ask the community for advice. Any that you can offer is very much appreciated. I won't be offended if you have really basic suggestions. I'm a MAV noob. If I've left out important details, I apologize. Please ask, and I'll do my best to answer.

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Developer
    ArduPilot only runs on 32bit HW now, so it's not just for 'speed up' as you say. Ardupilot also runs on Linux as well. You can install either PX4 Flight Stack or Ardupilot Copter/Plane/Rover on the Pixhawk.

    It more a matter of maturity and user base PX4 is younger and has a smaller user base. Ardupilot is more mature and larger user base. Ardupilot has more features. Supports more HW variants.

    If you want the PX4 Flight Stack it will work. It's not the wrong software, just different. Some pros, some cons. As with everything.
    • Thanks Bill. I appreciate the prompt reply.

      Now, having had a little more opportunity to chew on this, I have a little more understanding of my own question. My primary question is: Am I trading off anything to stick with APM on Pixhawk hardware?

      I am learning that I have some misconceptions about the relationship between APM and PX4. This is good to know. It also seems that some of my initial beliefs were correct. Why I am unable to get the PX4 flight stack working is a frustrating mystery.

      You mention some pros and some cons, is this comparison documented somewhere? I'd like to educate myself without taking a bunch of other folk's time. I found the pixhawk.com page that talks about the two, but didn't find any specific info on the feature differences. It only seemed to go as far as the top-level difference in project architecture.

      One specific bit of info that I'm looking for is differences in PID loop filter algorithms. I understand that APM is no longer 8-bit code and that the executables are now built as 32-bit. However, I read somewhere, some time ago, that PX4 uses more sophisticated math, in loops that run at 50Hz rather than 20Hz in Ardupilot, resulting in better stability. 

      To all of the people who dedicate so much of their time and efforts to these open-source/open-hardware projects, you have my sincere gratitude. Your hard work puts my project starting point light-years ahead of where it would otherwise be.

      Cheers,

      Chris

      • Developer

        "PX4 uses more sophisticated math, in loops that run at 50Hz rather than 20Hz in Ardupilot, resulting in better stability."
        That seems like a comment by somebody that kicks car tires! ;-)

        They both use EKF updated at various frequencies. You can see the schedules for all functions here https://github.com/diydrones/ardupilot/blob/master/ArduCopter/ArduC...

        It's always been 50Hz for the main stability loop AFAIU. APM is using an EKF in the 32bit builds that is the key difference between the old 8 bit builds.

        • Developer
          PS: flight wise I don't think you will see any difference discernible between APM or PX4, you may however see difference at edge cases or unique vehicle types. Like VTOL etc..
          • OK. Cool. I won't get my panties in a bunch over it then.

            Thank you very much for your time and the info. 

            • Hi Chris. Did you choose apm or px flight stack ? And may I ask why you choose the one one you did ? I'm trying to decide between those two. Thanks.

              • Hi Mikko,

                I originally had the PX4 flight stack. My reason for the choice was wanting to do development in vision-based stabilization and navigation, like the research that spawned the PX4 project in the first place. I figured their own, native flight stack would be a better starting point. My misconception above was due to conflating APM and CopterControl projects, both of which now use more sophisticated hardware/firmware/software.

                With PX4 I had some problems with the assisted flight modes and uploading mission waypoint data to the MAV. I never was able to get around that. I later contacted 3DR and the tech support guy told me that they only support the APM flight stack. At that point I reflashed with APM.

                I don't yet know enough about either stack to really know what I gained or lost in the switch. I seem to have stumbled into ALL of the rookie issues associated with Pixhawk/APM and haven't had time to put into hacking the code.

                I don't have a lot of info for you, but I hope that this little bit helps. :-)

                • thanks Chris for you answer.

                  I´m back to apm allso..and make beginner's mistakes also. I do not understand any programming and access to information about various problems seems to be difficult from time to time. but I will continue to study this wery interesting subject. Thank´s again :)

This reply was deleted.

Activity