Haiyang Chao a écrit :
I am trying to do a step response analysis to see if I can get a model from the elevator--pitch loop. But I found out that the simulation of step response of pitch can never track the desired square wave (see the attachment). I checked the control code and I think this is due to the fact that the desired altitude is also set, so the input of the pitch step response is actually three: pitch(square wave +-10), roll(0), altitude (250).
If you want to remove all the couplings on the pitch loop, you can set to zero H_CTL_ELEVATOR_OF_ROLL and V_CTL_AUTO_THROTTLE_PITCH_OF_VZ_PGAIN. This way the pitch setpoint should be only the one you pass as argument in the attitude block.
But I don't think the error on the desired attitude is due to the coupling. The pitch control is a simple proportional correction without integral effect, so it will always have this static error (the same thing goes for the roll control). And if you ask why there is no such integral control, I would say because it is really a pain to tune, it can be dangerous for the stability, and due to the accuracy of the IR sensors, it is not really meaningful. Do you have a special need for accurate pitch control ?
So my question is that why the desired altitude is also set in the pitch response. I know this will be good for the flight stability. But I still think more information of step response is missing.
It is not the desired altitude in fact, but the desired vertical speed.
BTW: there are quite some control variables defined and I can not find clear explanations on the wiki. Like v_ctl_climb_mode, lateral_mode, v_ctl_mode. Could somebody explain these to me?
These are the different modes that tell the autopilot which control loop he should use. They are automatically set when you use attitude, heading, circle,... blocks in your flight plan. I don't think it should appear in the "user" part of the wiki, maybe in the "dev" part.
I used mj5 airframe and versatile.xml for flight plan. The syntax is like this:
<attitude alt="250" roll="20.0" until=" stage_time > 3" vmode="alt"/>
<attitude alt="250" roll="-20.0" until="stage_time > 3" vmode="alt"/>
I traced back to flight_plan.h. So the real control command is :
NavAttitude(RadOfDeg(0.000000)); /* lateral_mode = LATERAL_MODE_ROLL, h_ctl_roll_setpoint = _roll*/
/*v_ctl_climb_mode = V_CTL_CLIMB_MODE_AUTO_THROTTLE, nav_pitch = _pitch*/
/*v_ctrl_mode = V_CTL_MODE_AUTO_ALT, nav_altitude = -alt, v_ctl_altitude_pre_climb = _preclimb*/