User Tools

Site Tools


oak:tutorials:stepper_motor

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
oak:tutorials:stepper_motor [2017/01/14 16:47]
Rover#18
oak:tutorials:stepper_motor [2017/01/14 16:52] (current)
Rover#18 minor edits in the remote commanding description
Line 301: Line 301:
   * **motion(start)** starts motion, if you previously configured speed and direction.   * **motion(start)** starts motion, if you previously configured speed and direction.
   * **motion(stop)** stops motion.   * **motion(stop)** stops motion.
-  * **setspeed(**[stepsPerSecond]**)** sets the motor speed in steps per second. +  * **setspeed**(stepsPerSecond) sets the motor speed in steps per second. 
-    * Accepts floating point values between -1000 and 1000.  ​+      * Accepts floating point values between -1000 and 1000.  ​
       * Example: speed of 0.5 steps/sec will step once per 2 seconds.       * Example: speed of 0.5 steps/sec will step once per 2 seconds.
-    ​* Negative values set direction negative. +      ​* Negative values set direction negative. 
-    * You can command a different speed while the motor is running. +      * You can command a different speed while the motor is running. 
-  * setdir(-1 or 1) sets motor direction. ​  +  ​* **setdir**(-1 or 1) sets motor direction. ​  
-    * Whether 1 corresponds to CW or CCW depends on which coil you hooked up to A and B. +      * Whether 1 corresponds to CW or CCW depends on which coil you hooked up to A and B. 
-    * You can command a different direction while the motor is running.+      * You can command a different direction while the motor is running.
  
  
Line 383: Line 383:
 As noted in the stepper motor overview above, stepper motors can only reach a finite set of positions. ​ A stepper motor with 200 steps/rev, for example, can only position within 0.9° from an arbitrary target position, when operated in full-step mode.  If you require better accuracy, consider researching and experimenting with [[https://​en.wikipedia.org/​wiki/​Stepper_motor#​Microstepping|micro-stepping]]. ​ The A4988 facilitates micro-stepping to 1/16th-step resolution, and enabling this function is quite simple. ​ If you want to use 1/4, 1/8, or 1/16th step sizes exclusively,​ then you can configure the A4988 for this with 1, 2, or 3 additional jumpers or resistors, respecively. ​ If you want to toggle between step sizes, then connect 3 Oak GPIO pins to the A4988 MS1, MS2, and MS3 pins and update the sketch to manage these pins. As noted in the stepper motor overview above, stepper motors can only reach a finite set of positions. ​ A stepper motor with 200 steps/rev, for example, can only position within 0.9° from an arbitrary target position, when operated in full-step mode.  If you require better accuracy, consider researching and experimenting with [[https://​en.wikipedia.org/​wiki/​Stepper_motor#​Microstepping|micro-stepping]]. ​ The A4988 facilitates micro-stepping to 1/16th-step resolution, and enabling this function is quite simple. ​ If you want to use 1/4, 1/8, or 1/16th step sizes exclusively,​ then you can configure the A4988 for this with 1, 2, or 3 additional jumpers or resistors, respecively. ​ If you want to toggle between step sizes, then connect 3 Oak GPIO pins to the A4988 MS1, MS2, and MS3 pins and update the sketch to manage these pins.
  
- +Hope you found this useful!
oak/tutorials/stepper_motor.txt · Last modified: 2017/01/14 16:52 by Rover#18