LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DC motor directional control

Hi,


I measure 5V on the pin when the driver and motor are attached. As for the current, I'm actually not sure but I presume it's adequate as my motor runs.


The issue at hand is not so much this, but how do I actually program LabView with the logic to go forward and reverse on command. As of now, I'm only able to make that happen if I physically change the wiring. Could you guide me in the right direction with this?

0 Kudos
Message 11 of 47
(1,954 Views)

What is that printed circuit board supposed to be?

0 Kudos
Message 12 of 47
(1,954 Views)

Hi mm,

 

what kind of signal does your motor driver expect to turn the motor CW or CCW?

Once you answer that question we can start to help you!

 

Is there a manual for that driver? Can you attach this?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 13 of 47
(1,951 Views)

That is my motor driver. Model DRV8833 from Pololu. Here is a link.

0 Kudos
Message 14 of 47
(1,950 Views)

AH, great! I feel like we're making progress again.

 

From this link, we can read the datasheet for the driver. Here it says that the motor will go forward/reverse based on this table:

image.png

 

 

Thus, I think the two IN pins should be connected to ao0 and ao1 on my DAQ. However, I'm not sure how to alternate between setting one to 0 and the other to output a PWM signal. I know this is a simple task using Arduino programming, and likely comparably simple in Labview as well, but I'm new to this software and thus am having issues.

0 Kudos
Message 15 of 47
(1,948 Views)

FIgured its easier for me to attach the manual for the driver itself. It can still be found on that link, but I've attached it below.

 

 

0 Kudos
Message 16 of 47
(1,948 Views)

Hi mm,

 

outputting a 0 means 0%PWM, while a 1 is 100%PWM...

 

Start with learning basic DAQmx, then learn to handle one AO, then learn to handle both. Have you examined the example VIs coming with LabVIEW?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 17 of 47
(1,947 Views)

Hi! Thanks, I know what the 0 and 1 represent. I also know how to do the wiring individually and how to handle one A0. My current physical wiring is allowing me to rotate in either forward or reverse direction without an issue.

 

My concern is with internally programming a logic that can send a PWM signal to either IN1 or IN2 while setting the other to 0. This should be happening "on the go", not through me physically switching the wiring. That's what I'm seeking help with. Is it possible for you suggest a solution to this exact issue? 

 

I was experimenting with Case Structures for a bit but Raven's Fan suggested that's not a good idea. I'm open to any solutions you may have. 

0 Kudos
Message 18 of 47
(1,942 Views)

You didn't listen to what I said.

 

I said to use case structures.  But not the way you were doing it. where you had different Express VI's in the different cases.  The DAQmx belongs outside the case structures.

 

Thanks for actually attaching a manual, and details about what the mysterious PCB board is.  Details like this make it easier to understand what is going on much earlier in the process!

0 Kudos
Message 19 of 47
(1,940 Views)

Thanks for your patience! I appreciate all the help. 

 

Can you please elaborate on the solution you're suggesting? 

0 Kudos
Message 20 of 47
(1,936 Views)