LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PID with Integer output

Hey guys, I'm trying to control a motor speed using Labview's PID toolkit

 

PIDSNI.png

My issue is that my motor controller vi (MTR-CM) can only accept integer values within a range of 0 to 600 and I can't find a good way to limit what the PID control can output. I've attached demo code with an example of how the application would be implemented (Main.vi) 

 

If anyone knows a good way to solve this, I'd greatly appreciate input.

0 Kudos
Message 1 of 3
(2,902 Views)

Scale your float to the appropriate integer range.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 3
(2,895 Views)

Hi ATE,

 

My issue is that my motor controller vi (MTR-CM) can only accept integer values within a range of 0 to 600 and I can't find a good way to limit what the PID control can output.

Set the output range of the PID function to [0, 600] and apply RoundToNearest on the PID output:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 3
(2,890 Views)