Skip to content

Commit 734da17

Browse files
committed
Update README.md
1 parent a661ea5 commit 734da17

File tree

1 file changed

+6
-245
lines changed

1 file changed

+6
-245
lines changed

README.md

Lines changed: 6 additions & 245 deletions
Original file line numberDiff line numberDiff line change
@@ -1,249 +1,10 @@
11
# Bpod Stepper Module
22

3-
<img align="right" src="images/module.png" width="350px">Combining smooth acceleration profiles with a _SilentStepStick_ driver, the _Bpod Stepper Module_ allows for virtually noiseless operation of a stepper motor - either as a module for _Bpod state machine r2_ or as a stand-alone USB device.
4-
5-
## Serial Command Interface
6-
7-
### Moving the Motor
8-
The following serial commands control the movement of the motor. All movements can be interrupted by activation of an end-switch or issuance of a stop command. The Stepper Module will try to keep track of the position at all times (it should be able to do so unless there is a loss of steps). This way, you can target absolute positions. Some of the following commands can also be [bound to one of the IO ports](#bind-movement-trigger-to-IO-port).
9-
10-
* #### Move forwards
11-
Start continuous movement forwards.
12-
13-
PUT 1 uInt8: 70 ('F')
14-
15-
* #### Move backwards
16-
Start continuous movement backwards.
17-
18-
PUT 1 uInt8: 66 ('B')
19-
20-
* #### Move to a relative position
21-
Move a defined number of steps relative to the current position. Positive numbers will result in clockwise, negative numbers in counter-clockwise rotation.
22-
23-
PUT 1 uInt8: 83 ('S')
24-
PUT 1 Int16: relative position [steps]
25-
26-
* #### Move to an absolute position
27-
28-
PUT 1 uInt8: 80 ('P')
29-
PUT 1 Int16: absolut position [steps]
30-
31-
32-
* #### Move to a predefined target
33-
See also: [*predefined targets*](#predefined-targets).
34-
35-
PUT 1 uInt8: 1 … 9 [target ID]
36-
37-
* #### Get current position
38-
This will return the current position of the motor. The command can also be used to monitor ongoing movements.
39-
40-
PUT 2 uInt8: 71, 80 ('GP')
41-
GET 1 Int16: absolute position [steps]
42-
43-
* #### Reset absolute position
44-
This command will reset the current position to zero (without moving the motor).
45-
46-
PUT 1 uInt8: 90 ('Z')
47-
48-
49-
### Stopping the motor
50-
In addition to using end-switches, the motor can also be stopped by means of serial commands. Either of the two stop commands can be [bound to one of the module's IO ports](#bind-movement-trigger-to-IO-port).
51-
52-
* #### Soft stop
53-
Decelerate the motor to a complete standstill.
54-
55-
PUT 1 uInt8: 120 ('x')
56-
57-
* #### Emergency stop
58-
Stop the motor abruptly. Depending on motor speed this will lead to a loss of steps.
59-
60-
PUT 1 uInt8: 88 ('X')
61-
62-
63-
### Predefined targets
64-
The stepper module can store up to 9 target definitions, along with individual peak velocities and accelerations.
65-
Movement to one of these targets can be triggered by a single byte serial command (see [*Moving the Motor*](#move-to-a-predefined-target)).
66-
Alternatively, you can [bind a trigger to one of the IO ports](#bind-movement-trigger-to-IO-port).
67-
68-
69-
* #### Define a target
70-
71-
PUT 1 uInt8: 84 ('T')
72-
PUT 1 uInt8: 1 … 9 [target ID]
73-
PUT 1 Int32: target position [steps]
74-
PUT 1 uInt16: peak velocity [steps / s, 0 = use global peak velocity]
75-
PUT 1 uInt16: acceleration [steps / s^2, 0 = use global acceleration]
76-
77-
* #### Get the definition of a target
78-
79-
PUT 1 uInt8: 71 ('G')
80-
PUT 1 uInt8: 1 … 9 [target ID]
81-
GET 1 Int32: target position [steps]
82-
GET 1 uInt16: peak velocity [steps / s, 0 = use global peak velocity]
83-
GET 1 uInt16: acceleration [steps / s^2, 0 = use global acceleration]
84-
85-
86-
### Configuration of movement parameters
87-
All of the motors movements are defined by an acceleration phase, a peak velocity and a deceleration phase (the sole exception being the [emergency stop](#emergency-stop)).
88-
89-
* #### Set Acceleration
90-
This parameter is valid for, both, the acceleration and the deceleration phase.
91-
92-
PUT 1 uInt8: 65 ('A')
93-
PUT 1 uInt16: acceleration [steps / s^2]
94-
95-
* #### Get Acceleration
96-
97-
PUT 2 uInt8: 71, 65 ('GA')
98-
GET 1 uInt16: acceleration [steps / s^2]
99-
100-
* #### Set peak velocity
101-
102-
PUT 1 uInt8: 86 ('V')
103-
PUT 1 uInt16: peak velocity [steps / s]
104-
105-
* #### Get peak velocity
106-
107-
PUT 2 uInt8: 71, 86 ('GV')
108-
GET 1 uInt16: peak velocity [steps / s]
109-
110-
111-
### Configuration of motor parameters
112-
113-
* #### Set RMS current
114-
Set the driver's RMS current output to the motor (up to 850mA for TMC2130, up to 2000mA for TMC5160).
115-
116-
PUT 1 uInt8: 73 ('I')
117-
PUT 1 uInt16: RMS current [mA]
118-
119-
* #### Get RMS current
120-
121-
PUT 2 uInt8: 71, 73 ('GI')
122-
GET 1 uInt16: RMS current [mA]
123-
124-
* #### Set hold current
125-
Set the current for standstill (up to 850mA for TMC2130, up to 2000mA for TMC5160; 0mA corresponds to free-wheeling mode).
126-
127-
PUT 1 uInt8: 73 ('i')
128-
PUT 1 uInt16: hold current [mA]
129-
130-
* #### Get RMS current
131-
132-
PUT 2 uInt8: 71, 73 ('Gi')
133-
GET 1 uInt16: hold current [mA]
134-
135-
* #### Set chopper mode
136-
You can select between three different chopper modes: a PWM chopper ("spreadCycle"), a voltage chopper ("stealthChop") and a classical constant off-time chopper. The voltage chopper offers extremely quiet operation at standstill and low to medium speeds. Depending on the use case, the PWM chopper can perform better at higher speeds. The constant off-time chopper will perform similarly to the PWM chopper but produce more noise. Refer to [the Trinamic website](https://www.trinamic.com/technology/motor-control-technology/chopper-modes/) for more details.
137-
138-
PUT 1 uInt8: 67 ('C')
139-
PUT 1 uInt8: chopper mode [0 = PWM, 1 = voltage, 2 = constant T_OFF]
140-
141-
* #### Get chopper mode
142-
143-
PUT 2 uInt8: 71, 67 ('GC')
144-
GET 1 uInt8: chopper mode [0 = PWM, 1 = voltage, 2 = constant T_OFF]
145-
146-
147-
### Configuration of IO ports
148-
149-
150-
* #### Bind function to IO port
151-
Each of the 6 IO ports can be configured to trigger specific movement commands. Available trigger configurations are: None (```0```), Move to predefined target position (```1 … 9```), start forward rotation (```70 / 'F'```), start backward rotation (```66 / 'B'```), soft stop (```120 / x```), emergency stop (```88 / 'X'```), forward limit (```76 / 'L'```), backward limit (```74 / 'J'```).
152-
153-
PUT 1 uInt8: 77 ('M')
154-
PUT 1 uInt8: 1 … 6 [IO port]
155-
PUT 1 uInt8: function [0; 1 … 9; 'F'; 'B'; 'x'; 'X'; 'L'; 'J']
156-
157-
* #### Get function of IO port
158-
159-
PUT 2 uInt8: 71, 77 ('GM')
160-
PUT 1 uInt8: 1 … 6 [IO port]
161-
GET 1 uInt8: function [0; 1 … 9; 'F'; 'B'; 'x'; 'X'; 'L'; 'J']
162-
163-
* #### Set input configuration of IO port
164-
When used as inputs the IO ports can be configured with different input modes: floating, pull-up or pull-down.
165-
166-
PUT 1 uInt8: 82 ('R')
167-
PUT 1 uInt8: 1 … 6 [number of IO port]
168-
PUT 1 uInt8: input configuration [0 = floating; 1 = pull-up; 2 = pull-down]
169-
170-
* #### Get input configuration of IO port
171-
172-
PUT 2 uInt8: 71, 82 ('GR')
173-
PUT 1 uInt8: 1 … 6 [number of IO port]
174-
GET 1 uInt8: input configuration [0 = floating; 1 = pull-up; 2 = pull-down]
175-
176-
177-
### EEPROM storage
178-
The Stepper Module can store its configuration to non-volatile memory.
179-
This way you can define default values for your specific setup.
180-
Stored values will automatically be loaded during start-up of the module.
181-
This enables the use of the Stepper Module as a headless unit (i.e., without connection to Bpod or USB host).
182-
183-
* #### Store settings to EEPROM
184-
To store the current configuration to EEPROM:
185-
186-
PUT 1 uInt8: 69 ('E')
187-
188-
The following values will be stored:
189-
* maximum velocity,
190-
* acceleration,
191-
* RMS current,
192-
* chopper mode,
193-
* predefined targets,
194-
* input resistance of IO ports, and
195-
* function of IO ports.
196-
197-
198-
### System Information
199-
200-
* #### Get Hardware version
201-
Identify the Stepper Module's hardware revision
202-
203-
PUT 2 uInt8: 71, 72 ('GH')
204-
GET 1 uInt8: hardware revision [multiplied by 10]
205-
206-
* #### Get driver version
207-
Identify the installed stepper driver.
208-
209-
PUT 2 uInt8: 71, 84 ('GT')
210-
GET 1 uInt8: driver version [0 = unknown, 17 = TMC2130, 48 = TMC5360]
211-
212-
* #### Get firmware version / USB handshake
213-
214-
PUT 1 uInt8: 212
215-
GET 1 uInt32: firmware version
216-
217-
* #### Get Module info (reserved)
218-
219-
PUT 1 uInt8: 255
220-
221-
222-
## Bill of Materials
223-
| Item | Vendor | Qty | Part Number | Description |
224-
| :------- | :-------- | :-: | :----------------------------------------------------------------------------------------------- | :-------------------------- |
225-
| C1, C2 | Digi-Key | 2 | [1189-3780-1-ND](https://www.digikey.com/en/products?keywords=1189-3780-1-ND) | Aluminium capacitor, 100 µF |
226-
| C3, C4 | Digi-Key | 2 | [PCE4362CT-ND](https://www.digikey.com/en/products?keywords=PCE4362CT-ND) | Aluminium capacitor, 2.2 µF |
227-
| C5 - C8 | Digi-Key | 4 | [311-1179-1-ND](https://www.digikey.com/en/products?keywords=311-1179-1-ND) | Ceramic capacitor, 0.1 µf |
228-
| D1 | Digi-Key | 1 | [1KSMB75CACT-ND](https://www.digikey.com/en/products?keywords=1KSMB75CACT-ND) | TVS diode |
229-
| D2 - D3 | Digi-Key | 2 | [SBR80520LT1G](https://www.digikey.com/en/products?keywords=SBR80520LT1G) | Schottky diode, 20V 500mA |
230-
| D4 - D12 | Digi-Key | 9 | [SS310LWHRVGCT-ND](https://www.digikey.com/en/products?keywords=SS310LWHRVGCT-ND) | Schottky diode, 100V 3A |
231-
| IC1, IC3 | Digi-Key | 2 | [MCP1792T-5002H/DB](https://www.digikey.com/en/products?keywords=MCP1792T-5002H/DB) | 5V regulator |
232-
| IC2 | Digi-Key | 1 | [ADM3077EARZ-ND](https://www.digikey.com/en/products?keywords=ADM3077EARZ-ND) | RS-485 IC |
233-
| IC4 | Digi-Key | 1 | [MCP1793T-3302H/DC](https://www.digikey.com/en/products?keywords=MCP1793T-3302H/DC) | 3.3V regulator |
234-
| | Digi-Key | 1 | [A31442-ND](https://www.digikey.com/en/products?keywords=A31442-ND) | Ethernet jack |
235-
| | Digi-Key | 1 | [839-1512-ND](https://www.digikey.com/en/products?keywords=839-1512-ND) | DC barrel jack |
236-
| | Digi-Key | 1 | [PPTC021LFBN-RC](https://www.digikey.com/en/products?keywords=PPTC021LFBN-RC) | Female header, 1x2 |
237-
| | Digi-Key | 2 | [PPPC081LFBN-RC](https://www.digikey.com/en/products?keywords=PPPC081LFBN-RC) | Female header, 1x8 |
238-
| | Digi-Key | 2 | [PPPC241LFBN-RC](https://www.digikey.com/en/products?keywords=PPPC241LFBN-RC) | Female header, 1x24 |
239-
| | Digi-Key | 1 | [1568-1464-ND](https://www.digikey.com/en/products?keywords=1568-1464-ND) | Teensy 3.5 |
240-
| | Digi-Key | 1 | [WM21887-ND](https://www.digikey.com/en/products?keywords=WM21887-ND) | Terminal Block Header, 1x4 |
241-
| | Digi-Key | 1 | [WM7780-ND](https://www.digikey.com/en/products?keywords=WM7780-ND) | Terminal Block Header, 1x12 |
242-
| | Digi-Key | 1 | [WM7791-ND](https://www.digikey.com/en/products?keywords=WM7791-ND) | Terminal Block Plug, 1x4 |
243-
| | Digi-Key | 1 | [WM7742-ND](https://www.digikey.com/en/products?keywords=WM7742-ND) | Terminal Block Plug, 1x12 |
244-
| | Watterott | 1 | [201899-001](https://shop.watterott.com/SilentStepStick-TMC5160-Stepper-motor-driver-10-35V-V15) | Stepper motor driver |
3+
<img align="right" src="images/module.png" width="350px">The *Bpod Stepper Module* enables virtually noiseless operation of a stepper motor by combining smooth acceleration profiles with a *SilentStepStick* driver. You can use it either as a module for *Bpod state machine r2* or as a stand-alone USB device.
2454

5+
## Wiki
2466

7+
Please refer to [**the wiki**](../../wiki) for documentation.
2478

2489
## Credits ##
24910

@@ -252,8 +13,8 @@ This enables the use of the Stepper Module as a headless unit (i.e., without con
25213
* PCB layout partially based on:
25314
* [Bpod Teensy Shield](https://github.com/sanworks/Bpod-CAD/tree/master/PCB/Modules/Gen2/Bpod%20Teensy%20Shield) by Sanworks ([GPL v3](https://www.gnu.org/licenses/gpl-3.0.en.html))
25415
* [SilentStepStick Protector](https://github.com/watterott/SilentStepStick) by Watterott ([CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/))
255-
* Firmare uses the following libraries:
256-
* [ArCOM](https://github.com/sanworks/ArCOM) by Sanworks ([GPL v3](https://www.gnu.org/licenses/gpl-3.0.en.html))
16+
* Library dependencies:
17+
* [ArCOM](https://github.com/bimac/ArCOM) by Sanworks ([GPL v3](https://www.gnu.org/licenses/gpl-3.0.en.html))
25718
* [TeensyStep](https://github.com/luni64/TeensyStep) by luni64 ([MIT](https://opensource.org/licenses/MIT))
258-
* [SmoothStepper](https://github.com/bimac/SmoothStepper) by Florian Rau ([GPL v3](https://www.gnu.org/licenses/gpl-3.0.en.html))
25919
* [TMCStepper](https://github.com/teemuatlut/TMCStepper) by teemuatlut ([MIT](https://opensource.org/licenses/MIT))
20+
* [Teensy3x_QuadDecode](https://github.com/bimac/Teensy3x_QuadDecode.git) by TLB ([MIT](https://opensource.org/licenses/MIT))

0 commit comments

Comments
 (0)