-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Movement speed behaves erratically and is incorrect #46
Comments
Thanks for digging into this, I hope we can find the culprit. I have to admit that I can't think of a reason for this issue. |
This is what happens now - the simplecode interpreter calls grbl planner functions directly. The gcode parsing code from grbl isn' even present I think.
This is probably tricky - in addition to leaving out stuff from grbl, there's also additions for controlling the laser and probably other laos-specific changes. To really properly support this, some changes to upstream grbl would be needed - it should offer hooks in the right spots that laos can use to get stuff done at the right moments. This could be based on preprocessor macros, so it doesn't add any size to the normal grbl build, but I'm not sure if grbl's authors would be open for this... |
There seem to be discussing it already: grbl laser issues. laser and grbl experiments for example. |
On 1/14/2015 11:01, Peter Uithoven wrote:
Using smoothie codebase is also possible, but I would not include the |
Though I have little to offer at the moment in terms of resources to help, I would love simplified vector cutting code. I've wanted to experiment with PPI (pulses per inch) settings with LaOS, but I can't figure heads versus tails of the grbl code. http://hackaday.com/2014/06/11/better-lasing-with-pulses/ |
Recently I noticed that there is something iffy with the movement speeds on our cutter. Initially I noticed that there was a huge speed difference between 1% and 0.99%. Further investigation using a laserscript test pattern with multiple speeds, as well as doing a simple square at different speeds manually, I noted that all speeds < 1% actually resulted in the same movement speed, whereas speeds >= 1% did actually influence the movement speed.
The above was observed using laoslaser-14-11-2014.bin from git. When I compiled my own version from git master (which should not have any relevant changes compared to that version) to enable more debugging, the behaviour changed. Now (even when doing a clean compile, without any extra debugging enabled), the speeds varied linearly, even below 1%. However, now 1% speed was somehow special - it was about 30% faster than expected (e.g. 4% takes 8 seconds, 2% takes 16 seconds, but 1% only takes 23 instead of 32 as you'd expect).
It does seem that the above speeds correspond to the configured value: We have a max speed of 800 mm/s. My square had a length of 240mm, so at 2% speed, this should take 240/(800*2%) = 15s, which seems close enough to 16s to be correct (@peteruithoven, it seems I wrongly calculated this before, so it is correct after all).
Now, things got more interesting when I did the laserscript test pattern again. With my self-compiled firmware (with debugging enabled), this showed the original behaviour again - all speeds below 1% result in the same actual movement speed.
I added some debugging output, which confirms that
block->nominal_speed
is correctly calculated (e.g. 1% results in 480.0mm/min, other values were also correct). I also checked thatblock->nominal_rate
actually changes for different speeds, though I didn't check if the actual values are correct.This suggests that the problem occurs later, somewhere in the grbl stepper driver?
Looking at the code did leave me quite confused. There's probably some complicated math required, but I couldn't escape the notion that things could be simplified. It seems there's a few layers - parsing simplecode, filling the planner buffer, actually executing the planner steps, and it seems that a lot of conversion back between units happens there. There is also a lot of floating point math going on, which could probably be done as integer / fixed point math as well? An initial thought I had was to convert everything to steps as soon as possible, but I just realized that the different axises might have different steps/mm, so that won't work. Still, sticking to a common, sufficiently precise, unit and converting everything to that unit early seems useful. Perhaps using um and um/s makes sense?
On a related note - it seems that the
mark_speed
variable, which is an int, currently limits granularity of speeds to 1mm/s. On our machine a speed of 1% corresponds to 8mm/s, so there's only 8 steps below 1% that are meaningful. Since that is the range where cutting of wood happens, it would be good to have extra granularity. Later, when passing the value on to grbl, the value is converted to mm/min, but that extra granularity is already lost then.The text was updated successfully, but these errors were encountered: