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: http://i56.tinypic.com/357r02a.jpg
****The encoder distance will be changed into an angle like in the example motor with encoder vi

Thank you

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).

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.

I am wondering if the inputs into the PID SubVI need to be scaled in order to match the input.

I meant output there

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.

Not a problem at all. As you’ve observed it will simply effect the magnitude of the gains.

Thank you for the responses. The method works – just needed to be careful of the integral gain that caused a periodic motion.

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

I thought to get the new encoder value right after the motor input has been sent from the PID in each iteration. I’ll see if it makes a difference

Also in the image, the encoder should be started