marvin:ecp2
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
marvin:ecp2 [2009/01/28 23:41] – sohn | marvin:ecp2 [2009/01/29 10:15] – rieper | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | |||
<texit info> | <texit info> | ||
author=Johnny Rieper, Bent Bisballe Nyeng and Kasper Sohn | author=Johnny Rieper, Bent Bisballe Nyeng and Kasper Sohn | ||
Line 9: | Line 8: | ||
**Duration of activity:** 8-12\\ | **Duration of activity:** 8-12\\ | ||
**Participants: | **Participants: | ||
+ | //Note that we returned to this subject several times during the following lab sessions.// | ||
=====Project Goal===== | =====Project Goal===== | ||
Line 21: | Line 21: | ||
- | =====Our Angle of Approach Towards Control Theory===== | + | ===== Theory ===== |
+ | ====Our Angle of Approach Towards Control Theory==== | ||
Basically there are three approaches to our control problem, which we will describe briefly in an increasing order of complexity. | Basically there are three approaches to our control problem, which we will describe briefly in an increasing order of complexity. | ||
Line 27: | Line 28: | ||
The third method is to derive a mathematical model of the dynamics of the control plant and this can be somewhat complex. In the case of a balancing robot it is helpful to look at the mathematical modelling of an inverted pendulum and there next to add the physical dimensions of the balancing robot. When working with modelling we end up with non linear equations, which is a problem as our controllers are linear. One common method is to use the state space representation and then to make a linearization around the steady state point or the equilibrium. If our mathematical model is precise and close to the true physical model we obtain a great theoretical foundation for creating a stable system. This is exactly what Yorihisa Yamamoto(([[http:// | The third method is to derive a mathematical model of the dynamics of the control plant and this can be somewhat complex. In the case of a balancing robot it is helpful to look at the mathematical modelling of an inverted pendulum and there next to add the physical dimensions of the balancing robot. When working with modelling we end up with non linear equations, which is a problem as our controllers are linear. One common method is to use the state space representation and then to make a linearization around the steady state point or the equilibrium. If our mathematical model is precise and close to the true physical model we obtain a great theoretical foundation for creating a stable system. This is exactly what Yorihisa Yamamoto(([[http:// | ||
- | =====Introducing the PID Controller===== | + | |
+ | |||
+ | ====Introducing the PID Controller==== | ||
The digital implementation of a PID controller is actually based on very simple filtering techniques similar to what we described in the [[http:// | The digital implementation of a PID controller is actually based on very simple filtering techniques similar to what we described in the [[http:// | ||
Line 127: | Line 130: | ||
</ | </ | ||
- | ===== Defining the States in the Control Loop ===== | + | Further readings and inspiration are found at " |
+ | |||
+ | ==== Defining the States in the Control Loop ==== | ||
Now that we have established our choice of control loop, we must determine an error function. In a state space representation this corresponds to determining the states, which are defined through differential equations describing the dynamics of the control plant. Therefore we may turn to the model described in the documentation of Rich Chi Ooi((Balancing a Two-Wheeled Autonomous Robot, Author Rich Chi Ooi, The University of Western Australia | Now that we have established our choice of control loop, we must determine an error function. In a state space representation this corresponds to determining the states, which are defined through differential equations describing the dynamics of the control plant. Therefore we may turn to the model described in the documentation of Rich Chi Ooi((Balancing a Two-Wheeled Autonomous Robot, Author Rich Chi Ooi, The University of Western Australia | ||
Line 144: | Line 149: | ||
- | ===== Parameters and Stability | + | ==== Parameters and Stability ==== |
The calculation of the right PID control parameters is essential to secure a stable system. This is called loop tuning. If loop tuning is not done according to the task at hand, the control system will become unstable i.e. the output will diverge. Oscillation might occur in this case. The only thing that will prevent divergens or oscillation is saturation or mechanical breakage. This may happen a lot when trying to produce a balancing robot and is generally not a problem due the great structural integrity, however if the controller is to control something else that might not be as rigid as our construction oscillation is always something to avoid in the first place. \\ | The calculation of the right PID control parameters is essential to secure a stable system. This is called loop tuning. If loop tuning is not done according to the task at hand, the control system will become unstable i.e. the output will diverge. Oscillation might occur in this case. The only thing that will prevent divergens or oscillation is saturation or mechanical breakage. This may happen a lot when trying to produce a balancing robot and is generally not a problem due the great structural integrity, however if the controller is to control something else that might not be as rigid as our construction oscillation is always something to avoid in the first place. \\ | ||
Loop tuning could be defined as adjusting the control loop parameters (Proportional gain(P), Integral gain (I) and Derivative gain(D)) to the optimum value for a desired control response. The z-transform for the controller should, in order to be stable obey the rules for a stable system, that is poles of the system should be located inside the unity circle, see diagram below. | Loop tuning could be defined as adjusting the control loop parameters (Proportional gain(P), Integral gain (I) and Derivative gain(D)) to the optimum value for a desired control response. The z-transform for the controller should, in order to be stable obey the rules for a stable system, that is poles of the system should be located inside the unity circle, see diagram below. | ||
Line 194: | Line 199: | ||
- | ===== Results | + | ===== Implementation |
First we present the software implementation, | First we present the software implementation, | ||
Line 270: | Line 275: | ||
- | ====Gyro Problemer==== | ||
- | The gyro is an analog sensor so the output is measured by the NXT A/D hardware and the suspicion is that the gyro readings are being influenced by a possible drop in reference voltage in the A/D which is changing the reading. this is backed up by your comments about low batteries.(([[http:// | ||
- | |||
- | huskeseddel (Johnny):\\ | ||
- | feature extraction, gain control | ||
- | integral, diff, proportional | ||
- | midling af gyrodata - virkede lovende ved stilstand, men hjalp ikke ved test af balanceevne | ||
- | Der blev lavet en lcd-klasse til udskrivning på display | ||
- | Der blev forsøgt med auto kalibrering af gyroscoop ved beregning af varians | ||
- | Der blev forsøgt at kompenserere for gyrobias ved ad hoc metoder | ||
- | |||
- | Implementerede PID regulering, Ki, Kd, Kc. | ||
- | Afprøvede " | ||
- | Bedste resultat opstod ved fintuning ad hoc, men besværligt fordi, der skal uploades for hver ny indstilling af parametre. | ||
- | Spørgsmål om det er tilstrækkeligt kun at måle på " | ||
- | Har tjekket integrations/ | ||
- | Balancepunktskalibrering bedre, når Marvin er oprejst end liggende. | ||
- | Problemer med fremad kørsel. Kan dreje og køre baglæns | ||
+ | ====Hardware Related Issues==== | ||
+ | At first we experienced severe stability problems as Marvin was highly sensitive to the offset of the gyroscope. The offset calibration did not appear to be stationary and this lead to diverging oscillations, |
marvin/ecp2.txt · Last modified: 2009/01/29 11:02 by rieper