02-03-2014 12:39 PM
After scouring the internet for answers, I realized I neglected this resource.
I'm trying to test some small digital servos that will be used in for a senior design project. When we received the myRIO I created a simple VI to drive a servo using PWM with 50Hz frequency and varying the duty cycle between 5-10%. I used a cheap servo that came with an arduino kit, and it worked perfectly. However, the Blue Bird BMS-385DMAX servos arrived and when I tried one with the VI I made, it didn't work. I've confirmed that the servo works by running it with an arduino, it just doesn't run with the myRIO. I'm not a labview expert, and I'm new to the RIO platform; any advice would be greatly appreciated.
I've attached the project. Ignore the KeyDutyCycle VI and the shared variable; that was something I was experimenting with, but didn't use.
Solved! Go to Solution.
02-03-2014 07:03 PM
Hi,
In measuring the outputs PWM voltage levels, I find that they sit at about 3.25 volts, which may not be high enough to drive the signal line of the servo. IIRC, the Arduino pushes +5V at the ports, so you might consider doing some level-shifting prior to feeding the servo. Just a thought...
Edd
02-04-2014 10:56 AM
Hey rw378,
How are you powering the servo?
Can you elaborate on what you mean when you say it doesn't work. Is there any movement at all? Does it make noise, etc?
Thanks!
-Sam K
Join / Follow the LabVIEW Hacker Group on google+
02-04-2014 02:14 PM
I'm using MXP A/PWM0 (pin 27/DIO 8 on breakout board) to output a PWM signal to the signal wire of the servo. I connected the 5V and GND to the positive and negative wires of the servo, repectively. When I run it, the servo does not move at all. If I hold the servo, a slight ticking can be felt.
I believe roboticspro is correct. I ignored that the DIO pins only output 3.3V. However, I'm not very familiar with level shifting, or many electrical-type things (being a mechanical engineer). Is there a simple way to produce a PWM signal with a 5V amplitude?
02-04-2014 04:14 PM
Are you using the myRIO +5v and Gnd to power the Servo?
The myRIO +5v is limited to 100 mA output which may not be enough to power the larger servo. Try powering the servo from another source but still using the myRIO PWM. The myRIO PWM (and all other digial output) should be ~3.33v when 'high'.
-Sam K
Join / Follow the LabVIEW Hacker Group on google+
02-05-2014 04:37 PM
Yes, I was using the +5V and Gnd from the myRIO to power the servo. I finally got around to trying a different power source: a wall outlet adaptor outputting 5V at 1.0A. And it worked!! Thanks for the suggestion, Sam!
It's difficult to find complete specs for these little hobby servos. All that's usually listed are torques at certain voltages. Although I find it peculiar that the arduino uno could run the servo even though its DIO pins are rated at 40mA, while the myRIO is 100mA.
02-10-2017 04:15 AM
"It's difficult to find complete specs for these little hobby servos. All that's usually listed are torques at certain voltages. Although I find it peculiar that the arduino uno could run the servo even though its DIO pins are rated at 40mA, while the myRIO is 100mA."
In fact, Arduino and NI MyRIO work at the same way, Arduino allows up to 40mA for single DIO pin while NI MyRIO allows 32mA some pins (depending in its features), but both are restringed to supply 100mA in every single port, this means, in Arduino you can use up to 100mA adding every single supplied current in a DIO or analog pin. The same situation is applied into NIMyRIO.
For example, if you use 3 DIO pins in your application and thinking that your circuitry is the same for everyone and 30mA are applying to everyone of them the total current consumption is 90mA in that port.
Greetings!