PyCNC icon indicating copy to clipboard operation
PyCNC copied to clipboard

How to sync motion with I2C PWM for Laser Cutter/Engraver

Open eirasys opened this issue 8 years ago • 5 comments

Hello Nikolay Have a PCA9685 16ch 12bit PWM controlled by I2C bus. I'm using it to control a laser cutter/engraver with higher PWM resolution. Is it possible to sync DMA motion with I2C messages, and how fast can it go? I see that you are using I2C to measure temperature with an ADC, but this speed will surely be quite slower than what I need. Thanks, João

eirasys avatar Oct 26 '17 12:10 eirasys

Planing to add a new axis to hal.move(generator). This axis may have pulse information for the laser to cut or engrave anything. I2C may result in inacurate sync with motors motion.

eirasys avatar Nov 01 '17 18:11 eirasys

Hello, Theoretically DMA can write data to I2C bus, and since DMA switching take the same number of transferred bytes with the same frequency, it should be able to sync with motors. Though it is not quite simple to implement: you need to increase laser power smoothly while motors accelerates... You second solution about additional axis is much better. Just create a proper PWM generator for this special axis in pulses.py instead of motor pulses. It should work fine.

Nikolay-Kha avatar Nov 03 '17 12:11 Nikolay-Kha

and one more thing - you can achieve even better resolution then 12 bit using this technique, the only one thing you will be limited with PWM frequency. The bigger resolution, the lower PWM frequency will be.

Nikolay-Kha avatar Nov 03 '17 12:11 Nikolay-Kha

Fully agree! There is a lot of work to be done, different PWMs defining laser power levels and photo rastering conversion to PWM for engraving purposes.

eirasys avatar Nov 30 '17 12:11 eirasys

For the conversion see github.com/LaserWeb/LaserWeb4-Binaries/releases/latest (;

My old project...

On Nov 30, 2017 2:23 PM, "EiraSYS" [email protected] wrote:

Fully agree! There is a lot of work to be done, different PWMs defining laser power levels and photo rastering conversion to PWM for engraving purposes.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Nikolay-Kha/PyCNC/issues/13#issuecomment-348173522, or mute the thread https://github.com/notifications/unsubscribe-auth/Ad_gtwttrDQSrxy8fn6HFBmcrZpHlqhgks5s7p5BgaJpZM4QHeAq .

petervanderwalt avatar Nov 30 '17 18:11 petervanderwalt