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

  • Sean...what is your hardware setup?  Are you using CH5 also for the second aileron? 
  • If you don't need to reverse ch5 servo, it should be enough to just add "APM_RC.OutputCh(CH_5, g.channel_roll.radio_out);", as you said. Good luck with hacking!
  • The patch was created for 2.11. I can try to port it to latest version during the weekend as I'm planning to do upgrade while I add airspeed sensor and telemetry transmitter.
  • One thing to keep in mind, Historicly, the reason we were keeping aileron support to one channel, was keeping the first 4 channels (mux passthrough) was allowing for primary rc control, in case of APM failure.

    Flapperon support takes primary navigation out to a non-muxed channel. This causes a configuration that could fail if the apm failed and couldnt support a hardware manual mode.

     

    Now that being said, that was early on...

     

    Today; a quad copter (ACM) will never be flyable with hardware manual, (thats why they avoid ch8...)

     

    so whats the huge issue with having a non-flyable config if apm goes on the blink?

    (apm may glide, acm will plummit)

     

    I feel it could to be added to the APM3 wish list, as enhanced speed control options with flapperon and potentialy airbrake support.

  • Yes it would be nice to have proper flaperon support. And that is something you can not get with Y-cable, nor with reversed Y-cable.

     

    And BTW can someone add a "flaperon" tag to the blog post ? (added by moderator)

  • I'd like to get flaps/airbrake feature implemented and I've thought it a bit. It's not nearly as simple modification as aileron function, but not too hard to do. Only problem is that I'm new to ardupilot code and I'd like to see it done properly so I'm not certain that I'd be the right person to do it.
  • 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.