ESP32Stepper icon indicating copy to clipboard operation
ESP32Stepper copied to clipboard

Adding speed controls

Open pyr0ball opened this issue 6 years ago • 7 comments

Currently there's no method for controlling the speed of the motor in the parameters. I was able to change the delay integer for the time between pulses, but a variable at the least for this would be useful.

When using the current default delay and stepping behavior, the motor vibrates violently. There should be a way to port over some of the methods used in Marlin firmware or other 3D printer software to have smoother motion. as well as acceleration profiles to allow for a smooth speedup/slowdown function.

pyr0ball avatar Jul 13 '18 01:07 pyr0ball

I've got some new code coming in soon. For now I'm using the microstepping pin settings to control the speed as I'm still ignorant of how to do it properly, but this method seems to work pretty well.

I also am unfamiliar with Domoticz API, so I'm not sure if my concept would be compatible or not, but I figured how I would implement it would be to add a parameter to the url request in the form of a human readable speed:

http://{ip_address}/stepper/percent?50&speed=high http://{ip_address}/stepper/percent?50&speed=medium http://{ip_address}/stepper/percent?50&speed=low

and adjust the microstep pins accordingly.

What do you think @SpoturDeal ?

Edit2: I just realized an issue with that method. The microstepping change will require the max steps integer to be multiplied or it'll stop partway to the down position. Gonna have to go look at a few other libraries to see how to do this right.

Edit: I've also got a carrier board designed, and I'm just doing some final touches before I get it sent out for fabrication. Should allow the user to have a standard 12v input from a wall wart. Does all the voltage conversions onboard.

image

image

pyr0ball avatar Aug 07 '18 18:08 pyr0ball

I prefer to use the DOIT ESP32 DEVKIT V1 it is a cheaper version and my experience is that it has less issues. Also the price is a lot less so for more people affordable. Most important is that the number of pins is greater.

At the moment I am working on a few more projects. Where I prefer to use the same boards all over.

I like your idea for the board design. We might exchange ideas to use one board for several different projects.

One of my project includes 5 MOSFETS (with cooling) and adding board connector for SDA, SCL, 3V3 and ground.

SpoturDeal avatar Aug 16 '18 07:08 SpoturDeal

Sure, I'd be happy to help put something together. I'll take a look at the module you are getting and grab one for myself to play with

pyr0ball avatar Aug 16 '18 07:08 pyr0ball

I'm actually finding it hard to locate that specific version in my country (at a reasonable price). Any chance you could link me?

pyr0ball avatar Aug 16 '18 09:08 pyr0ball

This is the link to the board I use link to DOIT ESP DEVKIT v1 at Banggood.

Today is US$ 6.79 EUR 6.00 with free delivery.

In which country are you located. I am in the Netherlands

SpoturDeal avatar Aug 16 '18 13:08 SpoturDeal

USA over here.

I'll grab one of those right now so we can work on the same thing. Based on the pictures, it looks identical, but there could be some minor differences.

pyr0ball avatar Aug 16 '18 16:08 pyr0ball

Today restructured the code. Easier to maintain and understand. All functions are now alphabetical.

SpoturDeal avatar Aug 19 '18 15:08 SpoturDeal