![]() |
PID Inputs and Outputs
I am wondering if the inputs into the PID SubVI need to be scaled in order to match the output. Can you simply, for example, have a process value that is an angle measure (using an encoder) and a setpoint that is an angle measure and have the control output a value that controls the motor speed, in which case the control accounts for the change in angle based on adjusting the motor speed. The output range also being -1 to 1 to match the motor.
I'd imagine in this case a small proportional gain would be needed since the error in the angle in degrees may be quite large and a small change in the motor speed accounts for a large change in the angle. Something like: ![]() ****The encoder distance will be changed into an angle like in the example motor with encoder vi Thank you |
Re: PID Inputs and Outputs
Im not 100 percent if it works yet but that is what I am doing. Just taking the value straight from the encoder into the PID VI. I mean it should work because the error (difference in where you want it and where it is) is derived from the values your giving it so as long as the process value can possibly equal the setpoint (ex. your process value is between 1 and -1 and your setpoint is between 2 and -2).
|
Re: PID Inputs and Outputs
The setpoint and the feedback (process variable) need to be compatible, with the same scale. The PID is going to try to drive the output until the inputs match.
|
Re: PID Inputs and Outputs
Quote:
I did make the setpoint and the process variable the same scale by having the second Encoder Get wired to the shift register, but the main concern is whether it is a problem having the PID control a speed based on an error in angle. My process value and outputs are angle so they can by as high as 90 degrees or more. Its the output range that I've limited to -1 to 1 in order to match motor speed. |
Re: PID Inputs and Outputs
Not a problem at all. As you've observed it will simply effect the magnitude of the gains.
|
Re: PID Inputs and Outputs
Thank you for the responses. The method works -- just needed to be careful of the integral gain that caused a periodic motion.
|
Re: PID Inputs and Outputs
I recommend removing the error wire between the Motor SetOutput and the Encoder Get. This will allow those two independent operations to run in parallel.
-Joe |
Re: PID Inputs and Outputs
Quote:
Also in the image, the encoder should be started |
| All times are GMT -5. The time now is 10:11. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi