diff --git a/docs/Instruction/images/stepper/42SHD4002-24B.jpg b/docs/Instruction/images/stepper/42SHD4002-24B.jpg new file mode 100644 index 0000000000000000000000000000000000000000..af1fd0e46e8ee5fc7f9b72e2d3f415e2d01cb00c Binary files /dev/null and b/docs/Instruction/images/stepper/42SHD4002-24B.jpg differ diff --git a/docs/Instruction/images/stepper/42SHD_spec.png b/docs/Instruction/images/stepper/42SHD_spec.png new file mode 100644 index 0000000000000000000000000000000000000000..6bc187296f55d50f3808b441005fb76a2d41a29b Binary files /dev/null and b/docs/Instruction/images/stepper/42SHD_spec.png differ diff --git a/docs/Instruction/images/stepper/42SHD_wire.png b/docs/Instruction/images/stepper/42SHD_wire.png new file mode 100644 index 0000000000000000000000000000000000000000..de06ebe9e34666b5ef4a469f287427fb18e0c525 Binary files /dev/null and b/docs/Instruction/images/stepper/42SHD_wire.png differ diff --git a/docs/Instruction/images/stepper/TMC2208_back.jpg b/docs/Instruction/images/stepper/TMC2208_back.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5ae1946b77648f6d89804448baa2e913191f22e4 Binary files /dev/null and b/docs/Instruction/images/stepper/TMC2208_back.jpg differ diff --git a/docs/Instruction/images/stepper/TMC2208_front.jpg b/docs/Instruction/images/stepper/TMC2208_front.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5ce2c53ea8bc94ebb81dd7fa8e0f92cc6f4026ae Binary files /dev/null and b/docs/Instruction/images/stepper/TMC2208_front.jpg differ diff --git a/docs/Instruction/images/stepper/arduino_tmc2208_lib.png b/docs/Instruction/images/stepper/arduino_tmc2208_lib.png new file mode 100644 index 0000000000000000000000000000000000000000..2197d54091507fe5891813747c3e14651099a1c4 Binary files /dev/null and b/docs/Instruction/images/stepper/arduino_tmc2208_lib.png differ diff --git a/docs/Instruction/images/stepper/mode_select.jpg b/docs/Instruction/images/stepper/mode_select.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2ceb756d9dfc84880aef210fec9891b054e176fd Binary files /dev/null and b/docs/Instruction/images/stepper/mode_select.jpg differ diff --git a/docs/Instruction/images/stepper/modes.png b/docs/Instruction/images/stepper/modes.png new file mode 100644 index 0000000000000000000000000000000000000000..0e0f2b7202103e4170860218cb5ce7674ab61a67 Binary files /dev/null and b/docs/Instruction/images/stepper/modes.png differ diff --git a/docs/Instruction/images/stepper/vref_hole.jpg b/docs/Instruction/images/stepper/vref_hole.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a337de575bc08363d1216c4406b761357e7a08b3 Binary files /dev/null and b/docs/Instruction/images/stepper/vref_hole.jpg differ diff --git a/docs/Instruction/images/stepper/vref_screw.jpg b/docs/Instruction/images/stepper/vref_screw.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5da9dd37d04caee9ffaec04f26f9277de7f67aac Binary files /dev/null and b/docs/Instruction/images/stepper/vref_screw.jpg differ diff --git a/docs/Instruction/tips/stepper_TMC2208.md b/docs/Instruction/tips/stepper_TMC2208.md new file mode 100644 index 0000000000000000000000000000000000000000..7d6192530cffe66272dea34d33401c0ec5348f20 --- /dev/null +++ b/docs/Instruction/tips/stepper_TMC2208.md @@ -0,0 +1,113 @@ +# Stepper Motor Driver TMC2208 + +{width=300} +{width=300} +[Digikey](https://www.digikey.jp/en/products/detail/trinamic-motion-control-gmbh/TMC2208SILENTSTEPSTICK/6873626) + +## About + [Datasheet](https://www.trinamic.com/fileadmin/assets/Products/ICs_Documents/TMC220x_TMC2224_datasheet_Rev1.09.pdf) + Ref. [youtube](https://www.google.com/search?q=TMC2208+how+to+use&rlz=1C5CHFA_enJP913JP913&oq=TMC2208+how+to+use&aqs=chrome..69i57j0i22i30.12837j0j7&sourceid=chrome&ie=UTF-8#kpvalbx=_Zp0dYqfAI9Pg2roP9bWQSA43) + +### Mode + + +- Mode 1: Standalone STEP/DIR Driver (Legacy Mode) + - **Replacement for A4988** + - Manual Vref/Stepper Current + +- Mode 2: Standalone STEP/DIR Driver with OTP pre-configuration + - OTP (One Time Programming) + +- Mode 3: STEP/DIR Driver with Full Diagnostics and Control + - **pin PDN_UART is connected to the CPU UART interface** + +## Set up as Mode 1 + +### Mode select + +{width=400} + +- Mode 1: no jumber (default) + +### Stepper Motor + + +[42SHD4002-24B](https://akizukidenshi.com/catalog/g/gP-14604/)|[datasheet](https://akizukidenshi.com/download/ds/fudeelec/42shd4002-24b.pdf) +{width=500} +{width=500} + +- Rated voltage: 12V +- Rated current: 0.55A + +### Vref formula +#### RMS Current + +- Root Mean Square ([二乗平å‡å¹³æ–¹æ ¹](https://ja.wikipedia.org/wiki/%E4%BA%8C%E4%B9%97%E5%B9%B3%E5%9D%87%E5%B9%B3%E6%96%B9%E6%A0%B9)) + +RMS Current = MAX CURRENT / 1.41 +VREF = (RMS Current x 2.5)/1.77) + +value |formula |42SHD4002-24B |Safer use 90% of VREF +-- |--- |-- |-- +RMS Current|MAX Current / 1.41 |0.55[A] / 1.41 = 0.39 | - +VREF |(RMS Current x 2.5)/1.77 |(0.39 x 2.5)/1.77 = 0.55|0.55 x 0.9 = 0.495[V] + + +{width=300} +{width=300} + + +### Arduino + +#### Library + +New: [TMCStepper](https://github.com/teemuatlut/TMCStepper) +Old: [TMC2208Stepper](https://github.com/teemuatlut/TMC2208Stepper) + +Sketch -> Include Library -> Library Manager -> Search "tmc" -> install both libraries +{width=400} + +#### sample Sketch + +File -> Examples -> TMC2208Stepper -> TMC2208_Simple + +``` +// Author Teemu Mäntykallio, 2017-04-07 + +// Define pins +#define EN_PIN 38 // LOW: Driver enabled. HIGH: Driver disabled +#define STEP_PIN 54 // Step on rising edge + +#include <TMC2208Stepper.h> // Include library +TMC2208Stepper driver = TMC2208Stepper(&Serial1); // Create driver and use + // HardwareSerial0 for communication + +void setup() { + Serial.begin(9600); + Serial.println("Start..."); + Serial1.begin(115200); // Start hardware serial 1 + driver.push(); // Reset registers + + // Prepare pins + pinMode(EN_PIN, OUTPUT); + pinMode(STEP_PIN, OUTPUT); + digitalWrite(EN_PIN, HIGH); // Disable driver in hardware + + driver.pdn_disable(true); // Use PDN/UART pin for communication + driver.I_scale_analog(false); // Use internal voltage reference + driver.rms_current(500); // Set driver current 500mA + driver.toff(2); // Enable driver in software + + digitalWrite(EN_PIN, LOW); // Enable driver in hardware + + uint32_t data = 0; + Serial.print("DRV_STATUS = 0x"); + driver.DRV_STATUS(&data); + Serial.println(data, HEX); +} + +void loop() { + digitalWrite(STEP_PIN, !digitalRead(STEP_PIN)); + delayMicroseconds(100); +} +```