[chbot] Q-copter control -- was Unreasonable
Mark Atherton
markaren1 at xtra.co.nz
Thu Sep 29 18:26:15 BST 2011
Synco,
Yes, gryos are a good idea if you want to fly the unit manually. I
got distracted before finishing my Q-copter, but some notes [you may
find a better way, if so please report findings] :
Don't think the relationship between control signal and motor speed
is too critical as long as "more" translates to "faster", and is monotonic.
Assume the motor control inputs below are called "pitch+", "pitch-",
"roll+" and "roll-.
Two axis gyro needed (Pitch and Roll), with a controller in the
craft. It is quite important to mechanically align the Pitch gryo in
the correct Pitch axis :) make sure that the gyros are low gain (so
can handle + and - 60 degrees without limiting).
Yaw can be done as a final mixing step, but you will need a third Yaw gryo.
Control loops and mixing and done on the craft, not the ground. Raw
Speed, Pitch, Roll and Yaw joystick data is sent up from the ground.
For Pitch, the basic control loop [on the craft] is to keep the Pitch
joystick data balanced with Pitch gyro output. Error is fed forward
to slow down "pitch+" motor and speed up "pitch-" motor, and
vice-versa. Gryo drift is automatically taken care of by the eye of
the user flying the craft, by biasing the joystick. Re-calculate
every 20ms or so.
Same code to process Roll.
Get Pitch working completely before trying to integrate Roll for
multi-axis stabilization.
Speed control, something like
("pitch+" + "pitch-") / 2 = speed channel, with channel difference
set by Pitch_Joystick - Pitch_Gyro.
("roll+" + "roll-") / 2 = speed channel , with channel difference
being set by Pitch_Joystick - Pitch_Gyro.
Keep gyros away for the motors (magnetic interference) and draughts
(temp shifts) - maybe mount inside a tiny polystyrene enclosure.
Your world will be different because of the Turnigy, but I modified a
40MHz RC RX to output composite PWM and did the channel decode in
software with the help of input capture hardware to measure pulse
with. Gap is used to re-synchronize. Lots of error checking (repeat
PWM cells within range of previous, and in the range 1-2ms) before
accepting joystick data and of course of what to do with loss of
joystick data...
4 ch joystick assignments: [left] speed and yaw, [right] pitch and roll.
http://www.idesignz.org/UAV/ has some incomplete notes
Regards,
Mark
At 11:59 p.m. 29/09/2011, you wrote:
Hey Chris, Last week I also developed this need for a quadracoper
so I slapped 4 motors, 4 motor-controllers, big LiPo battery and 2
forward / 2 reverse propellers (else you have torque issues)
together. Got all the mixing done in my new ER-9X transmitter which
works nicely.... BUT I've concluded it's impossible to fly manually.
You are welcome to come round and try :-) Believe you need to have
motor controllers which are 'speed' controlled, (as opposed to PWM /
torque control). Also wondering if you need gyros or whether you can
fully stabilise it with a 3-axis accelerometer only? I've already
reprogrammed a off-the-shelf brushless dc motor-controller (need to
iron out some glitches), got a auto-pilot board with gyros and
accelerometers etc... so only need some time to write software. Let
me know if you are keen to help. /synco
More information about the Chchrobotics
mailing list