Changing acceleration and max velocity with G/M codes?

More
3 years 6 months ago #268371 by dmradford
My mill is pretty well tuned, however given a few physical limitations of it, I've run into a sometimes frustrating balancing act between acceleration and max velocity.

My machine can get moving upwards of 500 ipm, but only if my acceleration is somewhere around 0.01G. If I limit my max velocity to about 250 ipm, I can crank my acceleration up to 0.25G without any issues. So obviously I could have multiple machine profiles and just load them up specific to whatever operation I'm going to be doing. Though, if I want to use HSM for a roughing pass that has long fast moves, then switch to a higher acceleration profile for the detail / finishing operations which are much shorter moves, I'm just stuck with one profile for the entire setup regardless of the needs of the multiple operations within that setup (unless I restart LCNC and then re-home, and reconfigure my work offsets - yuk, rather not...).

On most 3D printers I've used, you can actually adjust the acceleration settings right in the gcode. This is generally only used to test / configure the "correct" settings for printers, but seems like it would have a very practical application within the world of milling machines.

Is there any way to adjust the acceleration values within the Gcode file, or even just within the UI without having to shut down LCNC and reload it with a different profile? I'd love to be able to set different acceleration values on a per operation basis to get the most out of my machine.

Please Log in to join the conversation.

More
3 years 6 months ago #268420 by zz912
Hello,

you should combine:
INI HAL pin. Look in Halshow.
 

Attachment not found



with:
M68
linuxcnc.org/docs/2.9/html/gcode/m-code.html#mcode:m68

In custom.hal you must connect it by net command.

Another combination is:
M64 / M65  and connect it throw own HAL component.

 

Please Log in to join the conversation.

More
3 years 6 months ago #268459 by dmradford
I'm not sure I follow. How would this allow me to change the acceleration values via gcode?

Please Log in to join the conversation.

More
3 years 6 months ago #268483 by zz912
In custom_postgui.hal file add:
Code:
# Change max velocity and acceleration from G-code net sig-max-velocity <= motion.analog-out-00 net sig-max-acceleration <= motion.analog-out-01 net sig-max-velocity => ini.x.max_velocity net sig-max-velocity => ini.y.max_velocity net sig-max-velocity => ini.z.max_velocity net sig-max-acceleration => ini.x.max_acceleration net sig-max-acceleration => ini.y.max_acceleration net sig-max-acceleration => ini.z.max_acceleration

Start LinuxCNC and in MDI type:
Code:
M68 E0 Q10 (change velocity unit/s) M68 E1 Q5 (change acceleration unit/s2)
​​​​​​​

Please Log in to join the conversation.

Time to create page: 0.108 seconds
Powered by Kunena Forum