It was Friday night when I finally got my PixHawk delivered. I generally used to read and learn about every port and connections but that time I missed one important thing on upgrading from APM 2.8 to PixHawk. That thing was nothing but the PPM input required in the PixHawk while APM used to support PWM input.
For those, who don’t know the basic difference between PPM & PWM. In simple terms, PWM has a separate signal wire for each channel from your receiver while PPM has a single wire for all those channels.
What you can do? You can either buy a receiver that supports PPM output with a compatible Transmitter. OR You can get a PPM Encoder. The basic task of a PPM Encoder is to take all separate wires of each channel on one side and provides a single wire with PPM output that can be used as an input in PixHawk and other controllers.
The average cost of a PPM Encoder in the market is not cheap. They are generally programmable but if you take cost into the factor, they can go as high as INR1100 starting from INR 600–700 depending upon the dealer you are buying from while in reality, they cost less than 200 bucks to make one.
Let’s talk about creating our own PPM encoder
- You need an Arduino Pro Mini
2. A USB-TTL Adapter to write code. This will be used to program the Arduino board
3. The “Actual” code
You have two options here
- First is to use the hex version of the code provided by Ardupilot on their website. They have two different versions, one for Copter and other for Plane. You need Hex uploader for it (for eg: Xloader).
- The second option is to use the Arduino IDE and upload the code for it. There are several implementations over the Github and other websites. The one, I used is pretty basic but got the job done:
Buzzs collection of Arduino "Scripts", code, samples, and stuff. - davidbuzz/BuzzsArduinoCode
Flash the software, connect the pins as mentioned in the readme. All you need to take care of is this: (make sure you maintain the order of signals, or you have to re-assign them at your copter settings)
* Used Arduino IDE to program this firmware onto the Arduino chip.
* Connect upto 8 RC PWM input signals so that the wires go to:
red = 5v
black = GND or 0V pin on arduino
white = PWM signal pins, these connect to D0,D1,D2,D3,D4,D5,D6,D7
* Connect the PPM output so that the wires go to:
red = 5v
black = GND or 0V
PPM out = D10
Thanks to my friend Amit Kumar for guiding me on this and help me out :)