Society of Robots - Robot Forum

Software => Software => Topic started by: Pogertt on March 01, 2012, 03:08:33 AM

Title: Missed step detection
Post by: Pogertt on March 01, 2012, 03:08:33 AM
A project has:

A stepper motor with 200 steps per revolution.

A Gecko 203V Drive, that microsteps at a resolution of 10.
This drive has an adjustable current limit, which acts as an electronic shear pin.
If the torque required to move the load is more than the drive is adjusted to provide, the drive will stall until the load is lowered.

A quadrature encoder with 1024 pulses per revolution.

The motor, encoder, and drive are existing, and can not be modified or changed.

To make one complete revolution of the motor shaft and encoder, the drive must receive 2,000 pulses.

Each step pulse moves the  motor shaft .18 degrees.
Each encoder pulse detects .3515625 degrees of shaft movement.

I am able to issue a step command, and check encoder position for a Clockwise Move, No Move, or Counter Clockwise Move well before the time required to issue the next step command.
A step pulse is issued every .0002 seconds. (5,000 steps per second)
Solving for an encoder position change requires 45 clock cycles at 80_000_000 clock speed
or .000000563 seconds to solve.
This relationship allows plenty of thinking time between issuing a pulse, and detecting that it was not consummated.

Since there is not an exact 1 to 1, 1 to 2, or 1 to 3 relationship between the two movements, how do I detect a situation where a step pulse was issued, and the motor failed to move?

A second requirement is that a missed step is corrected, so at the end of the move, the shaft ends up in the correct position.
Title: Re: Missed step detection
Post by: newInRobotics on March 01, 2012, 03:48:53 AM
Hi there :)

Very similar topic (http://www.societyofrobots.com/robotforum/index.php?topic=15194.msg110005#msg110005) <-- :) and You were one of the advisers...
Title: Re: Missed step detection
Post by: Pogertt on March 01, 2012, 04:30:41 AM
Same only different.

That solution requires that the encoder and the stepper have the same or an integer multiple of counts, steps per revolution.

This problem has an encoder and stepper that do not have an integer ratio between step and count resolution.

With the ratio of 1.953125 steps per encoder count, after missing numerous moves the error increases until scrap is produced.
Title: Re: Missed step detection
Post by: newInRobotics on March 01, 2012, 05:00:46 AM
Are You allowed to add extra items to the system? Extra encoder maybe? Hall switch?
Title: Re: Missed step detection
Post by: Pogertt on March 01, 2012, 08:52:39 AM
Have to work with just what is provided.
Title: Re: Missed step detection
Post by: Resilient on March 01, 2012, 01:31:45 PM
You know it must synch up at every full revolution.

So just experimentally test at which points in the revolution you get only a single step instead of two steps for an encoder pulse.
Title: Re: Missed step detection
Post by: Pogertt on March 01, 2012, 06:40:07 PM
You know it must synch up at every full revolution.

So just experimentally test at which points in the revolution you get only a single step instead of two steps for an encoder pulse.


Some of the moves are less than 1 complete revolution.
The Z pulse is not available.
The intent is to detect a missed step as it happens in real time, and correct it B4 the end of the move.

There are 2 axises moving simultaneously, sometimes at different feed rates, and if one of the axises misses pulses the machine will produce scrap.
Title: Re: Missed step detection
Post by: Resilient on March 01, 2012, 07:18:38 PM

Some of the moves are less than 1 complete revolution.
The Z pulse is not available.
The intent is to detect a missed step as it happens in real time, and correct it B4 the end of the move.

There are 2 axises moving simultaneously, sometimes at different feed rates, and if one of the axises misses pulses the machine will produce scrap.

Can you run an initialization routine with no load if there is no Z pulse? Send it 2000 pulses, see where in those 2000 pulses only a single pulse is needed to trigger the encoder and save how many pulses from the start it was.

It is going to be what, roughly every 21 steps? So you will have an array of around 100 positions where you expect only a single pulse to trigger the encoder instead of two. You keep a pointer to the array so you know where next to expect only a single pulse. If it takes two pulses there, then you know you missed a step. Anywhere else, if it takes 3 pulses to trip the encoder you missed a step.