grblHAL / core

grblHAL core code and master Wiki
Other
334 stars 88 forks source link

Jerk Acceleration Settings and HAAS G187 Acceleration Profiles #593

Open Dietz0r opened 1 month ago

Dietz0r commented 1 month ago

This adds code to implement 3rd order accleration settings over the acceleration ticks of the stepper loop.

With the default settings of 100 acceleration ticks it will update the acceleration values according to the jerk setting with each 10ms block that gets fed into the stepper loop. If a CPU is strong enough to run 1000 acceleration ticks that would net a 1ms Jerk Stepper Loop but 100 or 200 ticks work fine. Tested on 2 independent machines with help from @empyreancnc

Known Issue: The machine moves a bit erratically/stuttery when getting fed jog commands from either a pendant or the IOSender interface, i think this has to do with how those conitinous jog commands are fed to the controller but i wasnt able to veryify or fix the issue on my end. Normal G-Code file execution works as expected. I hope you might have more insight into why this problem arises.

Also added support for HAAS style G187 acceleration profiles currently set to 20%, 40% 60% 80% and 100% of the max settings to allow for fine control during toolpathes and improved surface finishes. Gets called as G187 P1 for 100% speed roughing to G187 P5 for 20% slow finishing.

Hope this helps! :)

Dietz0r commented 1 month ago

No questions, annotations, comments or change requests? =(

terjeio commented 1 month ago

I'll get to this when I am back home early next month since I do not have access to a machine where I am now.

terjeio commented 3 weeks ago

FYI I'll be back home in a week...

From the Haas documentation:

G187 will be canceled whenever [RESET] is pressed, M30 or M02 is executed, the end of program is reached, or [EMERGENCY STOP] is pressed.

This means that there should be a setting for the default P value? And cancellation implemented?

Dietz0r commented 3 weeks ago

FYI I'll be back home in a week...

Hope you enjoyed your trip! :)

This means that there should be a setting for the default P value? And cancellation implemented?

I think the most reliable thing would be to have the default value be 100%, so the settings that are set on the axis and be modified from there with the profiles. Saves a setting slot and if you really want to just run at 80% max it's trivial to just add G187 P4 at the start of any code.

The cancellation is a good point! didnt think of that! Will look at it and add it.

This should be !gc_block.words.p to check if a value has been supplied. IMO also check gc_block.words.e, if supplied (true) error out since it is not supported?

So no one accidentally tries to use a real HAAS routine on it? yeah i see it.