From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW FPGA - Control PID - LM35

Hi,

I'm using the plataform myRIO of National Instruments. I have to use the LabVIEW FPGA. And I'm applying an PID control into a DC motor based an temperature in of LM35.
But I had some problems.
The first is that the measured temperature is too varying, up until 10ºC.
The second problem is that to drive the motor I'm applying a PWM signal. How can I do this in the LabVIEW FPGA?
 
Thanks,
Silvane
Download All
0 Kudos
Message 1 of 6
(3,867 Views)

For PWM in FPGA, just turn on a digital output, wait your 'on' time, turn off your digital output and wait your 'off' time. The ratio of the on time to the off time is your duty cycle and the sum of the on and off time gives your PWM frequency.

 

This isn't the most efficient solution, but it's one of the easiest to see what's happening:

 

FPGA PWM.png


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 6
(3,857 Views)

I get it, but how can I connect the PID output to the PWM signal?

 

Tanks

0 Kudos
Message 3 of 6
(3,843 Views)

Hi silvane,

 

the PID should output a duty cycle value. You just calculate ON/OFF time from this duty value…

Best regards,
GerdW


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

But, the output PID do not is a duty cicle? I don't understand

 

Thanks,

Silvane

0 Kudos
Message 5 of 6
(3,818 Views)
Duty cycle is a % from 0 to 100 - 0 being always off, 100 being always on and anywhere in between is the ratio of on-time to off-time.

Scale your PID output maximum values from 0 to 100.

Then calculate the on/off time (the reverse of the calculations I've shown in my snippet) and use that in your PWM.

LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 6 of 6
(3,812 Views)