10-22-2013 02:06 PM
I am trying to control an Omron 50W motor using an Omron Accurax G5 Driver to act as the motor Driver. I am sending control signals from a NI 6212-OEM Board. I need to send a set number of square wave pulses. I have succeeded in controlling the system a .5hz but when i start to play with the frequency to change the period of the of the signal my system starts to drop data. It doesn't drop back down to zero sometimes or stays high for two periods. By playing with the frequency and looking at the charts you can see what I am talking about. I don't know what is happening and any advice on how to accomplish this task would be greatly appreciated. The code I have attached is my current working prototype. The Error I am encountering is in the software before the signal is sent but if any specs are needed on the hardware I am using just ask and I can provide it.
Thanks
-Charles
10-22-2013 02:21 PM
I have never used that board, but some suggestions:
- Disconnect the driver and use a digital capture scope to examine the square wave
- Attach driver and re-examine
Might be an impedance mismatch? Input type of the driver (open collector/drain, TTL/CMOS, JFET, etc.) might not be playing well. You'll see this in the form of the square wave not being square when the driver is attached. It slowly rises back to 5V is the usual case. Then when the freq increases it doesn't get high enough for the driver to see a "1". If the NI board has push-pull outputs this probably is a moot point 😛
Might need a couple 10K pull-ups on the digital outputs??
Also remember most boards havev only one clock source, so if you toggle any other output mid-stream (during the 100 pulses) it might (prob) will jitter. Try a more basic code without the WHILE LOOP and event handler, and just send the 100 pulses when you hit RUN. Then change freq and see what happens.
Just some checks 🙂
Steve
10-22-2013 03:11 PM
Hey Steve,
I have looked through a scope and the square wave is not rounded in any significant manner, so I don't think it is an impedence issue. From all the measurments I have made my board is outputting whatever is seen in the graph 3 on my front pannel which is telling me its a software problem more so then a hardware problem. I am trying to get it to operate with in this code with the event handler because as soon as I have this working I am going to add additional code. I am hoping to have it check position and if this value returns and unexpected value make a correctional movment. Then once the position desired is reached power down the motor to reduce electrical noise within the sytem. I apprciate the advice very much Steve. If you have any more ideas i am all ears.
Thanks
-Charles