Control stepper motor

Thread Starter

entete

Joined Mar 14, 2009
2
Hi all,can anybody tell me the way to program the micromouse to do a smooth turn at the corner of maze? I'm using PIC 16F877A and a pair of stepper motor. Thanks 4 Ur advice!
 

mik3

Joined Feb 4, 2008
4,843
You need to measure the distance the wheels need to travel on the corner and make calculations for the speed of each wheel. Note that the outer wheel needs to rotate faster than the inner wheel on corners.
 

n9352527

Joined Oct 14, 2005
1,198
And also pay attention to the rate of acceleration and decelleration of each wheel. Abrupt increase and decrease to speed on outside wheel for example, will cause the mouse to corner jerkily.
 

Thread Starter

entete

Joined Mar 14, 2009
2
Ok! Assuming that the calculation is done. So I have the values of velocity,accelerate and decelerate of each motor at time. But I don't know how to control it by using 16F887A. I use the 20 MHz clock for PIC and 1.8 degree stepper motor,so how to control the motor move at 100 mm per second... How is the delay period calculated? (I use CCS C). Thanks for your help!
 

mik3

Joined Feb 4, 2008
4,843
First, you need to use a stepper motor driver and apply pulses to move the motor. The motor can move a step or half a step per pulse. Then you need to measure the wheels radius and calculate the distance they move each motor step and thus calculate how many steps you will need for 100mm.
 
Top