In Position mode with 1.11.0 beta (tailsitter in MC mode) pitch rate controller does not seem to work: actuator outputs is proportional to rate setpoint and does not depend on estimated rate. Difference with Stabilized mode can be clearly seen in FlightPlot with following expressions:
(actuator_outputs_0.output[4]-actuator_outputs_0.output[5])/4
vehicle_angular_velocity_0.xyz[1]*250
vehicle_rates_setpoint_0.pitch
https://logs.px4.io/plot_app?log=425e2a6c-e1b2-4cd0-9616-00f40cca6bb0
Position mode:
Stabilized mode:
Neither yaw in this log nor pitch with older firmware have this effect.
Is it true that pitch rate controller does not work in Position mode?
Which controller controls rate setpoint in Position mode? (This setpoint looks like result of some PID.)
1 Like
Is it true that pitch rate controller does not work in Position mode?
NO, run here:https://github.com/PX4/Firmware/blob/master/src/modules/fw_att_control/FixedwingAttitudeControl.cpp#L506
Which controller controls rate setpoint in Position mode? (This setpoint looks like result of some PID.)
here: https://github.com/PX4/Firmware/blob/master/src/modules/mc_pos_control/mc_pos_control_main.cpp#L700
The angle setting value generated by the mc position controller is input into the fw attitude controller
Thank you, xdwgood.
Are you sure that line 506 is executed? It’s inside if (_vcontrol_mode.flag_control_attitude_enabled)
, and from https://github.com/PX4/Firmware/blob/v1.11.0-beta2/src/modules/fw_att_control/FixedwingAttitudeControl.cpp#L129 it seems to me this flag is false for VTOL in hovering mode.
sorry
pitch rate control run here:
_rates_sp.timestamp = hrt_absolute_time();
_rate_sp_pub.publish(_rates_sp);
} else {
vehicle_rates_setpoint_poll();
_roll_ctrl.set_bodyrate_setpoint(_rates_sp.roll);
_yaw_ctrl.set_bodyrate_setpoint(_rates_sp.yaw);
_pitch_ctrl.set_bodyrate_setpoint(_rates_sp.pitch);
float roll_u = _roll_ctrl.control_bodyrate(dt, control_input);
_actuators.control[actuator_controls_s::INDEX_ROLL] = (PX4_ISFINITE(roll_u)) ? roll_u + trim_roll : trim_roll;
float pitch_u = _pitch_ctrl.control_bodyrate(dt, control_input);
_actuators.control[actuator_controls_s::INDEX_PITCH] = (PX4_ISFINITE(pitch_u)) ? pitch_u + trim_pitch : trim_pitch;
float yaw_u = _yaw_ctrl.control_bodyrate(dt, control_input);
_actuators.control[actuator_controls_s::INDEX_YAW] = (PX4_ISFINITE(yaw_u)) ? yaw_u + trim_yaw : trim_yaw;