Machsupport Forum
Mach Discussion => Mach4 General Discussion => Topic started by: RecceDG on April 09, 2023, 07:05:10 PM
-
Much work has been happening on the mill!
I have the Z axis together and the ClearPath servo auto-tuned, and I get 400 in/im and 1G accel out of the thing:
https://youtube.com/shorts/lfv4NNx5zTs
Except....
When jogging with the handwheel (MPG), I have a selector switch and code that controls how far the axis moves per handwheel pulse - 0.001", 0.01", or 0.1". On the 0.001"-per-pulse setting, it's fine. On the faster settings, jogging generates a "move one increment then stop" movement, and at 1G acceleration / 400 in/min that's not a smooth movement; it's BANG-BANG-BANG.
It's way, way too harsh to be usable; something is going to break.
I could turn down the axis acceleration, but where's the fun in that?
Is there some way within the Lua API to slow down the movement rate and/or acceleration when jogging?
Thanks!
-
You can use the following API
rc = mc.mcJogSetAccel(
number mInst,
number axisId,
double percent)
-
OK, cool, that's a start.
Looks like that's an override... is there a way to grab an axis' current motor parameters (specifically, acceleration) so I can do the math and set the jog accel via the API you just listed?
I gotta find that API reference again...
-
Hi,
you can set the max velocity and accelerations with:
LUA Syntax:
rc = mc.mcMotorSetMaxAccel(
number mInst,
number motorId,
number maxAccel)
Description:
Set the maximum acceleration value for the given motor.
And:
LUA Syntax:
rc = mc.mcMotorSetMaxVel(
number mInst,
number motorId,
number maxVel)
Description:
Set the maximum velocity for the given motor.
I am very dubious about changing these back and forth, I rather suspect that you motion control plugin will baulk at varying parameters throught a session.
There is also the question of when those parameters are recorded to the .ini file.
I think an override such as Swifty has pointed out is better.
Craig
-
Why do you have your accel set so high? Having the accel set as high as possible is not always the best setting. You might try turning it down, and seeing if that affects things in the real world where the tool is meeting the material.
-
Hi RecceDG,
The “bang” is likely due to the servo accurately following an instantaneous acceleration command. If you want to maintain 1 G of peak acceleration but have motion easier on your mechanics and likely improve part quality, you can utilize the ClearPath’s RAS (Regressive Auto Spline) to provide jerk limiting. If you’re interested in learning how to apply this user-adjustable smoothing feature, here is a video link:
https://www.youtube.com/embed/WOyP51-PiTs?rel=0&iv_load_policy=3
With a CNC, just be sure to select the same RAS value on all the axes.
Best regards,
Erik M…Teknic servo systems engineer