holco
Member
Explanation from George,
Here's how PID works-
P is the prportional gain adjustment of the error that is present between a setpoint ( your input command ) and the IMU output.
So, when your IMU is calibrated, the output is 0. Your setpoint is also 0 ( stick unmoved ) and therefore, servo output is zero + 1500uS ( centre)
When you move your stick slew to command ... say.... a 15 degree change on tilt, and the IMU is still standing on the camera mount unmoved, you dial in P-Gain, to an amount of how much servo has to move to go to that angle.
OR
If you by hand move the camera mount 15 degrees, the setpoint is still 0 and the imu feels a 15 degree change. The P-gain will also now determine how much the servo has to move backwards to keep the tilt horizontal as before.
ALL good !!.
The D is what I call Acceleration... This is always looking and comparing at what the last rotation rate was against the current rotation rate, and if it notices a change, then this is amplified by the D value. This means, that if you started to rotate, then you have a value to work with, and this is fed to the servo to further accelerate it into the direction of change. when you reach a constant rate of change, this does not have any difference in value, and therefore this value goes low.
Since vibration is a constant change of direction ( oscillation ), then with the D-gain, we are essentially also amplifying vibrations.
All good 2 !!
The I term or what I call smooth is the Integral gain.
This is an accumulator of change between setpoint and actual angle. so when we start rotating, +1,+2,+3..... at this time we have rotated +1+1+1 = +3
It's a relatively slow controller that is accumulating change, and adding it into the PID mix.
With this function mixed to the above two controls, if there is any long term error between the setpoint and the actual position, this gets accumulated fast.
So, with the IMU out of axis as when one is doing proportional control, there will always be an offset... so what this control will do.. is actually keep adding to the offset to itself
like in math: x = x + offset.
You can see that if the offset is constant ( eg.. IMU on AV130, you command tilt down at -25 degrees, and the servo moves to -25 ( due to P gain ) and the offset is still there between your setpoint (-25) and IMU still on table ( 0 ) .. the formula is now:
x=x+25
25=25+25
50=50+25
75=75+25.... and so on.
So there was the Decay... or a limiter on this ever growing value. ... WHY ??
Because.... this I term is useless on Proportional systems like TILT and ROLL on an AV130,
BUT... is needed on 360 servo systems.. where the servo is a stupid device which doesn't know its position and its position is determined by Picloc sitting in the motor shaft of the servo.
This means... that when you command a position for the Picloc ( Now mounted ON the camera plate ), The accumulated error now has a function....
Because you cammand Picloc to get the camera to -25 degrees tilt ( Same as before ),
but now the Picloc itself is being moved to go to that camera angle of -25.
So as it approaches the final setppoint of -25, the I term ( or error signal ) is becoming progressively lower,
but it is important to have this control, because it drives the servo harder depending on how much travel the servo has to move to arrive to the setpoint...
because the farther out it is, the higher will be the error, and it will get closer to zero ( and hopefully not overshoot ) as the setpoint is reached.
Therefore, I think that by now, with the research you may have done ( wiki ) and also my above simple explanation, you should have a better understanding of what the PID controls do
Here's how PID works-
P is the prportional gain adjustment of the error that is present between a setpoint ( your input command ) and the IMU output.
So, when your IMU is calibrated, the output is 0. Your setpoint is also 0 ( stick unmoved ) and therefore, servo output is zero + 1500uS ( centre)
When you move your stick slew to command ... say.... a 15 degree change on tilt, and the IMU is still standing on the camera mount unmoved, you dial in P-Gain, to an amount of how much servo has to move to go to that angle.
OR
If you by hand move the camera mount 15 degrees, the setpoint is still 0 and the imu feels a 15 degree change. The P-gain will also now determine how much the servo has to move backwards to keep the tilt horizontal as before.
ALL good !!.
The D is what I call Acceleration... This is always looking and comparing at what the last rotation rate was against the current rotation rate, and if it notices a change, then this is amplified by the D value. This means, that if you started to rotate, then you have a value to work with, and this is fed to the servo to further accelerate it into the direction of change. when you reach a constant rate of change, this does not have any difference in value, and therefore this value goes low.
Since vibration is a constant change of direction ( oscillation ), then with the D-gain, we are essentially also amplifying vibrations.
All good 2 !!
The I term or what I call smooth is the Integral gain.
This is an accumulator of change between setpoint and actual angle. so when we start rotating, +1,+2,+3..... at this time we have rotated +1+1+1 = +3
It's a relatively slow controller that is accumulating change, and adding it into the PID mix.
With this function mixed to the above two controls, if there is any long term error between the setpoint and the actual position, this gets accumulated fast.
So, with the IMU out of axis as when one is doing proportional control, there will always be an offset... so what this control will do.. is actually keep adding to the offset to itself
like in math: x = x + offset.
You can see that if the offset is constant ( eg.. IMU on AV130, you command tilt down at -25 degrees, and the servo moves to -25 ( due to P gain ) and the offset is still there between your setpoint (-25) and IMU still on table ( 0 ) .. the formula is now:
x=x+25
25=25+25
50=50+25
75=75+25.... and so on.
So there was the Decay... or a limiter on this ever growing value. ... WHY ??
Because.... this I term is useless on Proportional systems like TILT and ROLL on an AV130,
BUT... is needed on 360 servo systems.. where the servo is a stupid device which doesn't know its position and its position is determined by Picloc sitting in the motor shaft of the servo.
This means... that when you command a position for the Picloc ( Now mounted ON the camera plate ), The accumulated error now has a function....
Because you cammand Picloc to get the camera to -25 degrees tilt ( Same as before ),
but now the Picloc itself is being moved to go to that camera angle of -25.
So as it approaches the final setppoint of -25, the I term ( or error signal ) is becoming progressively lower,
but it is important to have this control, because it drives the servo harder depending on how much travel the servo has to move to arrive to the setpoint...
because the farther out it is, the higher will be the error, and it will get closer to zero ( and hopefully not overshoot ) as the setpoint is reached.
Therefore, I think that by now, with the research you may have done ( wiki ) and also my above simple explanation, you should have a better understanding of what the PID controls do