File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -296,16 +296,28 @@ int check_ini_hal_items(int numjoints)
296296 rcs_print (" check_ini_hal_items:bad return value from emcTrajSetJerk\n " );
297297 }
298298 }
299+ // Force planner type 0 if max_jerk < 1 (S-curve needs valid jerk)
300+ if (NEW (traj_max_jerk) < 1.0 ) {
301+ if (0 != emcTrajPlannerType (0 )) {
302+ if (emc_debug & EMC_DEBUG_CONFIG) {
303+ rcs_print (" check_ini_hal_items:bad return value from emcTrajPlannerType\n " );
304+ }
305+ }
306+ }
299307 }
300308
301309 if (CHANGED (traj_planner_type)) {
302310 if (debug) SHOW_CHANGE_INT (traj_planner_type)
303311 UPDATE (traj_planner_type);
304312 // Only 0 and 1 are supported, set to 0 if invalid
313+ // Also force planner type 0 if max_jerk < 1 (S-curve needs valid jerk)
305314 int planner_type = NEW (traj_planner_type);
306315 if (planner_type != 0 && planner_type != 1 ) {
307316 planner_type = 0 ;
308317 }
318+ if (planner_type == 1 && NEW (traj_max_jerk) < 1.0 ) {
319+ planner_type = 0 ;
320+ }
309321 if (0 != emcTrajPlannerType (planner_type)) {
310322 if (emc_debug & EMC_DEBUG_CONFIG) {
311323 rcs_print (" check_ini_hal_items:bad return value from emcTrajPlannerType\n " );
Original file line number Diff line number Diff line change @@ -223,9 +223,13 @@ static int loadTraj(EmcIniFile *trajInifile)
223223 planner_type = 0 ; // Default: 0 = trapezoidal, 1 = S-curve
224224 trajInifile->Find (&planner_type, " PLANNER_TYPE" , " TRAJ" );
225225 // Only 0 and 1 are supported, set to 0 if invalid
226+ // Also force planner type 0 if max_jerk < 1 (S-curve needs valid jerk)
226227 if (planner_type != 0 && planner_type != 1 ) {
227228 planner_type = 0 ;
228229 }
230+ if (planner_type == 1 && jerk < 1.0 ) {
231+ planner_type = 0 ;
232+ }
229233 if (0 != emcTrajPlannerType (planner_type)) {
230234 if (emc_debug & EMC_DEBUG_CONFIG) {
231235 rcs_print (" bad return value from emcTrajPlannerType\n " );
You can’t perform that action at this time.
0 commit comments