Control stepper motor

Discussion in 'Embedded Systems and Microcontrollers' started by entete, Mar 20, 2009.

  1. entete

    Thread Starter New Member

    Mar 14, 2009
    2
    0
    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!
     
  2. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    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.
     
  3. n9352527

    AAC Fanatic!

    Oct 14, 2005
    1,198
    4
    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.
     
  4. entete

    Thread Starter New Member

    Mar 14, 2009
    2
    0
    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!
     
  5. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    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.
     
Loading...