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.