Shop OBEX P1 Docs P2 Docs Learn Events
Steppenmotor Controller — Parallax Forums

Steppenmotor Controller

mtstormmtstorm Posts: 8
edited 2009-06-29 21:45 in General Discussion
Thanks to the mail Peter I found this forum. I'm working on a robot that will be controlled using steppermotors. I found a great chip that meets my requirements, it is the AMIS-30624. This chip is a steppenmotor controller and communicates using I2C. The basic idea is to make an general controller for a steppenmotor. This will allow us to make different implementations for driver strategies. The big question is what kind of functionality should we have? I would like to use this threat to found out what abstraction we can derive form multiple steppermotor drivers so we can have a clean API for steppers.

Just an idea:
/**
* The strategy of the steppen motor controller to communicate with the
* hardware.
*
* @author M.T.Storm
*
*/
public abstract class AbstractSteppenMotorDriver {

public abstract void setSecurePosition(int position);
/**
* Moves the steppermotor to the secure position.
*
* @return
*/
public abstract int gotoSecurePosition();


/**
* Set the maximum position off the steppermotor based on 0.
*
* @param position
* the absolute position based.
*/
public abstract void setAbsolutePosition(int position);

/**
* resets the position.
*
* @return Reply code
*/
public abstract int resetPosition();

/**
* Get the current position of the steppenmotor.
*
* @return The current position.
*/
public abstract int getPosition();

/**
* Set the new position of the steppenmotor.
*
* @param position
* @return
*/
public abstract int setPosition(int position);

/**
* Checks if the steppermotor is in motion.
*
* @return
*/
public abstract boolean isInMotion();
}

Comments

  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2009-06-29 21:07
    A steppermotor must have a resolution (steps per revolution). When using microstepping
    the resolution is increased. Example 200 steps per revolution, microstep 1/16 gives
    resolution 200*16.
    This resolution should be passed to the constructor.
    Also, when specifying a new position, is that relative clockwise, relative counterclockwise,
    or absolute related to 0 position (is that equal to secure position?).
    You may want to provide very basic methods for moving a number of (micro)steps,
    using negative values for CCW, and positive values for CW.
    You can provide conversion methods to convert (micro)steps into angles and vice versa.
    Then·you can provide methods to move in angles, this is for the application more
    useful than using steps·(another motor requires different steps but the angles remain).
    Servos also specify a ramp, how quickly must the new position be reached?
    I presume·steppermotors will need that too.

    I attached the Parallax Servo Controller class, which contains a conversion between
    an absolute position and angle.·You can use that for steppermotors also I think.

    regards peter
  • mtstormmtstorm Posts: 8
    edited 2009-06-29 21:45
    You are right and I think that logic should be implemented by the controller (generic code), the driver will be controlled by the controller. I will try to implement it in the controller and will implements the driver for the amis. The logic uses the a driver, like the amis or an other ic to do the actual work.
Sign In or Register to comment.