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.

  • \$\begingroup\$ So, elapsed time is measured and then what do you do with that numerically? and what should it become as an output waveform? \$\endgroup\$ – Andy aka Nov 30 '20 at 16:09
  • \$\begingroup\$ 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. \$\endgroup\$ – Max Maruszewski Nov 30 '20 at 16:57
  • \$\begingroup\$ 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. \$\endgroup\$ – JRE Nov 30 '20 at 17:19
  • \$\begingroup\$ 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. \$\endgroup\$ – Max Maruszewski Nov 30 '20 at 17:28

You could try using a PLL (Phase-locked loop). The idea is to put a digital divider equal to the desired multiplication factor in the feedback loop. In your example, it would be a divide by 10.

You could generate a higher frequency to allow more granularity in the division, for example, generate some digitally variable number like 100x the input frequency, and divide that by a fixed 10 for the output. Then you could select 99/10 = 9.9 times the input frequency.

It won't respond as quickly as a microcontroller circuit that could precisely measure the time between input edges and generate a resulting output frequency, and it could overshoot or be excessively sluggish responding to input changes, depending on how you design the filter.

An example PLL is the CD4046 (1970s technology).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.