-
Notifications
You must be signed in to change notification settings - Fork 88
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
Jerk Acceleration Settings and HAAS G187 Acceleration Profiles #593
base: master
Are you sure you want to change the base?
Conversation
First experimental checkin for constant jerk motions
First experimental checkin for constant jerk motions
First experimental checkin for constant jerk motions
missing semicolon
bugfixing float variables
DEFAULT_X_JERK capitalization
static char added for axis_jerk
Fixed some typos and syntax errors.
No questions, annotations, comments or change requests? =( |
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. |
FYI I'll be back home in a week... From the Haas documentation:
This means that there should be a setting for the default P value? And cancellation implemented? |
settings.h
Outdated
@@ -1064,6 +1071,11 @@ bool settings_read_coord_data(coord_system_id_t id, float (*coord_data)[N_AXIS]) | |||
// Temporarily override acceleration, if 0 restore to configured setting value | |||
bool settings_override_acceleration (uint8_t axis, float acceleration); | |||
|
|||
#if ENABLE_ACCELERATION_PROFILES | |||
extern uint8_t ActiveAccelProfile; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO ActiveAccelProfile should be added to gc_state and passed to the planner via pl_block instead. Set the default in gc_init() and restore it in the M2/M30 handling code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would something like this work?
this in gc_init() to initialize the state:
and call back it in the limit function in planner.c like this:
and then set and reset the gc_state.modal.activeaccelprofile to whatever profile is currently needed with the g187 function? And then also add the m2/m30/reset handling, of course.
Hope you enjoyed your trip! :)
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.
So no one accidentally tries to use a real HAAS routine on it? yeah i see it. |
settings.c
Outdated
ActiveAccelProfile = 1; // Initialize machine with 100% Profile | ||
|
||
//Acceleration Profiles for G187 P[x] in percent of maximum machine acceleration. | ||
float LookupProfile(uint8_t Profile) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to planner.c as static inlined?
and the return value is either 0 or 1 since you assign the value to Profile before returning it? Use return lookup(profile); instead?
BTW I do not use camel cased or upper case names in the core.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving it to planner.c as static inlined would make it very hard to find if you wanted to have other profiles instead of the generic placeholder 20% ones.
I shied away from making it yet another list of $ settings because it would likely mean a whole slew of settings for however much profiles you wanted. having the lookuptable in settings.c makes it findable though.
maybe move it to the driver my_machine.h because it is a compile time setting?
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! :)