soft limits working in corexy? #536
Replies: 2 comments 1 reply
-
Adding soft limits for corexy kinematics in grblHAL(I do not use Github enough to know how to submit this change for review. This solution is documented here in case anyone else needs it.) Currently soft limits are not implemented for corexy kinematics. The default soft limits check function, machine_limits.c:limits_soft_check(), will trigger a soft limit error for any move (other than jogging) if soft limits are enabled with corexy kinematics. A new soft limits check function (and helper) must be added to corexy.c, and this new function registered for use as the new soft limits check. In kinematics/corexy.c, replace the final function corexy_init() with the following three functions:
The helper function transform_to_cartesian() is required because the check_travel_limits() function is passed the motor coordinates, not the physical cartesian coordinates that the soft checks must be performed in. So we have to transform the motor coordinates to cartesian. The corexy_check_travel_limits() function is based on the default check_travel_limits() since we can translate into all cartesian coordinates. For the limited cases I've tried, it does not appear necessary to implement a corexy-specific check_arc_travel_limits(). G2 and G3 seem to work fine. Looking at delta.c, I didn't see an arc function there. We also need to modify the corexy_init() to register the new corexy_check_travel_limits(). |
Beta Was this translation helpful? Give feedback.
-
Thanks for adding that! |
Beta Was this translation helpful? Give feedback.
-
Trying to up soft limits for a corexy machine. Homing works fine (I've set up the machine home to upper right corner, so all X and Y are negative in machine coordinates). (Pen plotter with no Z.) Jogging works fine, and respects soft limits (though silently--it just won't jog outside the soft limits). However, after homing the machine and moving, say, to the middle of the work envelope, I can zero X and Y, but any g-code moves (e.g., "G0 X0 Y0") throws a soft limit error.
Looking at the code in core/machine_limits.c, function check_travel_limits(), it looks like it checks to see if the machine is using any of the unusual kinematics (corexy, delta, etc.), and if so, just returns. ("is_cartesian" would be false, as I understand it.)
I see that the code for delta kinematics seems to define their own (delta_)check_travel_limits() function. Is that what's needed here? I don't see corexy defining or setting its own function.
Perhaps I'm missing something simple.
My configuration: $0 = 10.0 (Step pulse time, microseconds)
$1 = 25 (Step idle delay, milliseconds)
$2 = 0 (Step pulse invert, mask)
$3 = 3 (Step direction invert, mask)
$4 = 7 (Invert step enable pin, boolean)
$5 = 0 (Invert limit pins, boolean)
$9 = 1
$10 = 511 (Status report options, mask)
$11 = 0.010 (Junction deviation, millimeters)
$12 = 0.002 (Arc tolerance, millimeters)
$13 = 1 (Report in inches, boolean)
$14 = 0
$15 = 0
$16 = 0
$17 = 0
$18 = 0
$20 = 1 (Soft limits enable, boolean)
$21 = 0 (Hard limits enable, boolean)
$22 = 1 (Homing cycle enable, boolean)
$23 = 0 (Homing direction invert, mask)
$24 = 100.0 (Homing locate feed rate, mm/min)
$25 = 2000.0 (Homing search seek rate, mm/min)
$26 = 250 (Homing switch debounce delay, milliseconds)
$27 = 1.000 (Homing switch pull-off distance, millimeters)
$28 = 0.100
$29 = 0.0
$30 = 1000.000 (Maximum spindle speed, RPM)
$31 = 0.000 (Minimum spindle speed, RPM)
$32 = 0 (Laser-mode enable, boolean)
$33 = 50.0
$34 = 5.0
$35 = 5.0
$36 = 10.0
$37 = 0
$39 = 1
$40 = 0
$43 = 1
$44 = 1
$45 = 2
$46 = 0
$62 = 0
$63 = 3
$64 = 0
$100 = 40.00000 (X-axis travel resolution, step/mm)
$101 = 40.00000 (Y-axis travel resolution, step/mm)
$102 = 40.00000 (Z-axis travel resolution, step/mm)
$110 = 12700.000 (X-axis maximum rate, mm/min)
$111 = 12700.000 (Y-axis maximum rate, mm/min)
$112 = 1000.000 (Z-axis maximum rate, mm/min)
$120 = 12700.000 (X-axis acceleration, mm/sec^2)
$121 = 12700.000 (Y-axis acceleration, mm/sec^2)
$122 = 1000.000 (Z-axis acceleration, mm/sec^2)
$130 = 230.000 (X-axis maximum travel, millimeters)
$131 = 165.000 (Y-axis maximum travel, millimeters)
$132 = 25.000 (Z-axis maximum travel, millimeters)
$341 = 0
$342 = 30.0
$343 = 100.0
$344 = 600.0
$345 = 200.0
$346 = 1
$372 = 0
$384 = 0
$394 = 4.0
$398 = 100
$481 = 0
$484 = 1
$486 = 0
$673 = 1.0
RP Pico, built fairly recently.
Beta Was this translation helpful? Give feedback.
All reactions