dune icon indicating copy to clipboard operation
dune copied to clipboard

Send roll, pitch and throttle commands to Arduplane

Open krisgry opened this issue 7 years ago • 2 comments

As of Arduplane 3.7, it is possible to command roll, pitch and throttle directly through GUIDED mode. The main benefit are

  • avoids the use of FBW modes, which translates the setpoints to/from PWM values for communication with Ardupilot. This relies on using the same mapping function, with the same limits, on both ends. We had some issues with oscillations, since the setpoints where not identical in DUNE and in AP. (This could possibly be fixed by setting the Ardupilot limits from DUNE and updating the DUNE mapping to also consider the deadband).
  • avoids the internal TECS, giving more control to DUNE, since AP does some filtering etc to the climb rate references in the TECS. This could have been solved by using FBWA, but it has the same problems as mentioned above.

This adds some more complexity to the consume controlLoops functions: When CL_ROLL is activated, it is no longer necessarily the case that we are going to use FBWB, since we could also be going into this new GUIDED mode. The second commit here includes a state machine that causes the task to wait for a predescribed time, CLtimeout, to see if more CL will arrive. If CL_PITCH arrives, we go into the new GUIDED mode, if not we go into FBWB. A similar issue occurs when in the new GUIDED mode and we receive a deactivation of CL_PITCH; should we go to FBWB, or are we waiting for a deactivation of CL_ROLL to stop using any of these controllers (and go into INIT)?

We have flown this on many occasions, and have found CLtimeout = 200 ms to work well for the X8. I have not been able to test this with your newly updated master code yet, since we have not merged that into our code yet, but this PR builds at least. Thought I'd post it now, so you can have a look, since we discussed this earlier today.

krisgry avatar Jul 04 '18 17:07 krisgry

@mariacosta will look at this as soon as she finds the time.

zepinto avatar Jul 12 '18 10:07 zepinto

She must be very busy

krisgry avatar Oct 15 '21 14:10 krisgry