Guys,
The basic operation of a stepper motor involves two coils. Putting current through both coils in a particular direction causes the shaft of the motor to align a certain way. By reversing the polarity of one winding, you cause the motor's shaft to rotate a step in one direction. If you then reverse the polarity in the OTHER winding, it will make the NEXT step in the same direction. By sequencing the polarity reversals, one coil then the other, then back, you get continuous rotation in a particular direction. And if you reverse the sequence of polarity reversals, you get rotation in the other direction:
+ +
+ -
- -
- +
+ + etc. might be clockwise. Then:
+ +
- +
- -
+ -
+ + etc. would be counterclockwise.
If you look at the diagram of the RAMBo board posted with the electronics instructions, you'll see the two "coils" of each stepper motor in the diagram.
It's just like holding two magnets with the north pole of one up against the south pole of the other. If you rotate one magnet, so that now, say, the south poles are together, the other magnet will rotate to bring its north pole against the south pole of the magnet you are holding.
There is NO position feedback (other than the home limit switch) for this system. The firmware simply counts the field reversals to track changes in positions. (With microstepping, it's more complicated than that, but you get the idea.)
This is how steppers are different from SERVO motors, where there IS a direct position measurement, and the rotation of the motor is controlled based on the position feedback. For a model airplane aileron or rudder or elevator servo, which rotates less than 360 degrees, position feedback is not that difficult. For an axis that moves several centimeters (and a LARGE number of motor rotations), the position feedback sensing is MUCH more expensive than counting pulses in a microcontroller. So that's why you have steppers in a desktop 3D printer.
So how might the shift occur?
1. The belt skps on the the toothed motor pulley. The controller sent the right steps and the motor turned the right amount, but the belt (and the extruder) are out of assumed position.
2. The microcontroller count gets corrupted. Something writes to the memory or resets the counter register. Not likely, but who knows? Firmware bug might cause this.
3. The microcontroller thinks it triggered the right pulse outputs, but it actually didn't. If something grabs the output or if an interrupt that is higher priority than pulse timing takes to long to process, the microcontroller section that is doing the pulse output may think pulses went out, but they really didn't. So the count changed, but the actual position did not. This seems like a possibility to me --- could be some event is happening, maybe on USB, that holds onto an interrupt or interferes with the pulse handling part of the code. This would require firmware debugging that is beyond the capabilities of most 3D printer users.
4. The microcontroller triggers its pulse outputs, but these don't get translated into polarity reversals by the RAMBo hardware. This could happen if the power switching components on the RAMBo board are overheating and do a shutdown to prevent component destruction. The motor gets NO current instead of positive or negative current, and doesn't turn when told.
5. The microcontroller triggers pulse outputs, the current swaps polarity, but the current isn't strong enough to give enough torque to move the axis. The controller assumes the axis moved but it didn't.
6. The G-code is corrupt. (But if you print the same G-code file and it works perfectly most of the time, that eliminates this one.)
#4 can be caused if the current setting in firmware is too high. (Plus the motor will get HOT.) #5 can be caused if the current setting in firmware is too low.
One thing that can help with #3 is to see if the issue occurs when printing from SD Card with the USB cable disconnected. Start a print from SD and pull the cable. If you don't get axis skips, you may have to print this way all the time. It could be a software, firmware or USB driver bug. Something is coming along and putting a load on the microcontroller and it's trying to do too many things at once.
So: Things it would help to know to determine the cause:
A: Are the X and Y stepper motors getting really hot?
B: Are these motors not getting warm? A stepper motor pulls current, even when sitting still holding position (think about the Z axis when you shut off power), so the motors SHOULD get warm.
C. Are you printing from software when this occurs, or are you printing from SD Card with the USB cable unplugged?
D. Have you lubricated the X and Y slides lately? Any crud on the rails? Have you oiled the belt idler (end opposite the motor)?
Hope this helps!
Dale
p.s.: It would be interesting to develop a 3D printer around a Parallax "Propeller" or other multi-core microcontroller to see if the independent cores, with particular functions assigned to them, would make it easier to avoid problems related to #3 above.... I'm not offering to write it --- I never wrote code for Propeller. I'm just wondering on my keyboard.... :-)