# 1-10Hz frequency count translated to PWM for stepper motor RPM

I would like to control the speed of a stepper motor based on an input signal that consists of short 12V pulses at a varying frequency of 1-10Hz. I know this is an easy task with a microcontroller but I'm new to circuit design and I'm curious if there is an elegant way to do this in a more analog way without code.

The circuit is enabled by the first 12V pulse and then starts counting elapsed time before the second pulse, when the second pulse is received the stepper is run at a certain corresponding number of steps per second then repeats, third pulse is received, motor speed is adjusted to the new target and then waits for a fourth pulse, repeat, repeat, repeat until a pulse is no longer present after say a 1-2 second timeout the motor stops and the circuit is deactivated.

The frequency at which these 12V pulses are received varies constantly between 1-10Hz and I would like the motor's RPM to track the pulse frequency. Ideally this relationship would be adjustable to initially calibrate the accuracy within a small window with a pot.

Rather than design a circuit for me I'm just hoping to get a little creative direction to focus my research efforts, again I know this could easily be done with a couple lines of code and a micro but if I can do this with like a simple counter IC and a 555 to drive the stepper I'd really like to explore that. Is a micro necessary for what I want to do? I guess I'm essentially multiplying a PWM signal by many factors.

• So, elapsed time is measured and then what do you do with that numerically? and what should it become as an output waveform? – Andy aka Nov 30 '20 at 16:09
• It would be essentially just a linear multiplication of the PWM signal in order to drive a stepper motor a certain number of steps per second. For instance, 2hz measured frequency results in 20 steps per second, 5 hz frequency, 50 steps per second, 8 hz, 80 steps per second and so on. I've looked into some various ways of driving steppers being it a resonating analog circuit or an H bridge, TMCxxxx stepper driver, etc. – Max Maruszewski Nov 30 '20 at 16:57
• You aren't dealing with PWM if the pulse rate changes. PWM changes the width of the pulses, not the frequency as your signal seems to. – JRE Nov 30 '20 at 17:19
• facepalm Please excuse me. Indeed you are correct, the frequency changes. The length of the pulse on the input signal is irrelevant for this application, I would assume that triggering on the rise is sufficient. – Max Maruszewski Nov 30 '20 at 17:28