Schmitty!
05-03-2006, 17:08
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!
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!