LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PWM control of a 24v DC motor using NI PCI 6036 (with BNC 2110) and H-Bridge L298

Hello People, 

This is my first time posting a query on this forum. 

The idea is to control the speed of a DC motor with a PWM voltage signal instead of using a potentiometer and manually reducing the voltage to reduce the speed. I have seen a few examples and posts on this forum where people have tried to program Arduino with L298. I don't want an arduino sitting in the middle rather have my PCI 6036 with BNC 2110 sending an analog voltage signal with the required duty cycle to reduce or increase the speed. L298 sits in the middle as the driver for the motor and to make it change its direction if required. 

I have two problems.

1. I am not sure how the hardware circuit should look like. I know the motor Vin and Gnd go to L298 motor A outputs. My 24volt power supply and its ground should be connected to Vin and Gnd of the L298. Where should I connect the analog output from the BNC to on the L298 pins. 

2. Is my LabVIEW program correct? See the two pictures (PWM control and PWM control 2 attached).

 

Thanks a lot!  

Download All
0 Kudos
Message 1 of 5
(2,740 Views)

Hi amaar,

 

why do you think you need to use AO signals?

Why not use DO or (maybe even simpler) CTRout signals?

(Your PCI6036 is a multi-function device!)

 

Best regards,
GerdW


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

Well to be honest I thought that was the simplest solution. But if you have a better solution please share it. Thanks!

0 Kudos
Message 3 of 5
(2,702 Views)

So now I can control the speed using the analog signal and the program works. But as suggested the counter outputs may be a better option. Could someone kindly share the program that does that or an example. Thanks! 

0 Kudos
Message 4 of 5
(2,671 Views)

Hi amaar,

 

LabVIEW comes with a huge example library, which also contains a lot of examples for all kind of DAQmx features.

Did you search for an example on your own?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 5
(2,614 Views)