LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PID motor control

I am trying to implement closed loop PID control of DC motor using NI cDAQ 9178 module.

referring to : https://decibel.ni.com/content/docs/DOC-16983

The VI works fine in software.PID controller output is also within acceptable limits i.e <10V.

However,at interfacing stage following errors are seen :

PID controller gives a very large or a very small output  to DAQ 9264 and hence output signal cannot be generated.

Also,output DAQ assistant indicates an error involving buffer size.

I am posting the VI below.

Please help me out.

0 Kudos
Message 1 of 4
(2,296 Views)

Hi Gaussy,

 

your VI looks very different to the one shown in your linked example.

 

Why don't you use the PID toolkit? Why do you need the Simulation toolkit and a MathScript node?

How should your PID work, when it is bound to some static signal due to DATAFLOW? A PID loop should never run until the user stops the loop…

Best regards,
GerdW


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

Thank you, I am now using the PID toolkit. I am able to run the motor, but I feel that there is some problem in the speed sensing part.I have two questions

1. Using cDAQ 9178 and Digital card 9401 how do I make connections for frequency measurement. I have read that counters can be accesed through PFI on the chassis.How to do that?

2. When using analog input card 9201, I am not able to get a stable reading of speed (motor runs and stops alternately) and the PID controller output oscialltes between +8 and -8 only. 

I am uploading both the VI's.

 

Pls help me out.

Thanks

Download All
0 Kudos
Message 3 of 4
(2,232 Views)

Hi Gaussy,

 

2) Are your PID parameters for real? What happens when you decrease Kp (a lot)?

 

1) Can't say, never used a cDAQ…

Best regards,
GerdW


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