# stepper_unipolar_common

Library to manage unipolar stepper motors, common lib

Author | Pavel Milanes Costa (CO7WT) - pavelmc@gmail.com, copyright © 2014, all rights reserved.
Adapted-by |
Compiler | >=2.4q3

Description

    This library files implement the drive procedures for UNIPOLAR stepper motors
    This file is the common vars/constants/procs to all stepper unipolar libs

    This lib supports 3 modes for the operation of stepper motors:

    This is a schematic representation of the wire naming of this lib

Sources

    I used a tutorial (in spanish) here http://www.todorobot.com.ar/informacion/tutorial%20stepper/
    This is a very good source also http://www.cs.uiowa.edu/~jones/step/ thanks vasi vasi
    A lib on jallib (in unreleased state) at the end of the development by Richard Zengerink dating
    back to 2010 give me some new ideas, thanks to all who put his knowledge in the public domain.

Dependencies

- delay

## Summary

### Global variables/contants

- `var word stepper_delay = 0`
- `const word _STEPPER_SPEED = STEPPER_STEPS_1TURN * STEPPER_RPM`
- `var bit stepper_wave = off`
- `var word smooth_pulses = 0`
- `const byte STEPPER_POS[8] = {8,12,4,6,2,3,1,9}`
- `var bit stepper_half = off`
- `var byte _stepper_state = 0`

### Procedures

- `stepper_off()`
- `stepper_step()`

### Functions

## API details

### Global variables/contants

- `var word stepper_delay = 0`

      How much time we need to stabilize the magnet on one position
      this is a delay expressed in miliseconds after each
      movement of the motor; This is the length of the pulse.

- `const word _STEPPER_SPEED = STEPPER_STEPS_1TURN * STEPPER_RPM`

      This calculation must be done ride away or the compiler make a kaput!!! & RIP
      this is the calculated speed of the motor (how many pulses per minute)

- `var bit stepper_wave = off`

      by default is normal mode

- `var word smooth_pulses = 0`

  No documentation found

- `const byte STEPPER_POS[8] = {8,12,4,6,2,3,1,9}`

      this array is the secuence of motion used en the 3 modes.

- `var bit stepper_half = off`

      modes of operation, by deaful user normal mode

- `var byte _stepper_state = 0`

      state of the motor, is a pointer to the array index

### Procedures

- `stepper_off()`

      motor shut off, leave it run free

- `stepper_step()`

      calculate the next step in the given direction from the actual state and mode

### Functions

## Related samples

No sample found