fix high-power bursts during deceleration #64
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The problem was most visible when engraving small shapes at low power.
I haven't actually laser-tested this yet but used an arduino to monitor the PWM output of the firmware. I have triggered an oscilloscope on the large pulse width and was able to reproduce the glitches. Now they are gone and the duty stays below 5%.
The problem was already discussed and narrowed down by "jondale" and others in the google groups: https://groups.google.com/forum/#!topic/lasersaur/1i36ZNAvRFo (I'm not posting there because I don't like the idea of paying or asking for permission to submit a bugfix. Please consider opening the group up for everyone.)
An alternative fix would have been to just make the integer signed. But I'm not sure if the full range is used or not, and whether the other uint32_t in this file should be converted to signed, too.