Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

PWM digital output

Hi,
 
I'm using NI USB 6501 device for my project to simply control the positions of three servo motors. I searched forums of NI and found some useful programs. The following link contains a file that I cannot use with Labview 8.0 because the program is configured for Labview 8.2.
 
 
(   - PWM_output_SW-timed_with_digital_line.vi )
 

It would be very helpful if someone could help me converting this code compatible with Labview 8.0.

Also, I cannot use counter output to create PWM because of the inability of my device. Therefore, I need a program that gives digital PWM output. To control my servos, I need to give pulses between 1ms - 2ms(to control the position of servo) and update time of 20ms between each pulse. I believe the code I mentioned above will work but any other improved codes would also be very helpful.

Thanks.
 
0 Kudos
Message 1 of 7
(9,683 Views)

By the way, I forgot to mention that my servo motors are simple RC hobby servos. Any VI to control RC servos would be very helpful.

Thanks again.

0 Kudos
Message 2 of 7
(9,671 Views)
Hello,
 
I opened the Knowledge Base and saved the VI in 8.2 for the previous version.  The attached VI is compatible with Labview 8.0.
Samantha
National Instruments
Applications Engineer
0 Kudos
Message 3 of 7
(9,625 Views)

Thank you for your concern. I see that software timed pulses are not accurate enough for me. I have to give the pulses between 1ms and 2ms and wait 20 ms between each pulses. Is it possible to do this task with USB 6501? I'll be very glad if you can give any idea to control RC servos with USB 6501. I tried several ways but I couldn't succeed.

Thanks.

0 Kudos
Message 4 of 7
(9,614 Views)

Hello,

An example that might be helpful is PWM-Counter Output.vi.  Please look up this example through the example finder by searching PWM in the search tab.  Click once to highlight the example and read the summary Information and glance at the Requirements in-order to see what cards are compatible with the example.  The NI USB 6501 would not be able to this type of counter output for three servo motors since it only has one counter.  I would suggest looking at the example listed above and simulating one of the cards listed in the Requirements section.  This way you can start developing your software or use the example code to see if this will suit your application prior to purchasing hardware.  To simulate a card, open Measurement and Automation Explorer (MAX) and right click NI DAQmx Devices under the Devices and Interfaces menu.   Select Create New DAQmx Device.

Samantha
National Instruments
Applications Engineer
Message 5 of 7
(9,579 Views)
Maybe somewhat late, but let me answer for the ones who come here after a forum search.
(I made the same thing to control my Petrol Engine Load Bank, throttle and brake)

The RC-servo "protocol" indeed expects 1 to 2ms, refreshrate 20ms. That gives 50Hz.
The 1 to 2 ms is communications-unfriendly, because if you want p.e. 30 angular divisions, you need a resolution of 1/30ms, equals 30kHz ( 1/( (2ms-1ms)/30 ) )
So to control this by simple digital I/O, is no good or effective idea.
You can't lower the 50Hz. I tried because for staying above the mechanical response of the RC I only needed +-5Hz.

Better is sending the value (again 1 to 30) out by analog (1 to 5V, resolution 0.167V) or digital (5bit gives you 32 positions)
The frequency demand of your I/O card now only determines the response of your RC-servo, not the position or accuracy.
Even the cheap usb-6008 card is very much more fast and accurate, giving you nice control possibility's.

The communication rate itself for the same info is now much slower and compact, resulting in much more stable vi's.

Downside: you need to create an interface between A/D and your RC-servo.
But when I hear RC and Usb-Daq, I think of inventive people with time and courage to learn.

There are many existing components, PWM-Ic's, do a search on http://www.datasheetcatalog.com/ and you'll find your 2 main components:
Analog (or digital) to PWM and PWM bridge motor driver. Existing circuitry can be found everywhere on the net.
Don't forget shielding and filtering. Dont let the electronics scare you. Build it, try it and improve it.

Succes !.
0 Kudos
Message 6 of 7
(8,825 Views)

I downloaded your VI, and it was very helpful, but, I need some help about how I command, individually, each line, I mean, set a different duty cycle, for each specific line, for example.

 

Thank you.

0 Kudos
Message 7 of 7
(5,734 Views)