Greetings to one and all . I am new to this forum and to RC flying in general and this is my first post. I have never owned any serious RC equipment so far. But I have been an Arduino enthusiast for the past few years and have made a couple of Remote controlled things using blue tooth radios and X-bees.
While fiddling around with an idea of making an RC buggy I felt why not try to make something which flies and the first thing which came to my mind was a Quadcopter. But then I realised that equipments required to make one comes at a cost.
I did not have a transmitter or a receiver. All flight controllers I came across required an RC Rx and Tx. So I decided to make my own flight controller from an Arduino Mega.
The mode of control was chosen to be blue tooth. Yes I agree with most of you out there that it has a very low range but my initial copter is not expected to go beyond a basketball court below my building.
One major advantage it had as far as my building abilities go was that I was conversant with blue tooth controls as I have already used it in some of my previous builds. And yes it eliminates the requirement to have a transmitter. Almost all android phones have built in Bluetooth and I have used my phone as transmitter for the Quad.
A blue tooth receiver HC-05 is damn cheap and comes for around 250 Bucks. Considering all the advantages I was more than willing to sacrifice the range considering that the only place I have to fly it is a basketball court.
My first goal was to achieve a stable take off without toppling which I have achieved today after almost 25 crashes, multitude of code revisions, 65 days and 4 sets of broken propellers. For stabilisation I chose an MPU6050 6 axis IMU. But so far I have only used the gyros to measure the rate of turn. I want to add an auto levelling mode at a later stage and will also utilise the accelerometers to calculate the angle of turn.
Since I am new to the black art of stabilising Quadcopters i wanted to make things simple to start with and further complicate it later. For the motors and ESCs i ordered from ebay and got a package delivered which consisted of 4 unbranded A2212, 13T, 1000 KV motors and four unbranded red coloured ESCs which only had one thing written on them “Simon 30A” .
With a lot of reference from the internet about the physics of Quadcopter stability and implementation of PID controls with particular reference to videos provided under the name YMFC 3D I was able to develop a not so inefficient code which had a loop time of 4 milliseconds. Ie, I could provide a refresh rate of 250Hz to the ESCs.
I chose 250 Hz because i read in one of the references that almost all quad ESCs operate at refresh frequencies above 250 Hz. Most of the advanced ESCs can even operate at 8Khz. Since i didn’t know the exact refresh rate of my red unbranded ESC i stuck to the value it will definitely support. Aso a loop time of 4 milli seconds was not hard to achieve on the Arduino mega. I’ll upload a pic of the Esc in my post so that someone can identify the brand and possibly indicate a data sheet which describes the refresh rate. Any how with 250 hz it stabilises pretty decent in the Pitch and roll axis.
Presently my transmitter has only one channel and that is for throttle. I have made an android app which will communicate with the HC 05 blue tooth receiver through simple serial communication.
The app consists of only two items. One button to connect to the Bluetooth receiver and one slider, which will transmit the throttle value. (750 for stopped and 2000 for full speed) When the receiver gets these throttle numbers it generates PWM for each ESC input and supplies this PWM through 04 digital pins of the Mega.
The onboard gyro senses the pitch and roll and provides this to the mega via I2C and the code alters the throttle pulse widths going to the corresponding motors. That is, if the quad copter rolls to left , the gyro senses a negative rate of roll.
This value is provided to the roll axis PID controller. The out put of the PID controller is used as Roll motor correction. So in this example the motor correction is added to the left motor throttle value and subtracted from the right motor throttle value. The left motor speed increases and the right motor speed decreases there by correcting the roll to the left which kick started the whole business.
With only the throttle control from my android device, presently i can only move the quad skywards. Since the PID constants are not fine tuned the quad moves upwards and veers left/right. Since I do not have a yaw PID running , it does slowly spin in the Yaw axis too. These are the things I look forward to fixing in the forth coming days. Will keep all of you updated on the progress and ill be glad to help someone who is trying to develop a flight controller with whatever i know presently. My controller is in a very nascent stage but it is showing promise.
My ultimate aim is to make Quadcopter building affordable to the common man. No expensive tx/Rx/Controller. Infact once I settle down to a decent controller code I intend to jump from brushless motors to coreless DC motors which are priced way lesser than esc /BLDC combos. I can use a ULN2003 and driver for 4 motors and the whole Motor and driver package can reduce in price many fold. But those are for later, i shouldn’t count chickens before they hatch.
I am attaching a video of my Quad with only throttle control and PID control on Pitch and Yaw alone.
Cheers
Clickdelete