LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

How to control DC Servo motor (Maxon, RE 65, 250W) using LIFA?

Hi

I have been developing a control algorithm which will be interfaced with arduino. I am using arduino Uno. I have to control a DC Servo motor  (Maxon, RE 65, 250W). What I am gonna do is very simple… for a specific data set the motor will rotate 90deg clockwise and for some other data set it will rotate for 90deg counter clockwise. I am using arduino uno. The encoder of the motor is HEDS-5540 A13.

In the first phase I did this using a micro servo motor. I controlled the rotation of the motor through the white wire which was connected with a Digital PWM pin of Uno. But I have no idea how to control the rotation of RE 65 motor? If any of you could provide me an example of controlling large motor would be great help. Any suggestion is also highly appreaciable.

Another problem is when I run the controller, arduino gets connected and works properly. But in the 2nd trial it shows 5002 error. It happens for around 10-15times and then it gets connected again. Could anyone plz tell me how to resolve this. FYKI: I am using LIFA.

 

Thanks at advance.

Taslim

0 Kudos
Message 1 of 5
(5,918 Views)

You can find a bunch information about controlling the position of a motor on the interent.  It is known as closed-loop control (a servo like the one you posted from Sparkfun does this all internally).

Regarding the error, you should try to never use the abort button in the LabVIEW IDE.  Always put a stop button in your while loop and use that to stop your program.  If, for some reason, this is not possible, you may use the abort button but you will need to free the resources that are being used by LIFA before you can start your VI again.  To do this, you can open Close.vi and set the correct COM port on the front panel and run that VI alone.  Now you should be able to connect again.

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

H Bridges are used to drive DC Motors.  However, the page you provided a link to lists many different motor models.  If you are using a motor with a nominal voltage rating of 36 volts or less then H bridges are available for use with an Arduino Uno and LIFA.  If you are using a motor with a nominal voltage rating of 48 volts or higher than it will be a lot harder to find a  H bridge compatible with an Arduino Uno and LIFA. 

But because you are using an encoder with the DC motor and are designing a DC servo forget about using LIFA to implement a controller for your DC Servo.  The LIFA sample rate is to low for a DC servo digital control system.   Instead search the Internet for using Arduino with a DC motor and an optical encoder.   This means Arduino is the controller and you are just using Labview to send set point commands to your Arduino Uno board.

hrh1818

Message 3 of 5
(4,245 Views)

Hi Nathan

Thanks Nathan. I tried your tips, but it didn't work fully. I opened close.vi and ran it, but when I wanted to connect it didn't connect instantly and showed that 5002 error. But this time I was able to connect within 3/4 trials.

Thanks and Regards-

Taslim

0 Kudos
Message 4 of 5
(4,245 Views)

Hi hrh,

Thanks a lot for your post. The nominal voltage is 24 V. Ya, you are right. I was also thinking about H-bridge. Can you please suggest a H-bridge IC for this case?

I am very new in Labview. I think an example.vi for Labview+Arduino+Servo control using encoder would be very helpful and apprehensible. If you have such VI please provide me.

Thanks again

Taslim. 

0 Kudos
Message 5 of 5
(4,245 Views)