P098 PWM Motor LimitA and Limit B
Moderators: grovkillen, Stuntteam, TD-er
P098 PWM Motor LimitA and Limit B
Good afternoon. I'm making a roller blind controller using EasyEsp.
I'm using the P098 PWM Motor plugin. The motor is started with the pwmmotorhome and pwmmotorend commands.
Sensors LimitA and LimitB are configured.
When the sensors are triggered, the LimitA and LimitB events are not generated, although the motor stops.
Events are created only if I try to start a motor that is already in the extreme position.
What am I doing wrong?
I'm using the P098 PWM Motor plugin. The motor is started with the pwmmotorhome and pwmmotorend commands.
Sensors LimitA and LimitB are configured.
When the sensors are triggered, the LimitA and LimitB events are not generated, although the motor stops.
Events are created only if I try to start a motor that is already in the extreme position.
What am I doing wrong?
Re: P098 PWM Motor LimitA and Limit B
Is the Rules option checked on the Tools/Advanced page? As that's a check before events will be generated.
/Ton (PayPal.me)
Re: P098 PWM Motor LimitA and Limit B
Yes, the Rules option is enabled.
Re: P098 PWM Motor LimitA and Limit B
How long are the cables?
Maybe you can add some capacitor (e.g. 100 nF) over the GPIO pin and GND as close as possible to the GPIO pin.
Problem is that when a switch connects, it doesn't connect at once but will bounce a little.
And maybe for this use case, you might better use a bit stronger pull-up resistors and go for 1k instead of 10k.
Maybe you can add some capacitor (e.g. 100 nF) over the GPIO pin and GND as close as possible to the GPIO pin.
Problem is that when a switch connects, it doesn't connect at once but will bounce a little.
And maybe for this use case, you might better use a bit stronger pull-up resistors and go for 1k instead of 10k.
Re: P098 PWM Motor LimitA and Limit B
The cable is no more than 10 cm. I will try to reduce the value of the pull-up resistors to 1 kOhm. And yet the sensors are triggered, the motor stops, the event simply is not created.
Re: P098 PWM Motor LimitA and Limit B
Unfortunately nothing worked 
The scheme is the same as before. Resistors reduced to 1Kohm.
Here are the plugin settings: When the sensors are triggered, the motor stops, but the "LimitA" and "LimitB" events are not generated.
If you turn off the "LimitA inverted" and "LimitB inverted" checkbox, then events are created, but after they are triggered, LimitA and LimitB remain at "1" forever and do not allow the motor to start.

The scheme is the same as before. Resistors reduced to 1Kohm.
Here are the plugin settings: When the sensors are triggered, the motor stops, but the "LimitA" and "LimitB" events are not generated.
If you turn off the "LimitA inverted" and "LimitB inverted" checkbox, then events are created, but after they are triggered, LimitA and LimitB remain at "1" forever and do not allow the motor to start.
Re: P098 PWM Motor LimitA and Limit B
OK, have to check the code to make sure it isn't a bug, as I don't see right now what you're doing wrong here.
Re: P098 PWM Motor LimitA and Limit B
Can you get logging from the serial port of the unit, or have you disabled that? (You are using GPIO 1 and 3, on what seems like an ESP32 Classic, (you haven't mentioned the exact ESP model in use, AFAICS), and that are usually the serial log GPIO pins).
The events (<TaskName>#limitA, <TaskName>#limitB, <TaskName>#positionReached or <TaskName>#encoderTimeout) should be visible in the log, and the serial log is the most reliable way of seeing that, though the info should also be visible in the web-logging via Tools/Log.
The events (<TaskName>#limitA, <TaskName>#limitB, <TaskName>#positionReached or <TaskName>#encoderTimeout) should be visible in the log, and the serial log is the most reliable way of seeing that, though the info should also be visible in the web-logging via Tools/Log.
Last edited by Ath on 07 Aug 2024, 21:14, edited 1 time in total.
/Ton (PayPal.me)
Re: P098 PWM Motor LimitA and Limit B
Also can you try not using PWM, but just sending out a digital pulse (thus not set the mode to PWM) ?
Re: P098 PWM Motor LimitA and Limit B
I'm using ESP32-C3 mini.
And this is what is visible in the terminal.
The same thing happens in NoPWM mode.Re: P098 PWM Motor LimitA and Limit B
I do see the events in the log you posted, so I don't really know what the problem is.
Or do you also have a switch task assigned to those same pins?
Or do you also have a switch task assigned to those same pins?
Re: P098 PWM Motor LimitA and Limit B
Can you push one of the limitA/limitB switches before the actual end is reached? To see if that actually stops the motor.
/Ton (PayPal.me)
Re: P098 PWM Motor LimitA and Limit B
The "LimitA" and "LimitB" events are generated only once when saving the plugin settings. In the future, when starting the motor with buttons and stopping it with sensors, connected to the LimitA and LimitB pins, no events are created.
Re: P098 PWM Motor LimitA and Limit B
The "LimitA" and "LimitB" events are generated only once when saving the plugin settings. In the future, when starting the motor with buttons and stopping it with sensors, connected to the LimitA and LimitB pins, no events are created. When the sensors are triggered, the motor stops, but no events are created.
Re: P098 PWM Motor LimitA and Limit B
The 4 events generated in row is the initial Read that is performed after the TaskInit event, that is generated for nearly all plugins.
/Ton (PayPal.me)
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 2 guests