Albatross- Quad-rotor flying tests
Video quality is quite crappy, will definitely upload a better one soon.
We used an Arduino Uno & a MPU 6050, and used PID controller for self balancing. Its completely customizable as we ourselves wrote the complete code except the DMP part..thanks to Jeff Rowberg great work..!!
Here are the problems you may face, if you are to work on a similar project-
* At first when we started, I didn’t knew difference between Euler angles and YPR. so I thought they must be the same thing, well they are not. If you would rotate the MPU 6050 board z plane(according to the markings on breakout board) it affected the values in x and y plane, which should not happen as al three axis are independent from each other.
* Reading PWM channels. I wondered at first why wouldn’t the receiver simply give us analog values instead of PWM. I figured reason being then there would be no possibility for interrupt based reading of PWM other wise you’d have to analog read the signal. An one should use Pin change interrupts to read the signals.
* MPU 6050 gives values to arduino via an interrupt. What happened sometimes..the code would simply wait for interrupt(if I’d touch any jumpers it’d start as normal otherwise it’d just stuck there for eternity) and would not execute further..so we had to comment out the portion with interrupt.
* Repeated values. One might see in my other post.
* PID equations. Its hard at first to how to write PID as equations but it gets simple later on.
* PID tuning. Its hard. One must check PID equations. Check if the equations are working fine via serial monitor. If all three i.e. P and I and D are working accordingly. Then one can start tuning. Start with Proportional gain then increase derivative oscillations should reduce with increase in Kd starting from a low value. There are already many guides for PID tuning.
* We used cheap motors at first. So it happens if one of the motor is lagging(might be due to ESC)..it requires integral part of the controller to correct it. Replace the motor or check for the ESC too, because even if you tune it well enough with the ropes and tying it around bars..it will topple before taking off or you’re gonna have to correct it by giving initial value to the integral part of the controller, which didn’t actually worked out for us. So we bought good motors. And also if any of the motor is hotter after running them for a while than rest of the motors, better check that ESC and motor, either of them should be faulty.
* We somehow managed to tune pitch and roll axis..tuning yaw is equally important, otherwise it wanders a lot and keeps rotating in the plane, might hit your nose too.
*Suppose quad takes off, and by mistake you bought the throttle stick down. It’d instantaneously fall down, so you’re gonna have to add some delay on How your quad reacts to the changes on the remote. What I did was used a for loop and make a variable chase the value from remote. Like this-
drag_throttle chases target_throttle(pwm value from remote read via pinchange interrupts and is between 1000us to 2000us with T=20ms). Shrimp=5 and catfish=1. So when I drag the throttle stick down..it comes smooth because catfish=1.