| Electronics > Projects, Designs, and Technical Stuff |
| Generate RC servo PWM signal from CNC controller motor PWM signal |
| (1/3) > >> |
| CambridgeMart:
I'm playing around with a CNC3018 Pro engraver and find the spindle motor supplied to be very limiting; I'm replacing the motor with a brushless motor with a much higher speed and torque rating and an RC model aircraft electronic speed controller. The PWM output from the CNC control board is 1kHz variable from ~10% to 100% and the ESC needs a standard RC servo signal PWM signal of 1.5ms to 2.5ms at 166Hz. I've tried a couple of approaches, firstly by low pass filtering the signal then driving a 555 in PWM configuation, but it's difficult to get the range of output pulse lengths I need, mainly due to trying to run opamps in the filter from a single +5V supply. My next approach was to divide the PWM signal by six then use the resulting clock to gate the original PWM signal then stretch the pulses to a more useful length using an RC network and a Schmitt NAND gate. This circuit sort of works, but I can't get the pulses long enough reliably and the design is using 4 CMOS logic devices. Anyone have a better idea than mine or done the same thing I'm trying to do? |
| langwadt:
guessing it uses GRBL, so you can change that prescaler and max/min pwm and recompile to get what you want https://github.com/gnea/grbl/ |
| LukeW:
RC filter the PWM signal, and generate a triangle wave, and feed both the triangle wave and variable DC level into a comparator? Should require 3 opamps and some passives. |
| CambridgeMart:
LukeW - that's exactly what's sketched on the piece of paper on my desk right now! |
| Ian.M:
If the CNC controller is to remain unmodified, it sounds like a job for a MCU with input capture to measure the input PWM pulse width and output compare to generate a jitter-free servo pulse, with the main loop running software mapping between the input and output pulse widths. Any Microchip PIC with two CCP or ECCP modules could do it fairly easily, and I suspect that many ATmega AVRs could also handle it. Another option - if there's open source firmware for the ESC you are planning to use, you could probably compile a version to accept the 1KHz PWM control signal directly. However if you don't have the embedded development background and a suitable toolchain you are already familiar with, sticking to the analog OPAMP based approach may be preferable. The analog solution is helped by the fact you don't need a great deal of accuracy - a few percent error in the spindle speed isn't an issue as long as it remains reasonably stable once set. |
| Navigation |
| Message Index |
| Next page |