12-12-2013 04:56 PM
Hi I have a PCI-6221 and I am trying to control a hobby servo motor using the hardware timed digital output lines. I am doing this as a test to see if I can control 16 hobby servos using 16 of the 32 hardware timed digital outputs on the PXIe-6358, which I don't have yet.
Anyways I have been trying to use the VI I found here: http://www.ni.com/example/30043/en/. I set the Digital output lines to port0/line7 and the counter to ctr1 on my 6221. I set the clock frequency to 50 Hz and adjusted the duty cycles to a multitude of different settings and used a scopemeter to observe the output on pin 48 of my SCB-68A and I dont see anything just noise. ~0 voltage differential. I am looking at D GND pin 13 and P0.7 pin 48. I don't know what I am doing wrong. I know my scope/servo works because I set it up on one of the AO lines and used this https://decibel.ni.com/content/docs/DOC-1030 with success.
I know there are other ways of controlling a servo with the card I have but all the other IO are being used in the final application and I need to control 16 servos.
Thanks. Let me know if I left anything out.
Ryman
12-13-2013 10:00 AM
Hi Ryman,
How do you have your digital output lines control set up? If you have it set up for Dev#/port0/line0:7, what you are seeing is expected because that example is only written for 4 lines. The pulse train will only be output on the first 4 lines - in this case, lines 0-3. If you include line 7 in the first 4 lines of the control, I would expect to see the pulse train on the pins you are measuring on (or just measure one of the pins 0 - 3 in the current setup).
To expand the example to work with more lines, it looks like you need to modify both the top-level VI and Multiple Duty Cycle Array.vi. The comment in Multiple Duty Cycle Array.vi provides guidance on how to work with more than 4 lines.
Hope that helps!
Regards,