A few years ago, I designed a multi-axis step motor controller using one AT89LP4051 MCU as a master pulse generator, and an identical slave MCU for each axis being controlled in the system; using Bresenham's interpolation algorithm. The board is working like a real beauty, but I'd like to improve it by increasing the frequency resolution generated by the master MCU. Currently, the master MCU is generating the pulse train by consulting a small table in its program that allows it to generate 32 different speeds (frequencies).
My idea is to increase that speed (frequency) resolution to 256 speed levels by using the PWM capability already included in the marvelous AT89LP4051. Never mind for now how I plan to develop the firmware needed for this task. Suffice it to say that I already have a clear picture on how to do that.
The problem I'd like to solve is how to convert a PWM signal to a frequency one, considering the following restraints:
I've already done a little research on this subject, and I've arrived to conclusion that the best way to achieve what I want is to first convert the signal to a proportional voltage, and then convert that voltage to a frequency.
Converting a 5V PWM signal to a linear voltage seems easy enough. A 2nd order low pass filter should do the trick:
My itch is with how to properly convert that linear output voltage to a frequency signal as accurately as possible. I've done some googling on the subject and, among many other things, I found these three candidates:
The three circuits are so different from one another that I'm at a loss on how to decide which one would be best for my application.
Any input on this matter would be thoroughly appreciated.
My idea is to increase that speed (frequency) resolution to 256 speed levels by using the PWM capability already included in the marvelous AT89LP4051. Never mind for now how I plan to develop the firmware needed for this task. Suffice it to say that I already have a clear picture on how to do that.
The problem I'd like to solve is how to convert a PWM signal to a frequency one, considering the following restraints:
- Power source is a single power supply, which is an ordinary 12VDC regulated wall wart.
- An LM7805 regulator is already present in the circuit, so a 5V supply is already available.
- Generated square wave must be 0-5VDC, and should be in the range of 0 to 60kHz, in 256 equally divided steps.
- Duty cycle should be as close to 50% as possible.
I've already done a little research on this subject, and I've arrived to conclusion that the best way to achieve what I want is to first convert the signal to a proportional voltage, and then convert that voltage to a frequency.
Converting a 5V PWM signal to a linear voltage seems easy enough. A 2nd order low pass filter should do the trick:
My itch is with how to properly convert that linear output voltage to a frequency signal as accurately as possible. I've done some googling on the subject and, among many other things, I found these three candidates:
The three circuits are so different from one another that I'm at a loss on how to decide which one would be best for my application.
Any input on this matter would be thoroughly appreciated.