Serial Communication Success

I have finally managed to get serial communication between the MultiWii board and the Raspberry PI working through use of a level shiftier  Admittedly this did took a few attempts likely due to back connections when soldering. This also involved disabling the serial console on the Raspberry PI so I could take over the UART on the GPIO without the system closing the port after a certain time.

2012-12-28 11.02.26

In addition I have been working on adjusting the MultiWii code to allow for dual control input via serial and an RC receiver and have managed to successfully control the quadcopter through serial but still need to implement a way of switch between control methods. Also with help from the MultiWii community I managed to connect a HC-SR04 ultrasonic sonar sensor, allowing for more accurate distance from ground readings then from the Barometor.

Unfortunately the quadcopter is currently unusable due to not one but two ESC’s catching fire. This occurred after a very minor crash and is likely due to age and overuse of the ESC coupled with poor quality. To this end I have ordered four new ESC’s which should arrive sometime in January. So until then my focus is going to be at getting the software components working perfectly ready for a series of flight tests.

Flight test with Ardunio

Yesterday,I tried a flight test to see if the Ardunio I programmed would work effective as a bridge between my RC receiver and the flight controller, Allowing the control to be switch between the my RC transmitter and Serial input from the PI.

2012-12-18 14.45.34

As you can see from the image above, The test didn’t quite go as expect. However I had a level of control the Quadcopter randomly moved in various directions. I believe with some fine-tuning and perhaps smoothing of the input from the RC this could be fixed. The end result was a few broken parts nothing some super glue wont fix for the moment.

However this approach creates a lot of extra wires that makes it harder to debug basic problems. For the time being I’m going to focus on another approach until at-least my Arduino Mini Pro turns up. So my new approach is to slightly re-program the firmware on the MultiWii board to add an extra option to allow for me to switch from RC control to Serial control. Half of this is done already in the code as you can already define serial control but not both.

 

Controlling the MultiWii

In my last post I had explored ways to accessing sensor data from the MultiWii.    I’ve managed use the same serial method to get some of data to the PI, However  I’m having problems using the UART specifically shifting the power levels from the MultiWii to the PI.

I changed my focus onto controlling the MultiWii’s flight through the RC input channels. I did look into controlling this through serial, however it would mean I would lose my own control of the quadcopter through my RC receiver which I want as a fail safe.

Furthermore I tried controlling PWM using the PI’s GPIO, however the values move around too much and from what I’ve read there is only a few pins that support PWM on the PI and limited support at that.

So instead I’m taking a different approach using another Adrunio board and taking the PWM input from the receiver and outputting it back out. Then I implemented a basic serial protocol to set the Throttle, Pitch, Yaw and Roll values manually. This will allow the PI to control the quadcopter and if anything goes wrong for myself to flip a switch to take over via RC.

I have also attached a Ultrasonic distance sensor to the Ardunio to give out the distance from the ground  in order to be able balance the Throttle later down the line.

Basic Wiring Diagram

The serial protocol I wrote is a very basic, it takes 5 byte packet containing two start bits and then a  command, value and finally a end bit. Which look like ‘%^T0;’ in a string.

The Uno is too big to fit inside the quadcopter so I will be converting this to a Mini Pro in the future.