3689407885?profile=original

I recently received my Ardupilot mega, but I could not find instructions on how to get it working on airframes like Twinstar, which have separate servos for each aileron. One related blog post here in diydrones mentioned, that feature is being implemented (although I did not find an open issue about it) but I was too impatient to wait for proper fix.

 

Here's my ugly fix for this:

1. Disable aileron mixing from transmitter and make connections to ardupilot as you would do on 1-servo aileron case.

2. Connect 2nd aileron servo to ardupilot output 5

3. Open ardupilot sketch in arduino ide and open "Attitude" file

4. Insert these two lines to place marked in picture:

 

g.rc_5.radio_out = g.channel_roll.radio_max.get() + ( -1 * (g.channel_roll.radio_out - g.channel_roll.radio_min.get()));       
APM_RC.OutputCh(CH_5, g.rc_5.radio_out); // send to Servos

 

 

5. Compile and upload

 

Remove "-1 *" part, if 2nd servo does not need to be reversed compared to 1st servo.

 

Note!

Since failsafe mux only operates on first four channels, on event of failure, 2nd aileron can't be moved.

 

I hope this feature will be implemented properly in the near future, but this should do at least for now and at least for me. Hope this helps others too!

 

 

 

E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • Yes Hamish but again you just need a Y connector and can turn over the servo to reverse it. Also flaps I found better to code as a GPS related output (get low deploy flaps).
  • well controlling the two servos allows them to be used as flaps with a bit extra code?? depending on your airframe of course
  • Y-lead method works perfectly, if other servo does not need to be reversed. I've heard that the exist y-leads with mixer, which can reverse other servo, but I don't like idea to add extra hardware to do a job that ardupilot could do easily. Also, I live in such a small city that I'd have to find one from internet and spend time waiting for it to arrive.
  • Using Ailerons has been discussed at length by many people (including myself). Only one lead in and one lead out on the APM with the out lead having a Y-connector on it (£3). It easy, fast and no worries about code changes (and servos being locked in failsafe).

    Would not expect this to be in development given the cheap and easy hardware method and the required change to the failsafe setup. Nice job on coding though.

This reply was deleted.