Howto:Design an autopilot: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
(→‎Adding the autopilot to the -set.xml file: Clarifying that the path tho the autopilot configuration file should be within the <tt><systems></tt> tags within the <tt><sim></tt> tags)
mNo edit summary
Line 148: Line 148:


== Pitch hold ==
== Pitch hold ==
So, let's move over to a pitch hold. Our goal is to have a controller that maintains an arbitrary pich. The only difference to the wing leveler is that you are only interested in elevator position changes, not absolute values. To put it in other words: increase elevator for more pitch, decrease for less pitch and maintain elevator position if the pitch is right. This calls for a pid-controller, because it only computes offset values. And you will end up with a relative small value for Kp to avoid rapid imediate movements and a relative small value for Ti to have a greater effect over time.
So, let's move over to a pitch hold. Our goal is to have a controller that maintains an arbitrary pitch. The only difference to the wing leveler is that you are only interested in elevator position changes, not absolute values. To put it in other words: increase elevator for more pitch, decrease for less pitch and maintain elevator position if the pitch is right. This calls for a pid-controller, because it only computes offset values. And you will end up with a relative small value for Kp to avoid rapid imediate movements and a relative small value for Ti to have a greater effect over time.


Start again with a no-op pid-controller (Kp=0, Ti=100.000 and Td=0). Input is your current pitch (<tt>/orientation/pitch-deg</tt>), reference is a target-pitch property (you wouldn't want a constant zero here, <tt>/autopilot/settings/target-pitch-deg</tt>) and output goes to elevator-cmd (<tt>/autopilot/internal/elevator-cmd</tt>).  
Start again with a no-op pid-controller (Kp=0, Ti=100.000 and Td=0). Input is your current pitch (<tt>/orientation/pitch-deg</tt>), reference is a target-pitch property (you wouldn't want a constant zero here, <tt>/autopilot/settings/target-pitch-deg</tt>) and output goes to elevator-cmd (<tt>/autopilot/internal/elevator-cmd</tt>).  
3

edits

Navigation menu