11-10-2018 09:01 PM
Hi all,
I'm trying to use DRV8833 motor driver to drive a small DC motor forwards and backwards.
My goal is to move a potentiometer knob and compare it to a numerical control that I set (called "Desired Reading" in the .vi). Depending on whether the delta is positive or negative, I'd like the motor to move forwards or in reverse.
I'm using DAQ USB 6001.
I'm having the following problems:
- Maybe my physical wiring is incorrect, but the motor does NOT switch directions when the delta switches signs from positive to negative.
- Sometimes, the motor continues to receive power even when I stop running the VI and I don't understand why?
I've attached my .vi below. Thanks!
11-10-2018 09:20 PM
Your negative delta is being fed into the duty cycle of simulate waveform.
What do you expect to happen with a negative duty cycle? What does that even mean?
11-10-2018 09:25 PM
Probably a good time to mention I'm a bit of a noobie, but I am trying to learn.
-DC% didn't make sense to me either, but I got the idea from another thread so I figured I'd try it out. They said something about how this works if you have an analog I/O card, which I do on the DAQ USB 6001
11-10-2018 09:33 PM
Try writing out +5 to a DAQmx Analog Write. See what happens.
Try writing out -5. See what happens.
Try +2. -2. zero.
Just get rid of the the square wave simulation.
11-10-2018 09:50 PM
Hey, I just tried it out.
I used the Simulate function to simulate a DC signal at:
+5 -- CW rotation
+2 -- CW rotation
0, -5 and -2 -- No rotation.
I know my motor can go in both directions though, I see it if I reverse the leads. What gives?
11-11-2018 09:35 AM
The manual says the analog output is +/- 10 V. And changing the polarity should reverse a DC motor.
Check the voltage output from the DAQ device with a multimeter.
Show a wiring diagram. Show your latest VI.
11-11-2018 03:47 PM
Okay, I just tried with a multimeter. Here is my simple VI, I control the DC offset to set the output voltage to my motor.
Using a multimeter, I can confirm that for positive offsets, I'm picking up on my multimeter the value of the offset.
For 0 voltage, I pick up a -2.43 V.
For negative values for the offset, I pick up a constant -0.743 V.
Neither 0 or negative offset values cause any rotation of the motor.
----
My wiring is shown below:
11-11-2018 03:58 PM
11-11-2018 04:32 PM
yeah, I've seen quite a few people using DAQmx. I'm more comfortable with Express VI so I default to that, especially when I'm on a time crunch.
As for your questions, I'm using a DRV8833 driver so I presume the adequate current is being supplied to the motor? I've read the manual for the pin, but I'm not sure what I'm looking for here.
11-11-2018 05:07 PM
Hi mm,
as you have drawn in your sketch you use that +5V pin to supply the driver as well as the motor. The manual states a max 150mA current from this pin: again I ask about the current consumption of your setup...
Which voltage do you measure on that pin when your driver and motor is attached?
What about using an external power supply for your setup?