EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

PIC Stepper Motor Encoder Feedback

Started by Dennis August 17, 2003
Hi Everyone I have an idea about a simple encoder feedback for stepper drivers
and I need some help and ideas. It may help you also.

I was thinking of using a PIC like 16F84 to look at the Step signal
and look at the encoder feedback to compare the two just as a single
step so it dosen't get complicated.

Secerio like this: Computer steps ones the PIC looks at the encoder
did it step? YES/NO If no then pulse one extra step to the step
input on the controller,,,if stepped like 10 times no movement then
and error LED lights up or whatever.

Any help Ideas? Dennis Izoita



You could setup a timer0 interrupt and a r/b change interrupt.  Poll for which interrupt occurred.  The timer0 would be your timeout, if in X amount of time no steps, do this. The r/b change would count the number of steps.  Or compare the input to output, etc.

 

 

 

-----Original Message-----
From: Dennis [mailto:d...@yahoo.com]
Sent: Sunday, August 17, 2003 10:35 PM
To: p...@yahoogroups.com
Subject: [piclist] PIC Stepper Motor Encoder Feedback

 

Hi Everyone I have an idea about a simple encoder feedback for stepper drivers
and I need some help and ideas.  It may help you also.

I was thinking of using a PIC like 16F84 to look at the Step signal
and look at the encoder feedback to compare the two just as a single
step so it dosen't get complicated.

Secerio like this:  Computer steps ones the PIC looks at the encoder
did it step?  YES/NO  If no then pulse one extra step to the step
input on the controller,,,if stepped like 10 times no movement then
and error LED lights up or whatever.

Any help Ideas? Dennis Izoita



to unsubscribe, go to http://www.yahoogroups.com and follow the instructions

">Yahoo! Terms of Service.


I detect some basic problem here. Two major reasons for using a
stepper motor rather than a servo motor is simple drive circuitry and
no need for position feedback. If you still need to go this way, the
encoder will have to be matched to the stepper motor physically or the
resolution of the encoder will have to be at least twice the step
size. Maybe what you really need is velocity feedback?

Chad

--- In , "Dennis " <dizoita@y...> wrote:
> Hi Everyone > I have an idea about a simple encoder feedback for stepper drivers
> and I need some help and ideas. It may help you also.
>
> I was thinking of using a PIC like 16F84 to look at the Step signal
> and look at the encoder feedback to compare the two just as a single
> step so it dosen't get complicated.
>
> Secerio like this: Computer steps ones the PIC looks at the encoder
> did it step? YES/NO If no then pulse one extra step to the step
> input on the controller,,,if stepped like 10 times no movement then
> and error LED lights up or whatever.
>
> Any help Ideas? > Dennis Izoita




--- In , "Dennis " <dizoita@y...> wrote:
> Hi Everyone > I have an idea about a simple encoder feedback for stepper drivers
> and I need some help and ideas. It may help you also.
>
> I was thinking of using a PIC like 16F84 to look at the Step
signal
> and look at the encoder feedback to compare the two just as a
single
> step so it dosen't get complicated.
>
> Secerio like this: Computer steps ones the PIC looks at the
encoder
> did it step? YES/NO If no then pulse one extra step to the step
> input on the controller,,,if stepped like 10 times no movement
then
> and error LED lights up or whatever.
>
> Any help Ideas?

What you really need is NOT to send more pulses to the driver if the
motor hasn't completed the step. The correct scenario is as follows:

1. The computer sends a pulse to the PIC and the PIC passes this
pulse to the driver. The PIC increments a counter to count this
pulse.
2. The PIC waits for the encoder to detect the rotor movement. If an
encoder pulse is detected, the counter is decremented back to zero.
3. If another pulse from the computer arrives before encoder
movement is detected, the counter is incremented but no pulse is
passed on to the driver.
4. If encoder movement is detected, a pulse is outputed to the
driver and the counter is decremented.
5. If the motor is stalled, the counter will accumulate pulses until
it overflows and an error led is turned on.



The 2024 Embedded Online Conference