Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Motor adapter for MyRio controlling 2 DC motors

Solved!
Go to solution

Hello,

 

I have a question regarding the motor adapter for the MyRio. I found the following example code: 

https://decibel.ni.com/content/docs/DOC-45592

 

This afternoon I managed to drive one DC motor using this VI, but I want to use it to drive 2 DC motors. I tried the following (see picture) and this didn't work.

 

What should I do to drive the second DC motor?

 

Thanks!

0 Kudos
Message 1 of 5
(3,407 Views)

Hi, 

 

What is the error you're seeing? 

If you run both both motors in the same format as the example code but in parallel loops within the same vi, this may sort the issues you're having.

If you then want to run each motor off the same stop button use channel wires to do this, below is a article that describes how to do this. 

http://digital.ni.com/public.nsf/allkb/267704CDE91156D186256F6D00711AAE

 

Hope this helps

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

Thanks for your reaction! I didn't get any error message, but the second motor didn't start turning 😞

 

What do you mean by parallel loops? Like in the picture I posted or do I have to make separate loops?

 

Thanks!

0 Kudos
Message 3 of 5
(3,360 Views)
Solution
Accepted by topic author MarijnKalter

Hi, 

 

Okay, next time you post it would be helpful to have all information to start with (what your system is doing, errors, steps

you've taken to troubleshoot the issue etc.) this way more people will reply and we can help you more easily. 

 

By parallel loops I just mean to run two processes in separate loops at the same time in the same VI (what they are doing on the link). 

 

If you think about it logically if that initial process runs one motor, then doing the exact same process but pointing it towards the 

second motor will run the second motor. So if you include both pieces of code (exactly the same but referencing different motors) in the same VI then it will run both motors. 

If you look on the link I attached before it talks about running two processes at the same time within the same VI. 

You can then use Queues and notifiers (look into these) to communicate between the two processes you are running, this will allow you to control them from the same front panel control and stop them both at the same time. 

 

With this you should be able to make them both run. 

 

Hope this helps

0 Kudos
Message 4 of 5
(3,345 Views)

Oke, thanks for the tip! I'll try to do it next time!

About the motors, I managed to get them both running at the same time, thanks a lot for your help!

0 Kudos
Message 5 of 5
(3,329 Views)