Changing acceleration and max velocity with G/M codes?

More
06 Apr 2023 01:38 #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 or Create an account to join the conversation.

More
06 Apr 2023 12:41 #268420 by zz912
Hello,

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

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.

 
Attachments:

Please Log in or Create an account to join the conversation.

More
06 Apr 2023 22:26 #268459 by dmradford
I'm not sure I follow. How would this allow me to change the acceleration values via gcode?

Please Log in or Create an account to join the conversation.

More
07 Apr 2023 04:20 - 07 Apr 2023 04:25 #268483 by zz912
In custom_postgui.hal file add:
# 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:
M68 E0 Q10 (change velocity unit/s)
M68 E1 Q5 (change acceleration unit/s2)
​​​​​​​
Last edit: 07 Apr 2023 04:25 by zz912.

Please Log in or Create an account to join the conversation.

Time to create page: 0.078 seconds
Powered by Kunena Forum