Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Thread Tools Display Modes
Old 29th March 2006, 12:38 PM   (permalink)
Default Stepper Motor (position)

hi im programming a unipolar stepper motor in c for a pic18458 device, in full step mode.

one task is to get the position of the Rotor, and i just can’t seem to figure out a way to do it, can someone please help me on this, im in need of professional help from u guys.

thanks in advance
zmanultra is offline  
Reply With Quote
Old 29th March 2006, 01:12 PM   (permalink)
Default

You can't "get" the position of the motor (rotor). You can keep track of the position and therefore know where the motor is.

As a second thought, your question is a little vague. Finding the position of the rotor (instead of the motor) could be as simple as knowing if it's at a half step position.

Mike.
Pommie is offline  
Reply With Quote
Old 29th March 2006, 11:08 PM   (permalink)
Default

Some Ham Radio projects I've seen use an optical coupler and a disc mounted onto the stepper motor shaft to detect a 'home' position... After moving the stepper to the 'home' position they simply keep track of the number of steps in either direction...

Good luck with your project... Regards, Mike
Mike, K8LH is offline  
Reply With Quote
Old 30th March 2006, 12:17 AM   (permalink)
Default

A stepper motor. normally being an open loop device, require a "present position" counter to keep track of its position. This counter is, depending upon direction, either incremented or decremented for very step taken.

Assuming you are generating the steps pulses from software, you'd use a 16-24 bit counter in one of the general purpose registers.

Below is a sample assembly code for the PIC18 family:

Code:
         MOVLW    0
;
         BTFSC    DIRECTION
         BRA      DIR_NEG
;
         INCF     PP+0,F
         ADDWFC   PP+1,F
         ADDWFC   PP+2,F
;
         BRA      CALC_PP_END
DIR_NEG:
         DECF     PP+0,F
         SUBWFB   PP+1,F
         SUBWFB   PP+2,F
CALC_PP_END:
PP is a 3-byte general purpose file register area to hold the 24-bit present position counter.
__________________
"Having to do with Motion Control"
motion is offline  
Reply With Quote
Old 4th April 2006, 06:14 PM   (permalink)
Default

An open loop "position counter" has the one drawback of being completely useless should the motor stall or slip. If you are powering a low speed low torque application then a position counter can be very useful and inexpensive. For any project that requires lots of torque, high speeds, fast accelerations, and abrupt direction changes, a rotary encoder is the way to go.
phalanx is offline  
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes




All times are GMT. The time now is 06:15 AM.


Electronic Circuits  |  Electronics Wiki
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.