HOWTO control DC motors #10387
Replies: 17 comments 25 replies
-
Nice to see your cool solutions back here 👍 |
Beta Was this translation helpful? Give feedback.
-
Driver support for Wemos Motor Shield V2 is almost complete. |
Beta Was this translation helpful? Give feedback.
-
Hi All. Can someone point me at a forum which discusses and uses a stepper motor/A4988 solution to blinds tilting, and using arendst |
Beta Was this translation helpful? Give feedback.
-
Hi, is it possible to download the board layouts somewhere? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
i tried to use the TB6612 example with one motor, |
Beta Was this translation helpful? Give feedback.
-
there must be something wrong with the instructions, to use the dimmer-cmd for pwm-control with one-motor an TB6612 |
Beta Was this translation helpful? Give feedback.
-
Got it working. next steps: on console: |
Beta Was this translation helpful? Give feedback.
-
Hello |
Beta Was this translation helpful? Give feedback.
-
I wrote tasmota custom firmware on my D1 mini with i2c LOLIN Motor Shield and indeed it appears when boots 00:00:00.069 I2C: WEMOS_MOTOR_V1 found at 0x30. |
Beta Was this translation helpful? Give feedback.
-
The documentation at https://tasmota.github.io/docs/Compile-your-build/ explicitly states
Adding this line will select the V2 driver code. You may still need the statements
|
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Interesting to see that it works with HR8833 shields. I didn't even have such board on hand when i wrote the driver. Seems like they finally settled on some kind of API standard. |
Beta Was this translation helpful? Give feedback.
-
Hi there, has anyone tested the driver against a memos motor shield V3 (the AT8870 version)? Should the driver work in theory or would it need to be adapted? |
Beta Was this translation helpful? Give feedback.
-
Has any one got a setup for using a BTS7960 H-Bridge motor driver? Even better if it was possible to do an Acceleration at the start. Thanks |
Beta Was this translation helpful? Give feedback.
-
Hi, |
Beta Was this translation helpful? Give feedback.
-
Hi, Interesting post, and allot of information to go through. I do have a question about the TB6612FNG though. I'm designing a PCB that is going to use the TB6612FNG to drive 12v 2-wire LED lights, as is mostly seen in Christmas lights in which 2 stings of LED's have alternating polarities. However does anyone know if the PWM pins can be left HIGH and directly applying PWM to the IN1 and IN2 would work to pulse the corresponding output? If so I could use the tasmota h-bridge light or esphome h-bridge light integration . I came across this post, and it seems that applying PWM to the IN1 and IN2 directly could work? I've used the DRV8833 on 5v LEDs before, which worked great as a h-bridge light but it didn't have dedicated PWM pin per channel, but the DRV8833 is not able to run at 12v so I'm looking for a mosfet based alternative that is able to run on 12v like the TB6612FNG. Thanks in advance 👍 |
Beta Was this translation helpful? Give feedback.
-
What it can be used for:
the control of horizontal curtain or vertical shutters, blinds adjuster or window opener, pet feeders, opening of a water tap for watering the lawn, rotating table for subject photography, opening the ventilation flap, PTZ camera, 3D Scanner Table, linear Actuator.
1. MX1508 Motor Driver.
Video of the driver's work:
Note:
How to use it:
ShutterMode 1
// Enabling "Shutter mode 1"ShutterOpenDuration 2
// Shutter opening time = 2 secondsShutterCloseDuration 2
// Shutter closing time = 2 secondsRestart 1
// Restart TasmotaShutterOpen
// CW motor rotationShutterClose
// CWW motor rotationMore information:
2. TB6612FNG Motor Driver.
More information:
Video of the driver's work:
2.1 Using ONE motor
Note:
How to use it:
Rule1 ON system#boot DO Backlog Power3 1; Dimmer 75 ENDON
// Enabling the driver and setting the PWM to 75%.Rule1 1
// Enabling Rule1WebButton4 STBY
// To rename a web button (optional)ShutterMode 1
// Enabling "Shutter mode 1"Restart 1
// Restart TasmotaShutterOpen
// test CW motor rotationShutterClose
// test CWW motor rotation2.2 Using DUAL motor.
Note:
How to use it:
SetOption68 1
// Enable multi-channel PWMSetOption73 1
// Enable detach buttons from relaysRule1 ON system#boot DO Backlog Power5 1; Power6 1; Power7 1; Channel6 50; Channel7 75 ENDON
// Enable PWM to 50% and 75%.Rule1 1
// Enable Rule1Backlog WebButton5 PWM1; WebButton6 PWM2; WebButton7 STNB
// To rename a web button (optional)ShutterMode 1
// Enabling "Shutter mode 1"ShutterRelay1 1
// for relay Relay1 and Relay2ShutterRelay2 3
// for relay Relay3 and Relay4Restart 1
// Restart TasmotaShutterOpen1
// test CW motor1 rotationShutterClose1
// test CWW motor1 rotationShutterOpen2
// test CW motor2 rotationShutterClose2
// test CWW motor2 rotationShutterButton1 1 updown 0
// Assigns button#1 to act as an "up and down" button (1x press up, 2x press down) for Shutter#1ShutterButton2 2 updown 0
// Assigns button#2 to act as an "up and down" button (1x press up, 2x press down) for Shutter#23. Wemos motor shield.
Video of the driver's work:
More information:
3.1 Using ONE motor.
How to use it:
If you did everything correctly, then in the console you should see this message:
00:00:00.062 I2C: WEMOS_MOTOR_V1 found at 0x30
driver44 SETMOTOR,0,1,80
// for CCW motor1 (80% duty - optional)driver44 SETMOTOR,0,3
// for STOP motor1driver44 SETMOTOR,0,2,80
// for CW motor1 (80% duty - optional)driver44 SETMOTOR,0,4
// for standby motor1 (optional)More information!
Rule1
// remove comments before using the rule!ON Power1#state=1 DO Backlog Power2 0; Power3 0; driver44 SETMOTOR,0,3; delay 10; driver44 SETMOTOR,0,1,80; delay 55; driver44 SETMOTOR,0,3; Power1 0 ENDON
// CW motor1, "delay 55" controls the opening (time 55 = 5.5 sec).ON Power2#state=1 DO Backlog Power1 0; Power3 0; driver44 SETMOTOR,0,3; Power2 0 ENDON
// Stop motor1ON Power3#state=1 DO Backlog Power1 0; Power2 0; driver44 SETMOTOR,0,3; delay 10; driver44 SETMOTOR,0,2,80; delay 55; driver44 SETMOTOR,0,3; Power3 0 ENDON
//CCW motor1, "delay 55" controls the closing (time 55 = 5.5 sec).Rule1 1
// run rule1Backlog WebButton1 ⇈ WebButton2 Stop1; WebButton3 ⇊
3.2 Using DUAL motor.
How to use it:
If you did everything correctly, then in the console you should see this message:
00:00:00.062 I2C: WEMOS_MOTOR_V1 found at 0x30
driver44 SETMOTOR,0,1,75
// for CCW motor1 (75% duty - optional)driver44 SETMOTOR,0,3
// for STOP motor1driver44 SETMOTOR,0,2,75
// for CW motor1 (75% duty - optional)driver44 SETMOTOR,0,4
// for standby motor1 (optional)More information!
driver44 SETMOTOR,1,1,50
// for CCW motor2 (50% duty - optional)driver44 SETMOTOR,1,3
// for STOP motor2driver44 SETMOTOR,1,2,50
// for CW motor2 (50% duty - optional)driver44 SETMOTOR,1,4
// for standby motor2 (optional)More information!
Rule1
// remove comments before using the rule!ON Power1#state=1 DO Backlog Power2 0; Power3 0; driver44 SETMOTOR,0,3; delay 10; driver44 SETMOTOR,0,1,75; delay 69; driver44 SETMOTOR,0,3; Power1 0 ENDON
// CW motor1, "delay 69" controls the opening (time 69 = 6.9 sec.)"ON Power2#state=1 DO Backlog Power1 0; Power3 0; driver44 SETMOTOR,0,3; Power2 0 ENDON
// Stop motor1ON Power3#state=1 DO Backlog Power1 0; Power2 0; driver44 SETMOTOR,0,3; delay 10; driver44 SETMOTOR,0,2,75; delay 69; driver44 SETMOTOR,0,3; Power3 0 ENDON
// CCW motor1, "delay 69" controls the closing (time 69 = 6.9 sec).Rule1 1
// run rule1Rule2
// remove comments before using the rule!ON Power4#state=1 DO Backlog Power5 0; Power6 0; driver44 SETMOTOR,1,3; delay 10; driver44 SETMOTOR,1,1,50; delay 77; driver44 SETMOTOR,1,3; Power4 0 ENDON
// CW motor2, "delay 77" controls the opening (time 77 = 7.7 sec).ON Power5#state=1 DO Backlog Power4 0; Power6 0; driver44 SETMOTOR,1,3; Power5 0 ENDON
// Stop motor2ON Power6#state=1 DO Backlog Power4 0; Power5 0; driver44 SETMOTOR,1,3; delay 10; driver44 SETMOTOR,1,2,50; delay 77; driver44 SETMOTOR,1,3; Power6 0 ENDON
// CCW motor2, "delay 77" controls the closing (time 77 = 7.7 sec).Rule2 1
// run rule2Backlog WebButton1 ⇈ WebButton2 Stop1; WebButton3 ⇊
Backlog WebButton4 ↺ WebButton5 Stop2; WebButton6 ↻
Additional Information:
Note!!! :
"WEMOS MOTOR V1" requires a firmware update. Factory installed firmware has reliability issues like I2C bus stuck. The firmware requires regular USB2TTL.
More information!
!!! And be sure to short-circuit the RTS and 3V pins together on "Wemos motor shield V1".
or
stm32flash.exe COM4
stm32flash.exe -k COM4
stm32flash.exe -f -v -w motor_shield.bin COM4
!!! After finishing the firmware, disconnect all wires (including the 3V and RTS pin), connect the shield to the ESP device and it should work!
3.3 Using Wemos motor shield HR8833 Motor Shield (now no tested).
https://www.wemos.cc/en/latest/d1_mini_shield/hr8833_motor.html
https://aliexpress.com/item/1005003697301523.html
3.4 Using Wemos motor shield AT8870 Motor Shield (now no tested).
https://www.wemos.cc/en/latest/d1_mini_shield/at8870_motor.html
https://aliexpress.com/item/1005003800396010.html
Best regards,
TrDA.
Beta Was this translation helpful? Give feedback.
All reactions