Hi guys,
I noticed that sometimes our hexarotor wants to spin around during take-off. The reason is that due to big change in magnetic field around the IMU (as the motor are starting up), the estimated yaw can drift up to tens of degrees (depends on the airframe). So the control system want to compensate for that which is fine.
However, the motor mixing saturation (see
https://github.com/paparazzi/paparazzi/issues/385 ) should keep motors from ramping up while the throttle is low (less than 30%).
I did some tests on the test bench, and here are the results:
The throttle was around 15% all the time. MAX_SATURATION_OFFSET was set to 200. You can see that around T=730s, the yaw err integrator winds up (middle plot), that's fine. In the top plot you can see that the yaw command is way more than roll or pitch, which is also fine - as the saturation is done in motor mixing (after calculating the commands). Roll and pitch were constant.
However, in the bottom plot you can see the actual output to the motors (motor_mixing.commands), and it is unbounded (3 motors go to PPRZI_MAX, other 3 to zero). Is that a correct behaviour?
The jumps in the motor commands correspond to an increase in yaw gains.
I would expect the motor commands to differ up to MAX_SATURATION_OFFSET, so at low throttle it doesn't ramp up the aiframe.