A small segment on how I installed a Pixhawk flight controller onto an RC monster truck.
Most of the work here was already done by the factory. I just had to bring the Small Soldier touch to the system. First was figuring out where I could mount the Pixhawk controller and the other supporting electronics. I had to leave some space in the front for someone to mount equipment they wanted the rover to carry.
The four mounting posts of the cover seemed to be very sturdy and ideal for mounting a platform on, so I took some rough measurements and cut out a platform from balsa. The balsa is a very porous and light material, but wasn't very stiff and may break when the car bumps its way over rough terrain. I needed to strengthen it a little. This was very simple as I just added a layer of glass fibre on both sides that made it as strong as a piece of plywood that still weighed as much as cardboard.
After that, I simply needed to lay out the components and set up the software.
In the pictures above and below you can see where the Pixhawk was mounted using Velcro strips. There are several components here, at the bottom of the panel the RC receiver is also held on by Velcro and all its 8 channels are fed into a PPM encoder that then only requires one output connection that's fed into the Pixhawk.
To accommodate the antenna and GPS module, holes were cut into the plastic body cover of the model that was used. Since GPS radio frequency is 1.57 GHz and the telemetry module operates at 433 MHz, the GPS module and telemetry antenna was placed in close proximity to save on platform space.
The rover needed to communicate with the computer via the telemetry module, however I could not get it working and had to upload commands via USB then tell it to carry them out using the radio.
The Pixhawk offeed 3 modes of opperation which I was interested in.
Manual, where all the commands I send via the remote gets sent directly to the servo and speed controller.
Steering, where the throttle is controlled by me and the car steers itself to whatever checkpoint was activated.
Auto, where the car controls throttle and steering.
Press and hold the menu button on the transmitter after it was switched on until the menu on the right comes up. The ‘System’ item should be selected. Press and hold menu to go to the System menu.
First choose ‘Model Select’ and choose one the several open slots available. This just allows you to save the settings for several different models. The model name can also be edited. On this system it’s called ‘Rover’
Select ‘Type Select’ and hold the menu button until it goes into the screen shown on the right. Make sure to select heli, and in the menu that will automatically follow it select heli .
The heli type has important mixing properties that we will use for the 3 toggle switch.
Be sure to press ‘Menu’ when you want to confirm a selection on the previous steps. When the previous steps are complete, press ‘Exit’ sever times till the following menu appears again, and this time go into the ‘Settings’ menu.
In the Settings menu, several options will appear. Select the Pitch Curve option and you should see the screen on the right. This is where the magic happens. The radio allows the mixing of the throttle and pitch channels so that when a helicopter is pitched forward, the throttle automatically is raised to retain lift. This mixer has 3 customizable modes that can be selected by the 3 toggle switch.
The transmitter was linked to the receiver by plugging in the bind connector to the port labelled BAT on the receiver, NOT the bind port (this is mislabeled). It shorts the signal and ground cables and when the transmitter is turned on by holding in the bind button on its back, should bind the receiver (indicated by the red LED in the receiver going from a blinking state to a solid red). The binding cannot be accomplished by powering the receiver from the PWM to PPM converter linked to the Pixhawk since it interferes with the signal wire. A 4.5 to 6V battery can be used (Be sure of polarity!!)
Flick the 3 toggle switch up to the ‘normal’ position and the name in the <> brackets should change to ‘NOR’. Same goes for the other two positions and their respective names.
Since we want a constant value for each switch positon, we will change the line on the mixer to have zero slope. So for each switch position change the 5 point values to either ‘100%’ or ‘50%’ or ‘0%’ respectively.
This enables you to select the elevator channel on APM planner as the mode select channel.
The radio I used was a FS-TH8x and it required some weird setting up to enable me to use the one 3 way toggle switch to select the different modes on the pixhawk (Manual, steering, and auto). The idea is to link a channel from the radio to the mode switch command which requires 3 different reliable positions. The problem was that the three toggle switch can not directly be used as an output and the internal workings of it has to be piggybacked by another channel linked to it.
Powering the Pixhawk
The Pixhawk can be powered from either the DF3 power in connector on its face which will provide valuable battery information, or can be powered from the signal output rails where the steering servo and speed controller are plugged in.
NOTE: The signal output rails are not powered by the Pixhawk directly. They require an external power source. In this case the ESC input plug carries the power to the rails. In other words, just plugging in the DF3 power connector on the face will not power a servo from the outputs on the back.
This also means it is safe to arm the Pixhawk controller while it’s connected to the battery as long as the power switch for the speed controller (as indicated on the physical layout diagram) is off.
The mixing to change the mode through the Pixhawk is now done, but there are open auxiliary channels that can be set to tune PID values or anything else from the ‘AUX’ menu
RC Transmitter/Receiver binding
Ground Station - APM Planner
APM planner ground control software is the only package that offers full functionality of the APM rover system, and has a very intuitive and easy to use interface for setting up parameters and editing values for the PID or other system constants. It also offers a very thorough list of parameters that can be set on the telemetry modules it connects to. Any other advantages and features are easy to spot for a new user.
Open APM Planner and connect the Pixhawk via USB. If firmware on the Pixhawk needs to be updated, don’t click the connect button on the top right but click on the ‘Initial Setup’ button. From here you can update Pixhawk firmware.
I have found there to be constant interruptions during the firmware update process on APM planner and needed to use Q-goundcontrol to update the firmware on the Pixhawk.
To download the latest version of the Rover firmware go here:
If the firmware was updated you can click on the ‘Connect’ button on the top right of the window. The connection can be established via USB or telemetry.
The initial setup screen should have the options shown on the right now.
I’ve selected the option to calibrate the compass here.
After finishing the initial setup including checking that the mode selection on the radio works, you can click on the ‘Flight Plan’ button.
Double Clicking on a point on the map will set a new waypoint where point 0 is always Home. Here I made three waypoints on the engineering parking lot.
Opening the ‘Flight Data’ screen will give you information on a lot of useful data and command options. Here I’ve selected the ‘Actions’ tab where I can choose to set the mode, arm, or change mission parameters. The artificial horizon with attitude and compass information is also visible.
Choosing ‘Start Mission’ next to ‘Execute Action’ you select the option to start mission and click ‘Execute Command’. Thereafter the controller will go into Auto mode by itself so it may be a good idea to switch it back to manual before clicking on ‘ARM’. You can then use the controller to switch it to ‘Auto’ after steering it to the starting location you want by flicking the controller toggle switch all the way down (currently the setting for Auto on this rover).
In this particular case, telemetry was not available so all commands up to the point where the rover was placed in Auto mode had to be done through USB which can be disconnected right before auto mode is engaged.