LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DC motor directional control

Hi, I am new to Labview and the MyRio and I need some help when it comes to getting my DC motor working with my motor driver and my encoder. 

 

The driver and encoder I am using are:

 

DRV8833

https://www.pololu.com/product/2130

 

Magnetic encoder for the micro motor (using this motor)

https://www.pololu.com/product/3081

 

I tried and I have been failing. I attempted 2 PWM, it doesn't work. I looked at another DRV8833 blog, but I cannot use it as MyRio does not use MyDaQ. I even tried analogue but that failed.  Please if someone can guide me on how to set this up, this would be amazing. 

 

Best Regards

 

SB21

0 Kudos
Message 41 of 47
(641 Views)

Hi, would you know how to set the same motor driver DRV8833 and magnetic encoder (https://www.pololu.com/product/3081) for the MyRio?

 

I am currently stuck and have failed many times trying to get my system running on LabView. I am very new to LabView. 

 

I tried the analogue, doesn't work. 2 PWM, doesn't work. 

 

I intend to add a PID control later, but before I can do that, I would like to try and understand how to set this up on LabView. 

 

Thank You

 

SB21

0 Kudos
Message 42 of 47
(649 Views)

@SB21 wrote:

Hi, would you know how to set the same motor driver DRV8833 and magnetic encoder (https://www.pololu.com/product/3081) for the MyRio?

 

I am currently stuck and have failed many times trying to get my system running on LabView. I am very new to LabView. 

 

I tried the analogue, doesn't work. 2 PWM, doesn't work. 

 

I intend to add a PID control later, but before I can do that, I would like to try and understand how to set this up on LabView. 

 

Thank You

 

SB21


Ok, I see this long thread (sorry I have not read everything) and it appears you are still stuck... So I assume this last post is your current state of your situation that you are in..... Do you have a picture of your wiring electrical diagram to start?  Let's start with ensuring that you have everything wired up correctly.  What motor are you controlling?  Is it a DC brushed motor with two poles?  Is it something else?  Please specify performance - like a motor spec sheet.... you need to know peak current draw, does it operate on DC, AC, is it stepper, etc.....

 

EDIT: ok I skimmed the first page so far.... What are you trying to achive?  A proof of concept type thing where the rotary potentiometer position (let's say 0 to 1023 value) equates to what a desired motor velocity? a desired motor position? Other?

 

EDIT2: oh haha I did not see you are new to the thread. The questions above still apply.  Tell me what you are trying to achive and what you have so far in terms of wiring and power, software, hardware.

 

EDIT3: I emphasize on showing us what you have so far designed and/or made mechanical, electrical, and software wise so we can help you.

0 Kudos
Message 43 of 47
(639 Views)

Hi

 

So the layout, as I am not familiar with the MyRio, I copied the person in this thread.

 

Normally I would set it out as if this was the arduino, but for some reason this is not working. As my wiring is messy, I think the explanation would be easier to understand (also I've also attached a picture of the layout of how its roughly connected):

 

Details (for MyRio setup):

 

Encoder (https://www.pololu.com/product/2598) pin A and B - pins go to DIO11 and DIO12 (pins 18 and 22)

DRV8833 Input 1 and 2 - DIO8 and DIO9 (pins 27 and 29)

DRV8833 Output 1 and 2 - Motor.

1 set ground for all using a breadboard. 

9V battery. 

 

I am using a brushed DC micro gear metal motor (https://www.pololu.com/product/994). 

 

What I aim to achieve? I would like to control the position of the motor. 

 

Thank you

 

SB21

 

EDIT: Software: I aim to design this on Labview. 

 

 

0 Kudos
Message 44 of 47
(628 Views)

@SB21 wrote:

Hi

 

So the layout, as I am not familiar with the MyRio, I copied the person in this thread.

 

Normally I would set it out as if this was the arduino, but for some reason this is not working. As my wiring is messy, I think the explanation would be easier to understand (also I've also attached a picture of the layout of how its roughly connected):

 

Details (for MyRio setup):

 

Encoder (https://www.pololu.com/product/2598) pin A and B - pins go to DIO11 and DIO12 (pins 18 and 22)

DRV8833 Input 1 and 2 - DIO8 and DIO9 (pins 27 and 29)

DRV8833 Output 1 and 2 - Motor.

1 set ground for all using a breadboard. 

9V battery. 

 

I am using a brushed DC micro gear metal motor (https://www.pololu.com/product/994). 

 

What I aim to achieve? I would like to control the position of the motor. 

 

Thank you

 

SB21

 

EDIT: Software: I aim to design this on Labview. 

 

 


Sorry so are you not able to get this chip to work on a test bench without any software... just hardware?  Honestly the following is confusing.... I am used to a motor board that is EN, A, B.... so three pins for one output 1, 2.  This board is different.  I would dig into that.

 

AIN1 LOW A logic input control for motor channel A. PWM can be applied to this pin.
AIN2 LOW A logic input control for motor channel A. PWM can be applied to this pin.
BIN1 LOW A logic input control for motor channel B. PWM can be applied to this pin.
BIN2 LOW A logic input control for motor channel B. PWM can be applied to this pin.

 

EDIT: are you able to get it to turn on the test bench? Modulate PWM duty cycle? Change direction?

 

EDIT2: I am assuming you sized your motor correctly. If not, let us know and we can help you there also.

0 Kudos
Message 45 of 47
(604 Views)

Hi 

 

Sorry for the late reply. Right now, I can do it for the L298N. However, the L298N has many limitations. Trying to do it for this board. So far I have no idea how to even lay this out. 

 

I think its better we start from scratch so I can understand how you guys plan to solve this problem. If I randomly jump into it, I think I will confuse you even more. 

 

Thank you

 

SB21

0 Kudos
Message 46 of 47
(568 Views)

@SB21 wrote:

Hi 

 

Sorry for the late reply. Right now, I can do it for the L298N. However, the L298N has many limitations. Trying to do it for this board. So far I have no idea how to even lay this out. 

 

I think its better we start from scratch so I can understand how you guys plan to solve this problem. If I randomly jump into it, I think I will confuse you even more. 

 

Thank you

 

SB21


I would lay it out like in their example first and see if you get success. Then try to change direction and pwm duty cycle.

 

let me know if you have specific questions on how to layout on a breadboard etc...

0 Kudos
Message 47 of 47
(551 Views)