Closed meingraham closed 4 years ago
I stumbled upon the conversation, very interesting stuff. Hope @stefanbode sees this.
I just wanted to emphasize the importance os this project, by copying the discord chat:
TrDALast Saturday at 7:11 AM These are me designed and printed on a 3D printer for mounting the Nema-17 stepper motor. This is done to control a large roller blind. The tasmota-wiki contains information about the management of Nema-17 + ESP8266 + A4986
![]()
![]()
![]()
//Rule1 on power1#state=1 do publish cmnd/Sonoff_MOTOR_1/MotorMove 10000 endon
//Rule2 on power1#state=0 do publish cmnd/Sonoff_MOTOR_1/MotorMove -10000 endon
Rule1 on power1#state=1 do MotorMove 10000 endon
Rule2 on power1#state=0 do MotorMove -10000 endon
Rule3 on system#boot do MotorRPM 300 endon
![]()
![]()
![]()
If you are going to remake your 28BYJ-48 engine to work with the A4988: https://coeleveld.com/wp-content/uploads/2016/10/Modifying-a-28BYJ-48-step-motor-from-unipolar-to-bipolar.pdf If you are going to print the drive for your roller blinds on a 3D printer, you can use these 3D models for the 28BYJ-48 engine. https://www.thingiverse.com/thing:2392856 https://www.thingiverse.com/thing:3368379
![]()
![]()
TrDALast Saturday at 12:08 PM You can connect two A4988 drivers in parallel with one ESP8266, and they will work synchronously - I tested it, it works fine
![]()
![]()
There is another option for connecting two NEMA-17, they will also work synchronously - this is a standard solution for 3D printers. Attention - stepper motors must be the same! https://nl.aliexpress.com/item/33052488815.html
All credit goes to https://github.com/TrDA-hab
I stumbled upon the conversation, very interesting stuff. Hope @stefanbode sees this.
Come on this is really over-engineered. You really want to operate a Schutter with a Stepper Motor?
I've seen many DIY shutters on the Internet that use steppers. Do, from what I have seen, yes. And from these two additional data points, ...
Ok maybe I can give it a try. But how does the current driver behave if i change the position during movement. I assume this is all in sync whatever you do. Are there limits or can I use unsigned long variables for the position. This might the easiest way to implement. Internally I already have something that I can use for the position command.
@TrDA-hab ⬆️
Is there an option to get the current position of the stepper. For example how to stop it. Power off is maybe not a good idea. I assume it is not self locking. I saw the wiki with some commands but no info what and how stuff is reported back. Look I need to assemble one and give it a try to see what happens
Adding @Leuselator who wrote the stepper driver.
my2ct: Steppers themselves usually don't report anything.
You have (at least) one endstop that reports a known position and from there on it is step counting by the „user“ and trusting no steps are lost.
Usually this works very well, see 3D printers as proof...
@stefanbode
But how does the current driver behave if i change the position during movement?
Is there an option to get the current position of the stepper?
For example, the commands: raise and lower the curtain: Rule1 on power1#state=1 do MotorMove 10000 endon Rule2 on power1#state=0 do MotorMove -10000 endon
p.s. https://reprap.org/wiki/Pololu_stepper_driver_board https://reprap.org/wiki/NEMA_17_Stepper_motor https://reprap.org/wiki/Motor_control_loop
Hi gents, I have now a working Nema17 with a a4988 stepper. In general this will be more complicated than I expected because you cannot stop the motor. Once you send a command to the driver the ESP ist busy. It looks like the command is blocking. The only way to get it something similar to the current behaviour is to split the command in 100ms chunks....
I enhanced the motordriver in different ways. Also worked with the most course stepping of 1 to get the maximum time delay between two commands. Additionally made the numbers of remaining steps public, so you can control. Anyhow the required behavior makes it really tough to use it in Tasmota. I will now check, if I can use the PWM with a frequency "hook" to get more control during operation of the stepper driver.
Good news, friends. I have an updated shutter driver that works with the stepper motor. Anyhow this is really tricky stuff right now and I need some investigation if I broke down something else. The good news is we do not need the 10k code from the Stepper driver.
Happy to test. I’m currently using a NodeMCU to drive a stepper to operate my roller blinds. Using rules at the moment to deal with open and close. One thing that would be really useful would be if acceleration could be implemented so as to avoid the hard start when the stepper starts moving. Also - this is mainly for quality of life - would it be possible to get a settings page for MotorRPM and MotorSPR? The current build doesn’t seem to remember those settings after reboots (although that could be an issue with my build). I’ve set them pre-compile now to get around it.
Oh, You will love it :-) I had exactly the same in mind. Ramp is definitely a good idea, to avoid overload the motor. Regarding the RPM this is not as easy. I have a fixed 1000 steps/sec which is 5RPS when having stepping to 1. The ramp is 0.5sec; which is fast enough but also gives some room for accelerating the heavy load. I still work on the timing because as always it is NOT straight forward just to use just the stepper driver. This is unusable because it blocks TASMOTA for the complete operation.
Stefan - Thank you! As always, a better outcome than originally envisioned and much more useful for Tasmota users!
Stefan - That sounds great. Looking forward to testing. The wife will not be happy that I'm going to disassemble the kitchen blinds again......
Great job guys. I was wondering, why my code results in so much additional driversize as well. I was happy enough to get it work somehow and yes - the way I drive the motor is blocking Tasmota and not elegant at all. Unfortunately I've no time @ the moment to put effort into this - but I cross fingers for you! Greetings
@stefanbode I used to use these libraries DRV8825.h (for other projects). Maybe you can use this library? https://github.com/laurb9/StepperDriver
for information only.
I have added the stepper driver support for shutters/blinds. Please start testing with the following configuration:
Schuttermode 1: Failsafe Configuration. No INTERLOCK
D1: Relay1i: A4988 PIN: EN
D2: Relay2 : A4988 PIN: DIR
D3: PWM1: A4988 PIN: STP
D4: COUNTER1: Connect to D3#
A4988: MS1,MS2,MS3 to GROUND or not connected. 1 step == 1.8°
The Stepper will operate with 1000 steps/sec. Ramp up 0..1000 in 10 steps in 0.5 sek. Ramp down with 500 steps/sec.
Shutteropenduration
and shuttercloseduration
must be equal.
Ramp will take 0.25sec extra per move. You CAN define shuttermotordelay 0.25
, but not required.
You can start/stop/change direction at any time. Stepper will go with full speed near endpoint and then slow down to touch correct position. If shuttermotordelay is too high the stepper will overrun the endpoint. bad idea! I did several movements forward and backward. There was no single step missing. Position was always targeted 100%.
Thanks Stefan. I'll get testing tomorrow evening. Thanks for all your efforts.
At the end it was really fun to overcome the issue that after some time you did not exactly get back where you should be. Using the COUNTER and measure what you do with a ramp starting from 0Hz did the trick at the end. The PWM is much smarter because integrated in the core. All the drivers block the code. Very inconvenient, if you expect a runtime of 20sec or more. You do NOT need to include the stepper driver for compiling. I only use standard PWM, COUNTER, RELAY.
@stefanbode
On the issue of controlling and receiving feedback from stepper motors (Closed Loop Stepper Motor), there are three good projects with great potential. Receiving the information:
You may find it interesting.
Ustepper: https://ustepper.com/store/ustepper-boards/27-46-ustepper-s.html#/28-connector-dc_jack/31-stepper_motor-no_stepper_motor https://github.com/uStepper/uStepperS https://nl.aliexpress.com/item/4000418431198.html
Mechaduino: https://tropical-labs.com/shop/mechaduino-0-2-pcb/ https://github.com/jcchurch13 https://nl.aliexpress.com/item/32952527069.html
MKS-SERVO: https://github.com/makerbase-mks/MKS-SERVO42A https://nl.aliexpress.com/item/32917408111.html
Nano zero stepper: https://github.com/Misfittech/nano_stepper https://www.aliexpress.com/item/4000418442909.html
p.s. MKS Steptest PWM pulse generator: https://nl.aliexpress.com/item/32856654440.html https://www.amazon.com/Value-Home-Tools-generator-controller-amplifier-control-driven/dp/B07K4QX123/ref=sr_1_1?keywords=MKS+Steptest&qid=1575393584&sr=8-1
for information only.
@titomontes @TrDA-hab @RiRilot @Leuselator
This enhancement is now merged into the latest development branch. Are you able to test this new feature and report back your success or any issues encountered?
Yes, I will this evening UK time. I have compiled the latest dev branch and stuck it on a NodeMCU. I'll hook it up and report back.
Yes, I find this solution very interesting and will do many tests. I will report the result back. I will do it now.
I’m struggling to get the stepper to move more than a few steps in either direction. I think this is because I’m not very familiar with the shutter configuration. I can’t seem to get them in to shutter mode 2.
What I'm seeing is the stepper moving a few steps then stopping. The counter is continuing to count steps which says to me that the EN pin isn't staying high.
It doesn’t work for me either. The error is the same.
You have compiled you own version and enabled the shutter in the user config? Only then you have access to the shutter commands. The shutter mode 1 is default and wil be selected depending on interlock and pulsetimers. If you do nothing everything is fine. Please see the wiki. You have to execute setoption80 1 and reboot to enable the shutter. There is an actual wiki also for steppers already online
Yes, I forgot to execute setoption80 1. The error is the same.
23:38:52 CMD: SetOption80 23:38:52 MQT: stat/tasmota/RESULT = {"SetOption80":"ON"} 23:39:08 CMD: ShutterOpenDuration 23:39:08 MQT: stat/tasmota/RESULT = {"ShutterOpenDuration1":"500.0"} 23:39:20 CMD: ShutterCloseDuration 23:39:20 MQT: stat/tasmota/RESULT = {"ShutterCloseDuration1":"500.0"} 23:39:46 CMD: ShutterRelay1 1 23:39:46 SHT: Relay 1 is 1 23:39:46 SHT: Accuracy digits: 1 23:39:46 SHT: Shutter 0 (Relay:1): Init. Pos: 0 [0 %], Open Vel.: 100 Close Vel.: 100 , Max Way: 1000000, Opentime 500.0 [s], Closetime 500.0 [s], CoedffCalc: c0: 300, c1 500, c2: 700, c3: 900, c4: 1000, binmask 3, is inverted 0, shuttermode 1,motordelay 0 23:39:46 MQT: stat/tasmota/RESULT = {"ShutterRelay1":1}
Your open duration is really 500 sek? I have to check if my variables are all big enough. They should match. No worries
The rest looks ok. Please do not forget the counter 1 as described in the wiki
00:00:32 CMD: shutterrelay1 1 00:00:32 SHT: Relay 1 is 1 00:00:32 SHT: Accuracy digits: 1 00:00:32 SHT: Shutter 0 (Relay:1): Init. Pos: 18000 [90 %], Open Vel.: 100 Close Vel.: 100 , Max Way: 20000, Opentime 10.0 [s], Closetime 10.0 [s], CoedffCalc: c0: 300, c1 500, c2: 700, c3: 900, c4: 1000, binmask 3, is inverted 0, shuttermode 2,motordelay 0 00:00:32 RSL: stat/tasmota/RESULT = {"ShutterRelay1":1}
I have GPIOs defines as this:
On togging a relay motor moves a few steps then stops. Counter continues to count pulses. Motor stays stationary:
Stepper driver is definitely connected to the correct GPIOs
Let’s assume the wire ring to the a4988 is correct. Can you increase log level to 4 and send the log. Looks still ok from here. The current on the driver should be 0.3A. There is a small screw on the driver that you can change with a plastic !!! Screwdriver. 1a, 1b and 2a, 2b are correct? There should be a non infinite resistance on the 1 and the 2’s.
23:59:24 CMD: shuttermotordelay 0.25 23:59:24 SHT: Accuracy digits: 1 23:59:24 SHT: Shutter 0 (Relay:1): Init. Pos: 0 [0 %], Open Vel.: 100 Close Vel.: 100 , Max Way: 100000, Opentime 50.0 [s], Closetime 50.0 [s], CoedffCalc: c0: 300, c1 500, c2: 700, c3: 900, c4: 1000, binmask 3, is inverted 0, shuttermode 1,motordelay 5 23:59:24 MQT: stat/tasmota/RESULT = {"ShutterMotorDelay1":"0.25"} 23:59:34 CMD: ShutterRelay 23:59:34 MQT: stat/tasmota/RESULT = {"ShutterRelay1":1} 00:00:06 CMD: ShutterRelay1 1 00:00:06 SHT: Relay 1 is 1 00:00:06 SHT: Accuracy digits: 1 00:00:06 SHT: Shutter 0 (Relay:1): Init. Pos: 0 [0 %], Open Vel.: 100 Close Vel.: 100 , Max Way: 100000, Opentime 50.0 [s], Closetime 50.0 [s], CoedffCalc: c0: 300, c1 500, c2: 700, c3: 900, c4: 1000, binmask 3, is inverted 0, shuttermode 1,motordelay 5 00:00:06 MQT: stat/tasmota/RESULT = {"ShutterRelay1":1} 00:01:43 CMD: Shutteropenduration 500 00:01:43 SHT: Accuracy digits: 1 00:01:43 SHT: Shutter 0 (Relay:1): Init. Pos: 0 [0 %], Open Vel.: 100 Close Vel.: 1000 , Max Way: 1000000, Opentime 500.0 [s], Closetime 50.0 [s], CoedffCalc: c0: 300, c1 500, c2: 700, c3: 900, c4: 1000, binmask 3, is inverted 0, shuttermode 1,motordelay 5 00:01:43 MQT: stat/tasmota/RESULT = {"ShutterOpenDuration1":"500.0"} 00:01:59 CMD: ShutterCloseDuration 500 00:01:59 SHT: Accuracy digits: 1 00:01:59 SHT: Shutter 0 (Relay:1): Init. Pos: 0 [0 %], Open Vel.: 100 Close Vel.: 100 , Max Way: 1000000, Opentime 500.0 [s], Closetime 500.0 [s], CoedffCalc: c0: 300, c1 500, c2: 700, c3: 900, c4: 1000, binmask 3, is inverted 0, shuttermode 1,motordelay 5 00:01:59 MQT: stat/tasmota/RESULT = {"ShutterCloseDuration1":"500.0"}
Se d the log when sending shutteropen or Shutterclose with the 10sec. To make it simple first
00:06:39 CMD: shutteropen 10 00:06:39 SRC: WebConsole from 192.168.1.52 00:06:39 CMD: Group 0, Index 1, Command "SHUTTEROPEN", Data "10" 00:06:39 SHT: Position in: payload 10 (2), payload 100, index 1, source 7 00:06:39 SHT: lastsource 7:, realpos 0, target 1000000, payload 100 00:06:39 SRC: Shutter 00:06:39 SHT: Switched relay: 0 by Shutter 00:06:39 MQT: stat/tasmota/RESULT = {"POWER1":"OFF"} 00:06:39 MQT: stat/tasmota/POWER1 = OFF 00:06:39 SHT: Wait for Motorstop 500 00:06:39 SRC: Shutter 00:06:39 SHT: Switched relay: 0 by Shutter 00:06:39 MQT: stat/tasmota/RESULT = {"POWER2":"OFF"} 00:06:39 MQT: stat/tasmota/POWER2 = OFF 00:06:39 SRC: Shutter 00:06:39 SHT: Switched relay: 1 by Shutter 00:06:39 MQT: stat/tasmota/RESULT = {"POWER1":"ON"} 00:06:39 MQT: stat/tasmota/POWER1 = ON 00:06:39 MQT: stat/tasmota/RESULT = {"ShutterOpen1":100} 00:06:39 SHT: Shutter 0: Real Pos: 800, Target 1000000, source: Shutter, start-pos: 0 %, direction: 1, rtcshutter: 0.6 [s] 00:06:39 SRC: PulseTimer 00:06:39 SHT: Switched relay: 1 by PulseTime 00:06:39 MQT: stat/tasmota/RESULT = {"POWER1":"OFF"} 00:06:39 MQT: stat/tasmota/POWER1 = OFF 00:06:40 WIF: Checking connection... 00:06:40 WIF: Connected 00:06:40 SHT: Shutter 0: Real Pos: 2800, Target 1000000, source: PulseTimer, start-pos: 0 %, direction: 1, rtcshutter: 1.6 [s] 00:06:41 SHT: Shutter 0: Real Pos: 4900, Target 1000000, source: PulseTimer, start-pos: 0 %, direction: 1, rtcshutter: 2.7 [s] 00:06:42 SHT: Shutter 0: Real Pos: 6900, Target 1000000, source: PulseTimer, start-pos: 0 %, direction: 1, rtcshutter: 3.7 [s] 00:06:43 SHT: Shutter 0: Real Pos: 8900, Target 1000000, source: PulseTimer, start-pos: 0 %, direction: 1, rtcshutter: 4.7 [s] 00:06:44 SHT: Shutter 0: Real Pos: 10900, Target 1000000, source: PulseTimer, start-pos: 0 %, direction: 1, rtcshutter: 5.7 [s] 00:06:45 SHT: Shutter 0: Real Pos: 12900, Target 1000000, source: PulseTimer, start-pos: 0 %, direction: 1, rtcshutter: 6.7 [s] 00:06:46 SHT: Shutter 0: Real Pos: 14900, Target 1000000, source: PulseTimer, start-pos: 0 %, direction: 1, rtcshutter: 7.7 [s] 00:06:47 SHT: Shutter 0: Real Pos: 16800, Target 1000000, source: PulseTimer, start-pos: 0 %, direction: 1, rtcshutter: 8.6 [s] 00:06:48 SHT: Shutter 0: Real Pos: 18800, Target 1000000, source: PulseTimer, start-pos: 0 %, direction: 1, rtcshutter: 9.6 [s] 00:06:49 SHT: Shutter 0: Real Pos: 20800, Target 1000000, source: PulseTimer, start-pos: 0 %, direction: 1, rtcshutter: 10.6 [s] 00:06:50 SHT: Shutter 0: Real Pos: 22900, Target 1000000, source: PulseTimer, start-pos: 0 %, direction: 1, rtcshutter: 11.7 [s] 00:06:51 SHT: Shutter 0: Real Pos: 24900, Target 1000000, source: PulseTimer, start-pos: 0 %, direction: 1, rtcshutter: 12.7 [s] 00:06:52 SHT: Shutter 0: Real Pos: 26800, Target 1000000, source: PulseTimer, start-pos: 0 %, direction: 1, rtcshutter: 13.6 [s] 00:06:53 SHT: Shutter 0: Real Pos: 28900, Target 1000000, source: PulseTimer, start-pos: 0 %, direction: 1, rtcshutter: 14.7 [s] 00:06:54 SHT: Shutter 0: Real Pos: 30900, Target 1000000, source: PulseTimer, start-pos: 0 %, direction: 1, rtcshutter: 15.7 [s] 00:06:55 SHT: Shutter 0: Real Pos: 32800, Target 1000000, source: PulseTimer, start-pos: 0 %, direction: 1, rtcshutter: 16.6 [s] 00:06:56 SHT: Shutter 0: Real Pos: 34800, Target 1000000, source: PulseTimer, start-pos: 0 %, direction: 1, rtcshutter: 17.6 [s] 00:06:57 SHT: Shutter 0: Real Pos: 36900, Target 1000000, source: PulseTimer, start-pos: 0 %, direction: 1, rtcshutter: 18.7 [s] 00:06:58 SHT: Shutter 0: Real Pos: 38800, Target 1000000, source: PulseTimer, start-pos: 0 %, direction: 1, rtcshutter: 19.6 [s] 00:06:59 SHT: Shutter 0: Real Pos: 40800, Target 1000000, source: PulseTimer, start-pos: 0 %, direction: 1, rtcshutter: 20.6 [s] 00:07:00 WIF: Checking connection... 00:07:00 WIF: Connected 00:07:00 SHT: Shutter 0: Real Pos: 42800, Target 1000000, source: PulseTimer, start-pos: 0 %, direction: 1, rtcshutter: 21.6 [s] 00:07:01 SHT: Shutter 0: Real Pos: 44800, Target 1000000, source: PulseTimer, start-pos: 0 %, direction: 1, rtcshutter: 22.6 [s] 00:07:02 SHT: Shutter 0: Real Pos: 46800, Target 1000000, source: PulseTimer, start-pos: 0 %, direction: 1, rtcshutter: 23.6 [s] 00:07:03 SHT: Shutter 0: Real Pos: 48800, Target 1000000, source: PulseTimer, start-pos: 0 %, direction: 1, rtcshutter: 24.6 [s] 00:07:04 SHT: Shutter 0: Real Pos: 50800, Target 1000000, source: PulseTimer, start-pos: 0 %, direction: 1, rtcshutter: 25.6 [s]
......................
Driver is fine. I can controll it with the normal A4988 code.
22:07:21 CMD: shutterclose 22:07:21 SHT: Start shutter in direction -1 22:07:21 RSL: stat/tasmota/RESULT = {"POWER2":"ON"} 22:07:21 RSL: stat/tasmota/POWER2 = ON 22:07:21 RSL: stat/tasmota/RESULT = {"ShutterClose1":0} 22:07:21 RSL: stat/tasmota/RESULT = {"POWER2":"OFF"} 22:07:21 RSL: stat/tasmota/POWER2 = OFF 22:07:21 SHT: Shutter 0: Real Pos: 19000, Target 0, source: PulseTimer, start-pos: 100 %, direction: -1, rtcshutter: 0.5 [s] 22:07:22 SHT: Shutter 0: Real Pos: 17000, Target 0, source: PulseTimer, start-pos: 100 %, direction: -1, rtcshutter: 1.5 [s] 22:07:23 SHT: Shutter 0: Real Pos: 15000, Target 0, source: PulseTimer, start-pos: 100 %, direction: -1, rtcshutter: 2.5 [s] 22:07:24 SHT: Shutter 0: Real Pos: 13000, Target 0, source: PulseTimer, start-pos: 100 %, direction: -1, rtcshutter: 3.5 [s] 22:07:25 SHT: Shutter 0: Real Pos: 11000, Target 0, source: PulseTimer, start-pos: 100 %, direction: -1, rtcshutter: 4.5 [s] 22:07:26 SHT: Shutter 0: Real Pos: 9000, Target 0, source: PulseTimer, start-pos: 100 %, direction: -1, rtcshutter: 5.5 [s] 22:07:27 SHT: Shutter 0: Real Pos: 7000, Target 0, source: PulseTimer, start-pos: 100 %, direction: -1, rtcshutter: 6.5 [s] 22:07:28 SHT: Shutter 0: Real Pos: 5000, Target 0, source: PulseTimer, start-pos: 100 %, direction: -1, rtcshutter: 7.5 [s] 22:07:29 SHT: Shutter 0: Real Pos: 3000, Target 0, source: PulseTimer, start-pos: 100 %, direction: -1, rtcshutter: 8.5 [s] 22:07:30 SHT: Shutter 0: Real Pos: 1000, Target 0, source: PulseTimer, start-pos: 100 %, direction: -1, rtcshutter: 9.5 [s] 22:07:31 RSL: stat/tasmota/RESULT = {"POWER2":"ON"} 22:07:31 RSL: stat/tasmota/POWER2 = ON 22:07:31 RSL: stat/tasmota/SHUTTER1 = 0 22:07:31 RSL: tele/tasmota/RESULT = {"Shutter1":{"Position":0,"direction":0}} 22:07:31 RSL: stat/tasmota/RESULT = {"POWER2":"OFF"} 22:07:31 RSL: stat/tasmota/POWER2 = OFF 22:07:40 CMD: shutteropen 22:07:40 SHT: Start shutter in direction 1 22:07:40 RSL: stat/tasmota/RESULT = {"POWER1":"ON"} 22:07:40 RSL: stat/tasmota/POWER1 = ON 22:07:40 RSL: stat/tasmota/RESULT = {"ShutterOpen1":100} 22:07:40 SHT: Shutter 0: Real Pos: 400, Target 20000, source: Shutter, start-pos: 0 %, direction: 1, rtcshutter: 0.2 [s] 22:07:40 RSL: stat/tasmota/RESULT = {"POWER1":"OFF"} 22:07:40 RSL: stat/tasmota/POWER1 = OFF 22:07:41 SHT: Shutter 0: Real Pos: 2400, Target 20000, source: PulseTimer, start-pos: 0 %, direction: 1, rtcshutter: 1.2 [s] 22:07:42 SHT: Shutter 0: Real Pos: 4400, Target 20000, source: PulseTimer, start-pos: 0 %, direction: 1, rtcshutter: 2.2 [s] 22:07:43 SHT: Shutter 0: Real Pos: 6400, Target 20000, source: PulseTimer, start-pos: 0 %, direction: 1, rtcshutter: 3.2 [s] 22:07:44 SHT: Shutter 0: Real Pos: 8400, Target 20000, source: PulseTimer, start-pos: 0 %, direction: 1, rtcshutter: 4.2 [s] 22:07:45 SHT: Shutter 0: Real Pos: 10400, Target 20000, source: PulseTimer, start-pos: 0 %, direction: 1, rtcshutter: 5.2 [s] 22:07:46 SHT: Shutter 0: Real Pos: 12400, Target 20000, source: PulseTimer, start-pos: 0 %, direction: 1, rtcshutter: 6.2 [s] 22:07:47 SHT: Shutter 0: Real Pos: 14400, Target 20000, source: PulseTimer, start-pos: 0 %, direction: 1, rtcshutter: 7.2 [s] 22:07:48 SHT: Shutter 0: Real Pos: 16400, Target 20000, source: PulseTimer, start-pos: 0 %, direction: 1, rtcshutter: 8.2 [s] 22:07:49 SHT: Shutter 0: Real Pos: 18300, Target 20000, source: PulseTimer, start-pos: 0 %, direction: 1, rtcshutter: 9.1 [s] 22:07:50 RSL: stat/tasmota/RESULT = {"POWER1":"ON"} 22:07:50 RSL: stat/tasmota/POWER1 = ON 22:07:50 RSL: stat/tasmota/SHUTTER1 = 100 22:07:50 RSL: tele/tasmota/RESULT = {"Shutter1":{"Position":100,"direction":0}} 22:07:50 RSL: stat/tasmota/RESULT = {"POWER1":"OFF"} 22:07:50 RSL: stat/tasmota/POWER1 = OFF
Shuttermode 1 does mean Relay1 enable or disable the motor. Relay2 is for the direction. The Pwm Pulses the stepper.
How can I install Shuttermode 2 ???
00:10:15 CMD: Shuttermode 2 00:10:15 SRC: WebConsole from 192.168.1.52 00:10:15 CMD: Group 0, Index 1, Command "SHUTTERMODE", Data "2" 00:10:15 MQT: stat/tasmota/RESULT = {"Command":"Unknown"}
Pulsetime 0 on both relay and no interlock in the shutterrelays.
The modes get selected by the definition of interlock and pulsetime. Please take a look again in the wiki for the circuit safe configuration
Backlog PulseTime1 0; PulseTime2 0 Backlog Interlock 1,2; Interlock OFF
correctly ???
Interlock 1,2 is also not needed. Just in case put interlock 3,4. So sure relays are not in
I have set those and now it's working. That isn't shuttermode 2 according to the docs. That's what threw me.
Docs say:
Stepper motors (ShutterMode: 2) - First relay: OFF/DOWN PULSE, Second relay: OFF/UP PULSE Backlog PulseTime1 2; PulseTime2 2 Backlog Interlock 1,2; Interlock ON (Interlocked relay pair)
I did:
backlog pulsetime1 0; pulsetime 2 0 backlog interlock 1,2; Interlock OFF
And now it's working. Looks good to me. Lovely smooth movement and nice accelleration.
Uups. Really?
Yup
Oh yes long long day for me. It is mode 1. My fault. Any progress?
@stefanbode
Is it possible to set up the shutter driver to work with the Stepper Motor driver? The driver uses either a A4988 or a DRV8825. My thought is that whereas your driver expects two relay components, the stepper uses rotation direction and on/off which could correspond to the two relays. The stepping increment could be "static" and set via MotorMIS. Due to the way stepper motors shudder, power enabled would need to be managed as well. Perhaps it would be the second relay instead of motor on/off and instead the setup would drive motor on/off always on (e.g., a third relay always powered on)?
I'm piggybacking on @TrDA-hab's (TrDA on Discord) personal project he's built to control his roller shutter. I just wanted to put the two of you in touch since you're not on Discord. I think this is an opportunity to provide a working solution using both your driver and the stepper motor driver.
Cheers!
Mike