11-05-2010 03:36 PM
I am controlling a stepper motor position via a PIC-7342 board. This part of the program has worked in the past. I have another program that does almost the same thing and it works as always.
The program sets the speed and accelerations, then sets a position and tell the motor to run to the position. Then it sets a communication bit through the MCS register. Then it sets a new position and command the motor to run to the new position. It then delays a short time and commands an output to turn on. Then it sets a new position and commands the motor to run to the new position. After each command to run there is a wait for motion complete. The code used to work correctly. Now the motor runs to the first position and proceeds no further. The finial position is sometimes a couple of steps past the setpoint, which is very unusual. The digital output is fired like the second position has been reached, even though the motor has not moved to the position. The actual path for the motor is clear, so there is not mechanical reason for the problem. How would you troubleshoot an on board program?
11-09-2010 03:59 PM
ITElearner,
What has changed since you last ran your system? Can you move the motor in Measurement & automation explorer? Are you getting any errors? Is this program written in LabVIEW? You may also find the following useful:
Configuring a Motion Control System
http://zone.ni.com/devzone/cda/tut/p/id/3126
Configure and Test a Stepper Motor
http://digital.ni.com/public.nsf/allkb/9675C83F037811F68625727C0002A4A5?OpenDocument
Regards,
Sam K
Applications Engineer
National Instruments
11-09-2010 04:07 PM
Of the 6 on board programs, only the one has the problem. I got the program running by putting a .250 second delay after the wait for motion complete test. It seems the motion complete blocks are not wating. Is there any way of troubleshooting what is happening on the board?
11-10-2010 10:23 AM
ITElearner,
The NI-Motion User Manual is a good place to start troubleshooting any NI-Motion application. Chapter 14 contains information about Onboard Programs with NI 73xxMotion Controllers.
NI-Motion User Manual
http://www.ni.com/pdf/manuals/371242b.pdf
As far as troubleshooting what is happening "on the board" your using LabVIEW to monitor settings and values from the board is your best option.
Regards,
Sam K
Applications Engineer
National Instruments