CANbus Quadcopter using UC4H : Son of FrankenSolo

UC4H: adding dual GPS

Adupilot is heavily dependent on GPS for accurate position information. It uses position information for all the various modes that set it apart from other flight controllers. Auto missions, loiter, position hold, follow me etc etc all require a great GPS lock to function. Ardupilot has made great strides in recent years by implementing dual GPS capability and allowing the evaluation of the GPS signal quality and switching to the best GPS or blending the data from the two GPS. It brings greater reliability to Ardupilot.

In my first FrankenSolo I used a UC4H GPS node to convert a Here GPS to UAVCAN. This conversion caused the Here GPS to send out UAVCAN messages with GPS information to the CANbus. In the second generation UC4H OlliW has implemented a new message type that is a tunnel to send serial data to the Pixhawk. The new message has raw serial data as a payload and allows any serial device to create a tunnel to deliver that data to the Pixhawk without creating special UAVCAN messages for every serial device. So I am replacing my old UAVCAN node with a new general purpose node with the GPS/MAG/Baro firmware. The GPS data uses a serial_TUNL to get its data to the Pixhawk and the compass and or barometer send their data through normal UAVCAN messages.

There is also a general purpose node firmware to provide nothing but serial tunnels. The firmware is called the UART Bridge is used to provide extra serial ports to the Pixhawk from about any serial device.

I then took apart my Here GPS and replaced the original node with a new UC4H GPSMagBaro node.

One extra feature is that the node can support an indicator LED using the RGB strip leds. I chose two and put them in the Here GPS replacing the ones that the HERE normally supplies.

The general procedure is to get your general purpose node and download the UC4H firmware from OlliW github repository . Using your SLCAN connect to the Node and your USB connection to your computer. Use UAVCAN GUI tool to update the firmware on the bare node. When it finished the node name will change from “bootloader” to GPSMAGBaro. Now you can choose which combination of GPS/MAG or Baro you want. OPen the node in UAVCAN GUI and fetch the parameters. At the bottom of the list is the node configuration parameter which is a bitmap. GPS is a 1, MAG is a 2, and Baro is a 4. If you leave it at the default= 0 all the GPS/MAG and Baro are active. IF you set it to 1 it is GPS alone and if you set it to 4 it is Barometer alone. A 3 would configure it for GPS and MAG etc. Then save the setting and reboot.
Next open the node again and assign it a unique node ID and set the Channel_ID to match the node ID.
Now connect your standard M8N GPS using the connection chart.

Next there are a few parameters in Betacopter to set.

In the full parameter list in Mission Planner, right after the normal serial devices, you will find serial_TUNL0, Serial_TUNL1, and Serial_TUNL2.

Here you tell Mission Planner what node ID is “connected” to this tunnel and what the baudrate is needed and finally what the serial tunnel is used with. For a GPS the node type is 5 for instance. For my GPS I have node_ID’s 50 and 51 at 115 baud and type 5 each node using serial_TUNL0 and serial_TUNL1.

Set the GPS_Type to 1 for auto or in my case 2 because I know my GPS use the ublox chipset.

Done. Dual GPS via UC4H UAVCAN!

For more detailed information about using UART tunnels to add serial ports to Pixhawk see ppoirier excellent article:

1 Like