pwm for laser control

Nice way of producting that 5% pwm without delaying the loop.
Can I switch from anologWrite to digitalWrite without repeating pinMode inside the loop?

Thank's a lot, looks much brighter now and I can start testing (not so easy to modify anything on the final setup).

kmin:
Boardburner2,

No, I'm running on desktop and the delay is not related to the laser driver.
Why you think combining the two signals is not likely to work on the laser? Tha laser modulation input would receive either low or pwm.

Im at a loss to understand where the latency is and im wondering if its a startup 'feature' of the driver (i mean psu/modulator).
And gate is easy to implement and test though.

Boardburner2:
Im at a loss to understand where the latency is and im wondering if its a startup 'feature' of the driver (i mean psu/modulator).
And gate is easy to implement and test though.

Are you using Mach3? If yes, can you adjust the spindle speed without latency?
For example M3 / M5 for on-off the spindle have even more latency... Known issue though.

kmin:
Are you using Mach3? If yes, can you adjust the spindle speed without latency?

No , difficult to tell though as the spindle itself takes time to respond.

Only way i could think of solving that was to put an adjustable digital delay in the xyz from the mach3 to the motor controller card.

Boardburner2:
No , difficult to tell though as the spindle itself takes time to respond.

Only way i could think of solving that was to put an adjustable digital delay in the xyz from the mach3 to the motor controller card.

I was thinking that also, but according to some peolple who tried to play with this issue, latency is not even linear. It would be quite complicated to delay all the outputs from Mach anyway.
I'm quite positive with the AND gate solution.
Someone with coding skills could take everything out from Mach3 to microcontroller and build a pulse-distance laser control to compensate also accelerations and decelerations with laser intensity. Wouldn't be even so difficult, but all arduino-cnc-people are using grbl .

kmin:
I was thinking that also, but according to some peolple who tried to play with this issue, latency is not even linear. It would be quite complicated to delay all the outputs from Mach anyway.

This may sound stupid but has anyone tried inverting the pwm signal to the laser with logic?

kmin:
I was thinking that also, but according to some peolple who tried to play with this issue, latency is not even linear. It would be quite complicated to delay all the outputs from Mach anyway.

I’m not so sure,should be possible with traditional hardware rather than micro controller one pot controls all should not be difficult to implement.
But then i am used to timing logic , in my day we had to learn electronics before we could actually build the micro controllers. :slight_smile:
If i can find someone to push my bath chair over to the speaking bone i might have a go :o

Boardburner2:
I'm not so sure,should be possible with traditional hardware rather than micro controller one pot controls all should not be difficult to implement.
But then i am used to timing logic , in my day we had to learn electronics before we could actually build the micro controllers. :slight_smile:
If i can find someone to push my bath chair over to the speaking bone i might have a go :o

I agree Boardburner2,
it's not difficult for somebody who has the skills. Difficult to me, don't have electronics backround, neither coding.
There are even plenty of solutions, some are good, some are better. Mach3 is a genious old completely outdated software, which was built to drive stepper motors without any external hardware. It's a software 25kHz pulse engine with no buffers, everything is realtime. Immagine that inside Ms Windows :o You better not to even open Notepad while it's driving. Holding a breath and praying is also helping :slight_smile:

One could
-build a post processor for gcode to adjust the timings in the code before it's going to Mach.
-buy a nice motion controller like Pokeys57cnc with big buffer and programmable logil control
-take all the pins out from Mach to the micro controller and build a pulse distance control.
-make a hardware solution like you said.
-go to another cnc software / control like grbl
-wait for a while until Mach4 is stable
etc...
But I think, some buffered solution is the way to go. You can immagine routing an expensive peece of material for 5 hours and during the last passes Windows is delaying few pulses and your router is destroying the whole peece in front of your eyes.