Skip to topic
|
Skip to bottom
"Wealth without money..."
Jump:
RepRap Home
What can it make?
One page description
Future Plans
Main Blog
Documentation
Make your own RepRap
Using your RepRap
Videos / Movies
RepStrap machines
Community
Get a RepRap Kit
User Forums
Builder's Wiki
Builder's Blog
RepRap auf Deutsch
RepRap en espaņol
RepRap in italiano
RepRap IRC Channel
RepRap Twitter
Object Library
Thingiverse
The People
World RepRap map
Related Sites
Background
Press
Philosophy
Acknowledgments
T-shirts, mugs etc.
GPL Licence
Privacy Policy
Main Web
Changes
Changes detailed
Topic list
Search
login
Edit
Attach
Printable
Main.StepperMotorController
r1.13 - 26 Dec 2007 - 21:38 -
ZachSmith
topic end
Start of topic |
Skip to actions
---+ Stepper Motor Controller SNAP Protocol Version 0 %TOC% This is the first version of the stepper driver command protocol, version 0. It communicates using the SNAP communication protocol, and accepts various commands for controlling both a single stepper controller, as well as doing coordinated movement with multiple stepper motors. ---++ API The following commands are in addition to the globally required commands on the main modules page. ---+++ [1] Set forward motion Starts the motor turning indefinitely in a forward direction. If the motor reaches the maximum position sensor (as defined by the maximum optointerrupter input), motion will stop. Parameters: * 1 byte: [[HyperbolicSpeed][Speed]] to turn (0 to 255) Returns: * _Nothing_ Notes: A speed of 0 will hold the current motor position. Use command [6] to power down the motor and let it turn freely. ---+++ [2] Set reverse motion Starts the motor turning indefinitely in a reverse direction. If the motor reaches the minimum position sensor (as defined by the minimum optointerrupter input), motion will stop. Parameters: * 1 byte: [[HyperbolicSpeed][Speed]] to turn (0 to 255) Returns: * _Nothing_ Notes: A speed of 0 will hold the current motor position. Use command [6] to power down the motor and let it turn freely. ---+++ [3] Set position counter Parameters: * 1 byte: low order byte of 16 bit position counter * 1 byte: high order byte of 16 bit position counter Returns: * _Nothing_ ---+++ [4] Get position counter Parameters: * _Nothing_ Returns: * 1 byte: low order byte of 16 bit position counter * 1 byte: high order byte of 16 bit position counter ---+++ [5] Seek to position Parameters: * 1 byte: [[HyperbolicSpeed][Speed]] to move (1 to 255) * 1 byte: low order byte of 16 bit position counter * 1 byte: high order byte of 16 bit position counter ---+++ [6] Power down motor (torque off) Powers the stepper motor down so that it can freely turn. This is accomplished by dropping the enable line and the four stepper outputs. Parameters: * _None_ Returns: * _Nothing_ ---+++ [7] Enable asynchronous notifications Tells the stepper board to notify the host when it has reached the target for its mode (position, home, etc.) Parameters: * 1 byte: address to notify (generally host) Returns: * _Nothing_ Upon notification, the board will send a SNAP packet to the notification address that contains different data, depending on the type of notification. *Completion of rome/reset* * 1 byte: 16 (home/reset command value) *Completion of calibration:* * 1 byte: 9 (calibration command value) * 1 byte: low order byte of 16 bit maximum position counter * 1 byte: high order byte of 16 bit maximum position counter *Completion of seek:* * 1 byte: 5 (seek command value) * 1 byte: low order byte of 16 bit current position counter * 1 byte: high order byte of 16 bit current position counter *Completion of DDA:* * 1 byte: 11 (DDA command value) * 1 byte: low order byte of 16 bit current position counter * 1 byte: high order byte of 16 bit current position counter ---+++ [8] Prepare for synchronised movement Parameters: * 1 byte: sync mode for the stepper motor. based on the table below: Returns: * _Nothing_ | *Value* | *Meaning* | | 0 | no sync (ignore sync pulses) | | 1 | synchronized seeking (not sure if this is used) | | 2 | incremental sync. move stepper forward 1 step each sync pulse | | 3 | decremental sync. move stepper backward 1 step each sync pulse | ---+++ [9] Calibrate Initiates the calibration routine. This consists of seeking to home/minimum sensor, setting position to 0, then seeking to maximum sensor and recording the maximum position. Parameters: * 1 byte: [[HyperbolicSpeed][Speed]] to move (1 to 255) Returns: * _Nothing_ ---+++ [10] Get motion range Parameters: * 1 byte: 10 (get range command value) * 1 byte: low order byte of 16 bit maximum position counter * 1 byte: high order byte of 16 bit maximum position counter Returns: * _Nothing_ ---+++ [11] DDA; follow a co-ordinated line of motion Starts a DDA movement where the X/Y axis move in a coordinated fashion to draw a straight line where they both start and stop at the same time. Parameters: * 1 byte: [[HyperbolicSpeed][Speed]] to move (1 to 255) * 1 byte: low order byte of 16 bit master's target * 1 byte: high order byte of 16 bit master's target * 1 byte: low order byte of 16 bit slave's delta (which is abs(slave.current_position - slave.target_position)) * 1 byte: high order byte of 16 bit slave's delta (which is abs(slave.current_position - slave.target_position)) Returns: * _Nothing_ ---+++ [12] Forward a single step Parameters: * _None_ Returns: * _Nothing_ ---+++ [13] Reverse a single step Parameters: * _None_ Returns: * _Nothing_ ---+++ [14] Set motor power Set the power output to the stepper motor. This is useful where output power must be limited to prevent damage to a motor. By default, for safety reasons, the driver starts in a low current mode. To enable full power output this function must be called first. Note: This function has no effect if RB3 is not connected to the motor driver enable line (eg if it is held permanently on). ---+++ [15] Get raw sensor inputs Primarily for debugging and diagnostic purposes, but possibly also useful for reporting. Parameters: * _None_ Returns: * 1 byte: Response type (15) * 1 byte: PORTA inputs * 1 byte: PORTB inputs ---++ Firmware There are two different versions of firmware: older, stable firmware designed for the PIC16F648 and newer firmware designed for the Arduino. They both function identically, and accept the same commands. ---+++ PIC Based Firmware The PIC based firmware is based upon each individual stepper controller board having its own individual PIC chip. Each board gets programmed with its own unique firmware. The three firmwares provide controllers on network addresses 2, 3 and 4. PIC16F628 code images and source are available from [[http://sourceforge.net/project/showfiles.php?group_id=159590&package_id=188575][SourceForge]]. More information on the electronics required to process the commands is located [[Generation1Electronics][here]]. ---+++ Arduino Based Firmware The Arduino is a much more powerful microcontroller board based on the atmega168, and we provide a firmware for it that emulates 3 individual stepper motor boards. From the perspective of the host software, it operates completely identical. The emulated controllers are on network addresses 2, 3, and 4. Arduino firmware is available from [[http://sourceforge.net/project/showfiles.php?group_id=159590&package_id=256565][SourceForge]]. More information on the electronics required to process the commands is located [[Generation2Electronics][here]].
to top
End of topic
Skip to action links
|
Back to top
Edit
|
Attach image or document
|
Printable version
|
Raw text
|
More topic actions
Revisions: | r1.13 |
>
|
r1.12
|
>
|
r1.11
|
Total page history
|
Backlinks
|
Refresh
You are here:
Main
>
StepperMotorController
to top
Copyright © 1999-2009 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding
RepRap
?
Send feedback