Go Down

Topic: Antidote against missing steps? (Read 706 times) previous topic - next topic

Grumpy_Mike

Quote
but your laughing totally disarms me.

Well it was because of an untended pun I made.

What you should do is to strip the code back and just test the motors to see if they both respond to all steps. Then you know it you have a hardware or software problem.
Running the motor at half steps and then disabling the drivers gives you half a step error because the motor looses position in those fractional steps when de energised.

If the motors check out individually but not when run together then check that you have sufficient current capability with your power supply and add some large bulk decoupling capacitors like 500uF across it.

Carsten53T


What you should do is to strip the code back and just test the motors to see if they both respond to all steps. Then you know it you have a hardware or software problem.


That's settled then. It's a bit of a fuss, but I often need this single motor test.

Quote

Running the motor at half steps and then disabling the drivers gives you half a step error because the motor looses position in those fractional steps when de energised.


I don't think that the half-stepping is a problem. And both steppers are exposed to the same code.
I'm very careful in keeping track of which phase is next .. also after pausing. But it /has/ crossed my mind that one of the stepper might so to speak starts out on the wrong leg. It should max loose 2 steps out of every restart .. that doesn't sound of much, but I'll check it. If it wasn't for the circumstance, that this motor also has a rougher resonance/sound I would actually believe that the problem could be buried here. I do have a lot of resets (instead of pauses where I keep track).

Quote

If the motors check out individually but not when run together then check that you have sufficient current capability with your power supply and add some large bulk decoupling capacitors like 500uF across it.

Will do the capacitor thing.
The two steppers alone share a 12V & 2A ... that should be enough to blow me off the table together with the rest of the setup, if something went wrong. But it leads me to something I've pondered on trying: To swap the supply to a 35 or 45V source I've lying somewhere. Somewhere in this tutorial:
http://www.stepperworld.com/Tutorials/pgMicrostepping.htm
I have seen a feedback mechanism that controls the amount of current that the stepper will get .. as a substitute for the coil-resistors. It's not really for dummies like me, but I did notice the change of motor-effect I got from raising voltage and adding coil-resistors. I would like more changes to the better like that. But, as it is now, I've already burned off a set of resistors ... (driver and motor survived ;o) .. /this time, not the previous) .. and I cannot afford to make any mistakes right now.
I did spent time on measuring the actual turn-around of the motor-shaft, and I'm not done on attacking the problem from that side. If I add one of those small & strong magnets to the shaft, then it ought to be no sweat to detect atleast a sharp 1/10 of a round .. the forward move is 1.0 mm pr round giving a 0.1mm precision then. That'll be ok for now. As you probably noticed on the photo .. one cannot really detect errors with the naked eye (a little flatness on the four sides thanks to slack).

kf2qd

If you are not supplying power to the motors at all times, and if there is any torque on the motor when you remove power then the motor can move and you are out of position. Proper use of steppers keeps them powered at all times. You can reduce power when not moving, but you must supply enough power to hold position. Sorry, but with no other feedback you have to keep the motor powered to be anywhere near accurate with positioning. A common rue of thumb is that you need steppers with 2 times the required torque.

Carsten53T

#8
Jul 10, 2012, 02:37 pm Last Edit: Jul 10, 2012, 02:40 pm by Carsten53T Reason: 1

If you are not supplying power to the motors at all times, and if there is any torque on the motor when you remove power then the motor can move and you are out of position. Proper use of steppers keeps them powered at all times. You can reduce power when not moving, but you must supply enough power to hold position. Sorry, but with no other feedback you have to keep the motor powered to be anywhere near accurate with positioning. A common rue of thumb is that you need steppers with 2 times the required torque.


hi kf2qd,
The steppers each moves a sled on a greased rail. Once the step has been accomplished, there is no more torque on the axel. For now, I'll go with the precision this setup gives.
If it really is an issue, both steppers should be exposed to it equally .. it's still only one of them that misses a little. I havn't had time to look at the "starting at wrong phase" possibility. I'll post back on the outcome.

You may say that detecting missing steps is a sort of precautionary measure .. if one step is not pulled through, I can add an extra, but if stepping is gone all together, something serious is wrong. I would like to be able to turn my back on it and feel safe that any eventuality is dealt with properly.
Setups of my photo-interrupters often involves a small capacitor on the receiver voltage, but that's not where the 'jumpiness' is .. and the capacitor would act as a high-pass filter, right? The analog low is well-behaved, but the high is very serrate. I wonder if I could put a low-pass filter on it.

Carsten53T

#9
Jul 11, 2012, 01:53 pm Last Edit: Jul 11, 2012, 02:00 pm by Carsten53T Reason: 1
Solved it!
I noticed a while back, that I could remedy the apparent missing steps by 'hurring up' the 'time between steps'. That logic would imply that it would be a timer-problem, so I decided to keep track of how far a step-event would overshoot the 'timeBetweenSteps'.
One loop would last about 900 micros and maxSpeed would use 1500 micros. [overshoot of 2*900-1500 at next poll]

I added a MicrosDiscrepancy and a microsSinceLast variable
See where it is used in code:
cStepper::setTime() is a stepper-class function that is polled repeatedly. The variable cStepper::mDelay is the inverse velocity 'constant' indicating an ideal time-between-steps (not to confuse with any delay())
Code: [Select]

boolean cStepper::setTime( boolean HalfOrFull ){
if( HalfOrFull ){ cStepper::isHalfStep = false ; }
else{ cStepper::isHalfStep = true ; }
boolean res7 = true ;
if ( cStepper::misOn ){
long microsSinceLast = micros() - cStepper::oldTime  ;
cStepper::MicrosDiscrepancy = microsSinceLast - cStepper::mDelay ;
if( (cStepper::oldTime + cStepper::burnIn) <  micros() ){
// if delay more than burnIn then holding is abandonned
cStepper::Pause() ;
}// end if oldTime + burnIn

if(  ( (cStepper::oldTime + cStepper::mDelay) < micros() - cStepper::MicrosDiscrepancy ) ){
// mDelay microseconds has passed
if( cStepper::HalfStepCounter  < abs(cStepper::destination ) ){
// if stepper has not reached destination:
                                       cStepper::oldTime = micros() ;
if( HalfOrFull ){ cStepper::Step() ;}
else{ cStepper::StepHalf() ;}

res7 = true ;
}
if(HalfStepCounter  == abs( cStepper::destination) ){
cStepper::destination = 0 ;
cStepper::misOn = false ;
cStepper::Stop() ;
//Serial.println("at destination ");
//delay(5) ;
res7 = false ;
}
if(HalfStepCounter  > abs( cStepper::destination) ){
String nm = cStepper::name ;
//Serial.print( nm );
//Serial.println(" exeded" );
//delay(5) ;
didExeed = true ;
//cStepper::deEnable() ;
cStepper::misOn = false ;
res7 = false ;
}
}// end if (oldTime + mDelay) < micros

}// end if cStepper::misOn
else{
res7 = false ;
//Serial.println("setTime are off");
//delay(100) ;
}

return res7 ;
} // end cStepper::setTime //-----------------


My attempt to measure the axis-dial went down the drain in the process, but it's not that urgently needed. It uses 5 true delays of 50 micros .. it beats me why it's stopped measuring properly.

Go Up