/ docs / src / config / stepper-diagnostics.txt
stepper-diagnostics.txt
  1  = Stepper Diagnostics
  2  
  3  [[cha:stepper-diagnostics]]
  4  
  5  If what you get is not what you expect many times you just got some
  6  experience. Learning from the experience increases your understanding
  7  of the whole. Diagnosing problems is best done by divide and conquer.
  8  By this I mean if you can remove 1/2 of the variables from the equation
  9  each time you will find the problem the fastest. In the real world this
 10  is not always the case, but it's usually a good place to start. 
 11  
 12  == Common Problems
 13  
 14  === Stepper Moves One Step
 15  
 16  The most common reason in a new installation for a stepper motor not to
 17  move is that the step and direction signals are exchanged. If you press the
 18  jog forward and jog backward keys, alternately , and the stepper moves 
 19  one step each time, and in the same direction, there is your clue.
 20  
 21  === No Steppers Move
 22  
 23  Many drives have an enable pin or need a charge pump to enable the
 24  output.
 25  
 26  === Distance Not Correct
 27  
 28  If you command the axis to move a specific distance and it does not
 29  move that distance, then your scale setting is wrong.
 30  
 31  == Error Messages
 32  
 33  === Following Error
 34  
 35  The concept of a following error is strange when talking about stepper
 36  motors. Since they are an open loop system, there is no position
 37  feedback to let you know if you actually are out of range. LinuxCNC
 38  calculates if it can keep up with the motion called for, and if not, then
 39  it gives a following error. Following errors usually are the result of
 40  one of the following on stepper systems.
 41  
 42   - FERROR too small
 43   - MIN_FERROR too small
 44   - MAX_VELOCITY too fast
 45   - MAX_ACCELERATION too fast
 46   - BASE_PERIOD set too long
 47   - Backlash added to an axis
 48  
 49  Any of the above can cause the real-time pulsing to not be able to keep up
 50  the requested step rate. This can happen if you didn't run the latency
 51  test long enough to get a good number to plug into the Stepconf Wizard, 
 52  or if you set the Maximum Velocity or Maximum Acceleration too high.
 53  
 54  If you added backlash you need to increase the STEPGEN_MAXACCEL up to
 55  double the MAX_ACCELERATION in the AXIS section of the INI file for
 56  each axis you added backlash to. LinuxCNC uses "extra acceleration" at a
 57  reversal to take up the backlash. Without backlash correction, step
 58  generator acceleration can be just a few percent above the motion
 59  planner acceleration.
 60  
 61  === RTAPI Error
 62  
 63  When you get this error:
 64  
 65      RTAPI: ERROR: Unexpected realtime delay on task n
 66  
 67  This error is generated by rtapi based on an indication from RTAI that
 68  a deadline was missed. It is usually an indication that the BASE_PERIOD
 69  in the [EMCMOT] section of the ini file is set too low. You should run
 70  the Latency Test for an extended period of time to see if you have any
 71  delays that would cause this problem. If you used the Stepconf Wizard, 
 72  run it again, and test the Base Period Jitter again, and adjust the Base
 73  Period Maximum Jitter on the Basic Machine Information page. You might
 74  have to leave the test running for an extended period of time to find
 75  out if some hardware causes intermittent problems.
 76  
 77  LinuxCNC tracks the number of CPU cycles between invocations of the
 78  real-time thread. If some element of your hardware is causing delays or
 79  your realtime threads are set too fast you will get this error.
 80  
 81  NOTE: This error is only displayed once per session. If you had your
 82  BASE_PERIOD too low you could get hundreds of thousands of error
 83  messages per second if more than one was displayed.
 84  
 85  == Testing
 86  
 87  === Step Timing
 88  
 89  If you are seeing an axis ending up in the wrong location over
 90  multiple moves, it is likely that you do not have the correct direction
 91  hold times or step timing for your stepper drivers. Each direction
 92  change may be losing a step or more. If the motors are stalling, it is
 93  also possible you have either the MAX_ACCELERATION or MAX_VELOCITY set
 94  too high for that axis.
 95  
 96  The following program will test the Z axis configuration for proper
 97  setup. Copy the program to your ~/emc2/nc_files directory and name it
 98  TestZ.ngc or similar. Zero your machine with Z = 0.000 at the table
 99  top. Load and run the program. It will make 200 moves back and forth
100  from 0.5 to 1". If you have a configuration issue, you will find that
101  the final position will not end up 0.500" that the axis window is
102  showing. To test another axis just replace the Z with your axis in the
103  G0 lines.
104  
105      ( test program to see if Z axis loses position ) 
106      ( msg, test 1 of Z axis configuration ) 
107      G20 #1000=100 ( loop 100 times ) 
108      ( this loop has delays after moves ) 
109      ( tests acc and velocity settings ) 
110      o100 while [#1000] 
111      G0 Z1.000 
112      G4 P0.250 
113      G0 Z0.500 
114      G4 P0.250 
115      #1000 = [#1000 - 1] 
116      o100 endwhile 
117      ( msg, test 2 of Z axis configuration S to continue) 
118      M1 (stop here) 
119      #1000=100 ( loop 100 times ) 
120      ( the next loop has no delays after moves ) 
121      ( tests direction hold times on driver config and also max accel setting ) 
122      o101 while [#1000]  
123      G0 Z1.000 
124      G0 Z0.500 
125      #1000 = [#1000 - 1] 
126      o101 endwhile 
127      ( msg, Done...Z should be exactly .5" above table ) 
128      M2
129  
130