Go to Post Sometimes dumb ideas just work really well :P - Garrett.d.w [more]
Home
Go Back   Chief Delphi > Technical > National Instruments LabVIEW and Data Acquisition
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 05-03-2006, 17:08
Schmitty!'s Avatar
Schmitty! Schmitty! is offline
Ever issue is an opportunity to...
AKA: Mike Schmitt
FRC #0093 (N.E.W. Apple Corps)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2003
Location: Appleton WI
Posts: 7
Schmitty! is a splendid one to beholdSchmitty! is a splendid one to beholdSchmitty! is a splendid one to beholdSchmitty! is a splendid one to beholdSchmitty! is a splendid one to beholdSchmitty! is a splendid one to behold
Direct control of a Servo or Speed Controller

Is it possible to control a servo directly from the digital output of the NI USB 6009? I did some rough timing calculations and based on what I determined I believe the NI USB 6009 system does not have a fine enough timing resolution to accurately control a servo.

Here's what I've got:
The standard servo signal pulse width varies from 1mS to 2mS to correlate from a 0 position to a full-deflection position. I've also measured systems that use a 2mS to 4mS and 4mS to 8mS pulse but it's not critical for this discussion. Assuming 256 steps of resolution and a 1mS to 2mS pulse width there is 3.9uS of time per step.

Unless I'm doing something wrong (which is highly possible), the fastest timed loop I could create was 1kHz (1mS loop time). This is about an order of magnitude slower than I was hoping to obtain.

I have two questions:
1) Has anybody tried to directly control the servos from the digital output of the USB 6009?
2) If so, can you either post your code or point me in the direction of sample code to complete this?

The end goal was to work with Josh (a student on Team 93) to create a stand-alone control system with the custom gyro board. At this point we can effectively read the analog and digital feedback signals from the custom board, but without effective servo (or in this case speed controller) output from the USB 6009 we still need a robot controller involved in the loop. This is less than ideal because of the added delays that will be added into the control loop that are caused by conversions of data within the robot controller.

Once we’ve got the control loop optimized through the USB 6009 the plan is to implement a similar loop though software on the robot controller. If we get this to function we will gladly present any/all data along with the custom gyro board information.

At this point any feedback would be greatly appreciated.
Thanks!
Reply With Quote
  #2   Spotlight this post!  
Unread 06-03-2006, 08:28
Russ Beavis Russ Beavis is offline
Registered User
no team
 
Join Date: Nov 2005
Location: Manchester, NH - DEKA R&D Corp.
Posts: 341
Russ Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond repute
Re: Direct control of a Servo or Speed Controller

Schmitty,
As you've learned, it doesn't appear that the USB-6009 can directly create the requisite servo control signals (maybe the NI guys can shed a bit more light?). You'll either need a voltage-to-PWM signal generator (I haven't found a really easy circuit but a 555 timer is a good starting point) or some other PWM signal generator. My recommendation is to use either the CMUcam2 as a servo control or buy an off-the-shelf servo signal generator. If you really want to get down-and-dirty, you could even spin your own microcontroller-based solution to convert either a voltage output (from the USB-6009, for example) or an RS232 command to a PWM signal.

The CMUcam2 GUI app and its underlying VIs provide access to the 5 servo control signal generators.

The other option is to use an inexpensive signal generator such as the Mini-SSC II (serial servo controller). You can buy these from Jameco for about $40. Very simple RS232 serial string to control up to 8 servos.

Good Luck!
Russ
Reply With Quote
  #3   Spotlight this post!  
Unread 06-03-2006, 10:45
Schmitty!'s Avatar
Schmitty! Schmitty! is offline
Ever issue is an opportunity to...
AKA: Mike Schmitt
FRC #0093 (N.E.W. Apple Corps)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2003
Location: Appleton WI
Posts: 7
Schmitty! is a splendid one to beholdSchmitty! is a splendid one to beholdSchmitty! is a splendid one to beholdSchmitty! is a splendid one to beholdSchmitty! is a splendid one to beholdSchmitty! is a splendid one to behold
Re: Direct control of a Servo or Speed Controller

At this point I think we're going to write a small app using one of our old robot controllers that basically does an analog to PWM conversion. We're going to use the USB-6009 to generate a 0-5V analog voltage that the robot controller can read and convert the analog voltage to a servo command. It's going to possibly introduce a 26mS delay because of the internal timed loop in the robot controller, but I think we'll need to take this into account in the real system anyway.

My main reason for this approach is that we don’t want to add any extra external circuitry (555 timer or analog-to-PWM converter) that could introduce additional errors to the system. We’re trying to mimic what is going to be present in the final system. With all that said I will still definitely keep the Jameco part in mind if we start running into problems with the robot controller.

I’m still hoping I’ve messed something up in the LabView software and we can actually get a much faster timed loop. Since we’re operating at the mercy of the internal timer on the PC (and the non-real-time Windows operating system) I don’t think I’ll get much better than a 1mS loop. As a test I had one of the digital outputs toggle every time it entered the 1mS loop. The signal clearly had a large amount of cycle-to-cycle jitter when I viewed it on an oscilloscope.

The USB-6009 and LabView definitely have their places where they’re extremely versatile as a learning tool but I don’t think directly controlling a servo is one of them. If anybody has gotten this to work I would be very intersted in seeing how they did it.

Thanks again!
Reply With Quote
  #4   Spotlight this post!  
Unread 06-03-2006, 13:53
Russ Beavis Russ Beavis is offline
Registered User
no team
 
Join Date: Nov 2005
Location: Manchester, NH - DEKA R&D Corp.
Posts: 341
Russ Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond repute
Re: Direct control of a Servo or Speed Controller

LabVIEW running under Windows definitely cannot be relied upon to produce the timing necessary to create 17ms period PWM signals with on-time variable between 1 and 2ms. BUT... If you're using a data acquisition module with a "full" timer/counter module (ie not the simple event counter that exists in the USB-6008/9 but a full-blown counter as in most PCI-based cards from NI), it's very easy to generate PWM signals with hardware-based timing and microsecond precision and accuracy. Because most USB-based DAQ modules are lower-cost systems, they tend to have limited counter capabilities.

There are also LabVIEW Real-Time variants that can produce the necessary timing but that's a big step up in cost and complexity.

Russ
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can We Use A N64 Controller To Control The Robot pobots Electrical 25 18-04-2003 12:48
Ugh...PWM pin vs. Speed Controller archiver 2001 1 24-06-2002 00:27
making speed controller digital CharlieWilken Electrical 4 01-03-2002 20:15
Prgm4 2 joystics control 1 speed cntrl??? punarhero Programming 7 21-02-2002 09:57
speed control punarhero Technical Discussion 11 24-01-2002 18:03


All times are GMT -5. The time now is 16:10.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi