Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.1.x] Apply feedrate to nozzle movement for kinematic machines #9448

Merged
merged 2 commits into from
Feb 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12370,6 +12370,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {

// The approximate length of each segment
const float inv_segments = 1.0 / float(segments),
cartesian_segment_mm = cartesian_mm * inv_segments,
segment_distance[XYZE] = {
xdiff * inv_segments,
ydiff * inv_segments,
Expand All @@ -12379,6 +12380,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {

// SERIAL_ECHOPAIR("mm=", cartesian_mm);
// SERIAL_ECHOLNPAIR(" segments=", segments);
// SERIAL_ECHOLNPAIR(" segment_mm=", cartesian_segment_mm);

// Get the raw current position as starting point
float raw[XYZE];
Expand All @@ -12393,12 +12395,12 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
idle();
}
LOOP_XYZE(i) raw[i] += segment_distance[i];
planner.buffer_line_kinematic(raw, fr_mm_s, active_extruder);
planner.buffer_line_kinematic(raw, fr_mm_s, active_extruder, cartesian_segment_mm);
}

// Since segment_distance is only approximate,
// the final move must be to the exact destination.
planner.buffer_line_kinematic(destination, fr_mm_s, active_extruder);
planner.buffer_line_kinematic(destination, fr_mm_s, active_extruder, cartesian_segment_mm);
}

#elif ENABLED(MESH_BED_LEVELING)
Expand Down Expand Up @@ -12595,6 +12597,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {

// The approximate length of each segment
const float inv_segments = 1.0 / float(segments),
cartesian_segment_mm = cartesian_mm * inv_segments,
segment_distance[XYZE] = {
xdiff * inv_segments,
ydiff * inv_segments,
Expand All @@ -12605,6 +12608,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
// SERIAL_ECHOPAIR("mm=", cartesian_mm);
// SERIAL_ECHOPAIR(" seconds=", seconds);
// SERIAL_ECHOLNPAIR(" segments=", segments);
// SERIAL_ECHOLNPAIR(" segment_mm=", cartesian_segment_mm);

#if ENABLED(SCARA_FEEDRATE_SCALING)
// SCARA needs to scale the feed rate from mm/s to degrees/s
Expand Down Expand Up @@ -12642,20 +12646,20 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
#if ENABLED(SCARA_FEEDRATE_SCALING)
// For SCARA scale the feed rate from mm/s to degrees/s
// i.e., Complete the angular vector in the given time.
planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], raw[Z_AXIS], raw[E_AXIS], HYPOT(delta[A_AXIS] - oldA, delta[B_AXIS] - oldB) * inverse_secs, active_extruder);
planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], raw[Z_AXIS], raw[E_AXIS], HYPOT(delta[A_AXIS] - oldA, delta[B_AXIS] - oldB) * inverse_secs, active_extruder, cartesian_segment_mm);
oldA = delta[A_AXIS]; oldB = delta[B_AXIS];
#else
planner.buffer_line(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], raw[E_AXIS], _feedrate_mm_s, active_extruder);
planner.buffer_line(delta[A_AXIS], delta[B_AXIS], delta[C_AXIS], raw[E_AXIS], _feedrate_mm_s, active_extruder, cartesian_segment_mm);
#endif
}

// Ensure last segment arrives at target location.
#if ENABLED(SCARA_FEEDRATE_SCALING)
inverse_kinematics(rtarget);
ADJUST_DELTA(rtarget);
planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], rtarget[Z_AXIS], rtarget[E_AXIS], HYPOT(delta[A_AXIS] - oldA, delta[B_AXIS] - oldB) * inverse_secs, active_extruder);
planner.buffer_segment(delta[A_AXIS], delta[B_AXIS], rtarget[Z_AXIS], rtarget[E_AXIS], HYPOT(delta[A_AXIS] - oldA, delta[B_AXIS] - oldB) * inverse_secs, active_extruder, cartesian_segment_mm);
#else
planner.buffer_line_kinematic(rtarget, _feedrate_mm_s, active_extruder);
planner.buffer_line_kinematic(rtarget, _feedrate_mm_s, active_extruder, cartesian_segment_mm);
#endif

return false; // caller will update current_position
Expand Down
3 changes: 3 additions & 0 deletions Marlin/enum.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ enum AxisEnum {
#define LOOP_XYZ(VAR) LOOP_S_LE_N(VAR, X_AXIS, Z_AXIS)
#define LOOP_XYZE(VAR) LOOP_S_LE_N(VAR, X_AXIS, E_AXIS)
#define LOOP_XYZE_N(VAR) LOOP_S_L_N(VAR, X_AXIS, XYZE_N)
#define LOOP_ABC(VAR) LOOP_S_LE_N(VAR, A_AXIS, C_AXIS)
#define LOOP_ABCE(VAR) LOOP_S_LE_N(VAR, A_AXIS, E_AXIS)
#define LOOP_ABCE_N(VAR) LOOP_S_L_N(VAR, A_AXIS, XYZE_N)

typedef enum {
LINEARUNIT_MM,
Expand Down
11 changes: 9 additions & 2 deletions Marlin/language.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,6 @@
#define MSG_KP " Kp: "
#define MSG_KI " Ki: "
#define MSG_KD " Kd: "
#define MSG_B "B:"
#define MSG_T "T:"
#define MSG_AT " @:"
#define MSG_PID_AUTOTUNE_FINISHED MSG_PID_AUTOTUNE " finished! Put the last Kp, Ki and Kd constants from below into Configuration.h"
#define MSG_PID_DEBUG " PID_DEBUG "
Expand Down Expand Up @@ -282,6 +280,15 @@
#define MSG_Y "Y"
#define MSG_Z "Z"
#define MSG_E "E"
#if IS_KINEMATIC
#define MSG_A "A"
#define MSG_B "B"
#define MSG_C "C"
#else
#define MSG_A "X"
#define MSG_B "Y"
#define MSG_C "Z"
#endif
#define MSG_H1 "1"
#define MSG_H2 "2"
#define MSG_H3 "3"
Expand Down
24 changes: 18 additions & 6 deletions Marlin/language_an.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,15 @@
#define MSG_SELECT _UxGT("Trigar")
#define MSG_ACC _UxGT("Aceleracion")
#define MSG_JERK _UxGT("Jerk")
#define MSG_VX_JERK _UxGT("Vx-jerk")
#define MSG_VY_JERK _UxGT("Vy-jerk")
#define MSG_VZ_JERK _UxGT("Vz-jerk")
#if IS_KINEMATIC
#define MSG_VA_JERK _UxGT("Va-jerk")
#define MSG_VB_JERK _UxGT("Vb-jerk")
#define MSG_VC_JERK _UxGT("Vc-jerk")
#else
#define MSG_VA_JERK _UxGT("Vx-jerk")
#define MSG_VB_JERK _UxGT("Vy-jerk")
#define MSG_VC_JERK _UxGT("Vz-jerk")
#endif
#define MSG_VE_JERK _UxGT("Ve-jerk")
#define MSG_VMAX _UxGT("Vmax")
#define MSG_VMIN _UxGT("Vmin")
Expand All @@ -108,9 +114,15 @@
#define MSG_A_RETRACT _UxGT("Acel. retrac.")
#define MSG_A_TRAVEL _UxGT("Acel. Viaje")
#define MSG_STEPS_PER_MM _UxGT("Trangos/mm")
#define MSG_XSTEPS _UxGT("X trangos/mm")
#define MSG_YSTEPS _UxGT("Y trangos/mm")
#define MSG_ZSTEPS _UxGT("Z trangos/mm")
#if IS_KINEMATIC
#define MSG_ASTEPS _UxGT("A trangos/mm")
#define MSG_BSTEPS _UxGT("B trangos/mm")
#define MSG_CSTEPS _UxGT("C trangos/mm")
#else
#define MSG_ASTEPS _UxGT("X trangos/mm")
#define MSG_BSTEPS _UxGT("Y trangos/mm")
#define MSG_CSTEPS _UxGT("Z trangos/mm")
#endif
#define MSG_ESTEPS _UxGT("E trangos/mm")
#define MSG_E1STEPS _UxGT("E1 trangos/mm")
#define MSG_E2STEPS _UxGT("E2 trangos/mm")
Expand Down
12 changes: 9 additions & 3 deletions Marlin/language_bg.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,15 @@
#define MSG_A_RETRACT _UxGT("A-откат")
#define MSG_A_TRAVEL _UxGT("A-travel")
#define MSG_STEPS_PER_MM _UxGT("Стъпки/mm")
#define MSG_XSTEPS _UxGT("X стъпки/mm")
#define MSG_YSTEPS _UxGT("Y стъпки/mm")
#define MSG_ZSTEPS _UxGT("Z стъпки/mm")
#if IS_KINEMATIC
#define MSG_ASTEPS _UxGT("Aстъпки/mm")
#define MSG_BSTEPS _UxGT("Bстъпки/mm")
#define MSG_CSTEPS _UxGT("Cстъпки/mm")
#else
#define MSG_ASTEPS _UxGT("Xстъпки/mm")
#define MSG_BSTEPS _UxGT("Yстъпки/mm")
#define MSG_CSTEPS _UxGT("Zстъпки/mm")
#endif
#define MSG_ESTEPS _UxGT("E стъпки/mm")
#define MSG_E1STEPS _UxGT("E1 стъпки/mm")
#define MSG_E2STEPS _UxGT("E2 стъпки/mm")
Expand Down
24 changes: 18 additions & 6 deletions Marlin/language_ca.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,15 @@
#define MSG_SELECT _UxGT("Select")
#define MSG_ACC _UxGT("Accel")
#define MSG_JERK _UxGT("Jerk")
#define MSG_VX_JERK _UxGT("Vx-jerk")
#define MSG_VY_JERK _UxGT("Vy-jerk")
#define MSG_VZ_JERK _UxGT("Vz-jerk")
#if IS_KINEMATIC
#define MSG_VA_JERK _UxGT("Va-jerk")
#define MSG_VB_JERK _UxGT("Vb-jerk")
#define MSG_VC_JERK _UxGT("Vc-jerk")
#else
#define MSG_VA_JERK _UxGT("Vx-jerk")
#define MSG_VB_JERK _UxGT("Vy-jerk")
#define MSG_VC_JERK _UxGT("Vz-jerk")
#endif
#define MSG_VE_JERK _UxGT("Ve-jerk")
#define MSG_VMAX _UxGT("Vmax ")
#define MSG_VMIN _UxGT("Vmin")
Expand All @@ -111,9 +117,15 @@
#define MSG_A_RETRACT _UxGT("Accel. retracc")
#define MSG_A_TRAVEL _UxGT("Accel. Viatge")
#define MSG_STEPS_PER_MM _UxGT("Passos/mm")
#define MSG_XSTEPS _UxGT("Xpassos/mm")
#define MSG_YSTEPS _UxGT("Ypassos/mm")
#define MSG_ZSTEPS _UxGT("Zpassos/mm")
#if IS_KINEMATIC
#define MSG_ASTEPS _UxGT("Apassos/mm")
#define MSG_BSTEPS _UxGT("Bpassos/mm")
#define MSG_CSTEPS _UxGT("Cpassos/mm")
#else
#define MSG_ASTEPS _UxGT("Xpassos/mm")
#define MSG_BSTEPS _UxGT("Ypassos/mm")
#define MSG_CSTEPS _UxGT("Zpassos/mm")
#endif
#define MSG_ESTEPS _UxGT("Epassos/mm")
#define MSG_E1STEPS _UxGT("E1passos/mm")
#define MSG_E2STEPS _UxGT("E2passos/mm")
Expand Down
15 changes: 9 additions & 6 deletions Marlin/language_cn.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,15 @@
#define MSG_PID_C "PID-C"
#define MSG_ACC "Accel"
#define MSG_JERK "Jerk"
#define MSG_VX_JERK "Vx-jerk"
#define MSG_VY_JERK "Vy-jerk"
#define MSG_VZ_JERK "Vz-jerk"
#if IS_KINEMATIC
#define MSG_VA_JERK "Va-jerk"
#define MSG_VB_JERK "Vb-jerk"
#define MSG_VC_JERK "Vc-jerk"
#else
#define MSG_VA_JERK "Vx-jerk"
#define MSG_VB_JERK "Vy-jerk"
#define MSG_VC_JERK "Vz-jerk"
#endif
#define MSG_VE_JERK "Ve-jerk"
#define MSG_VMAX "Vmax "
#define MSG_VMIN "Vmin"
Expand All @@ -99,9 +105,6 @@
#define MSG_A_RETRACT "A-retract"
#define MSG_A_TRAVEL "A-travel"
#define MSG_STEPS_PER_MM "Steps/mm"
#define MSG_XSTEPS "Xsteps/mm"
#define MSG_YSTEPS "Ysteps/mm"
#define MSG_ZSTEPS "Zsteps/mm"
#define MSG_ESTEPS "Esteps/mm"
#define MSG_E1STEPS "E1steps/mm"
#define MSG_E2STEPS "E2steps/mm"
Expand Down
42 changes: 27 additions & 15 deletions Marlin/language_cz.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,15 @@
#define MSG_LEDS_ON _UxGT("Svetla Zap")
#define MSG_LEDS_OFF _UxGT("Svetla Vyp")
#define MSG_LED_PRESETS _UxGT("Svetla Predvolby")
#define MSG_SET_LEDS_RED _UxGT("Svetla Cervena")
#define MSG_SET_LEDS_ORANGE _UxGT("Svetla Oranzova")
#define MSG_SET_LEDS_YELLOW _UxGT("Svetla Zluta")
#define MSG_SET_LEDS_GREEN _UxGT("Svetla Zelena")
#define MSG_SET_LEDS_BLUE _UxGT("Svetla Modra")
#define MSG_SET_LEDS_INDIGO _UxGT("Svetla Indigo")
#define MSG_SET_LEDS_VIOLET _UxGT("Svetla Fialova")
#define MSG_SET_LEDS_WHITE _UxGT("Svetla Bila")
#define MSG_SET_LEDS_DEFAULT _UxGT("Svetla Vychozi")
#define MSG_SET_LEDS_RED _UxGT("Cervena")
#define MSG_SET_LEDS_ORANGE _UxGT("Oranzova")
#define MSG_SET_LEDS_YELLOW _UxGT("Zluta")
#define MSG_SET_LEDS_GREEN _UxGT("Zelena")
#define MSG_SET_LEDS_BLUE _UxGT("Modra")
#define MSG_SET_LEDS_INDIGO _UxGT("Indigo")
#define MSG_SET_LEDS_VIOLET _UxGT("Fialova")
#define MSG_SET_LEDS_WHITE _UxGT("Bila")
#define MSG_SET_LEDS_DEFAULT _UxGT("Vychozi")
#define MSG_CUSTOM_LEDS _UxGT("Vlastni svetla")
#define MSG_INTENSITY_R _UxGT("Cervena intenzita")
#define MSG_INTENSITY_G _UxGT("Zelena intezita")
Expand Down Expand Up @@ -196,9 +196,15 @@
#define MSG_SELECT _UxGT("Vybrat")
#define MSG_ACC _UxGT("Zrychl")
#define MSG_JERK _UxGT("Jerk")
#define MSG_VX_JERK _UxGT("Vx-jerk")
#define MSG_VY_JERK _UxGT("Vy-jerk")
#define MSG_VZ_JERK _UxGT("Vz-jerk")
#if IS_KINEMATIC
#define MSG_VA_JERK _UxGT("Va-jerk")
#define MSG_VB_JERK _UxGT("Vb-jerk")
#define MSG_VC_JERK _UxGT("Vc-jerk")
#else
#define MSG_VA_JERK _UxGT("Vx-jerk")
#define MSG_VB_JERK _UxGT("Vy-jerk")
#define MSG_VC_JERK _UxGT("Vz-jerk")
#endif
#define MSG_VE_JERK _UxGT("Ve-jerk")
#define MSG_VELOCITY _UxGT("Rychlost")
#define MSG_VMAX _UxGT("Vmax ")
Expand All @@ -209,9 +215,15 @@
#define MSG_A_RETRACT _UxGT("A-retrakt")
#define MSG_A_TRAVEL _UxGT("A-prejezd")
#define MSG_STEPS_PER_MM _UxGT("Kroku/mm")
#define MSG_XSTEPS _UxGT("Xkroku/mm")
#define MSG_YSTEPS _UxGT("Ykroku/mm")
#define MSG_ZSTEPS _UxGT("Zkroku/mm")
#if IS_KINEMATIC
#define MSG_ASTEPS _UxGT("Akroku/mm")
#define MSG_BSTEPS _UxGT("Bkroku/mm")
#define MSG_CSTEPS _UxGT("Ckroku/mm")
#else
#define MSG_ASTEPS _UxGT("Xkroku/mm")
#define MSG_BSTEPS _UxGT("Ykroku/mm")
#define MSG_CSTEPS _UxGT("Zkroku/mm")
#endif
#define MSG_ESTEPS _UxGT("Ekroku/mm")
#define MSG_E1STEPS _UxGT("E1kroku/mm")
#define MSG_E2STEPS _UxGT("E2kroku/mm")
Expand Down
42 changes: 27 additions & 15 deletions Marlin/language_cz_utf8.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,15 @@
#define MSG_LEDS_ON _UxGT("Světla Zap")
#define MSG_LEDS_OFF _UxGT("Světla Vyp")
#define MSG_LED_PRESETS _UxGT("Světla Předvolby")
#define MSG_SET_LEDS_RED _UxGT("Světla Červená")
#define MSG_SET_LEDS_ORANGE _UxGT("Světla Oranžová")
#define MSG_SET_LEDS_YELLOW _UxGT("Světla Žlutá")
#define MSG_SET_LEDS_GREEN _UxGT("Světla Zelená")
#define MSG_SET_LEDS_BLUE _UxGT("Světla Modrá")
#define MSG_SET_LEDS_INDIGO _UxGT("Světla Indigo")
#define MSG_SET_LEDS_VIOLET _UxGT("Světla Fialová")
#define MSG_SET_LEDS_WHITE _UxGT("Světla Bílá")
#define MSG_SET_LEDS_DEFAULT _UxGT("Světla Výchozí")
#define MSG_SET_LEDS_RED _UxGT("Červená")
#define MSG_SET_LEDS_ORANGE _UxGT("Oranžová")
#define MSG_SET_LEDS_YELLOW _UxGT("Žlutá")
#define MSG_SET_LEDS_GREEN _UxGT("Zelená")
#define MSG_SET_LEDS_BLUE _UxGT("Modrá")
#define MSG_SET_LEDS_INDIGO _UxGT("Indigo")
#define MSG_SET_LEDS_VIOLET _UxGT("Fialová")
#define MSG_SET_LEDS_WHITE _UxGT("Bílá")
#define MSG_SET_LEDS_DEFAULT _UxGT("Výchozí")
#define MSG_CUSTOM_LEDS _UxGT("Vlastní světla")
#define MSG_INTENSITY_R _UxGT("Červená intenzita")
#define MSG_INTENSITY_G _UxGT("Zelená intezita")
Expand Down Expand Up @@ -198,9 +198,15 @@
#define MSG_SELECT _UxGT("Vybrat")
#define MSG_ACC _UxGT("Zrychl")
#define MSG_JERK _UxGT("Jerk")
#define MSG_VX_JERK _UxGT("Vx-jerk")
#define MSG_VY_JERK _UxGT("Vy-jerk")
#define MSG_VZ_JERK _UxGT("Vz-jerk")
#if IS_KINEMATIC
#define MSG_VA_JERK _UxGT("Va-jerk")
#define MSG_VB_JERK _UxGT("Vb-jerk")
#define MSG_VC_JERK _UxGT("Vc-jerk")
#else
#define MSG_VA_JERK _UxGT("Vx-jerk")
#define MSG_VB_JERK _UxGT("Vy-jerk")
#define MSG_VC_JERK _UxGT("Vz-jerk")
#endif
#define MSG_VE_JERK _UxGT("Ve-jerk")
#define MSG_VELOCITY _UxGT("Rychlost")
#define MSG_VMAX _UxGT("Vmax ")
Expand All @@ -211,9 +217,15 @@
#define MSG_A_RETRACT _UxGT("A-retrakt")
#define MSG_A_TRAVEL _UxGT("A-přejezd")
#define MSG_STEPS_PER_MM _UxGT("Kroků/mm")
#define MSG_XSTEPS _UxGT("Xkroků/mm")
#define MSG_YSTEPS _UxGT("Ykroků/mm")
#define MSG_ZSTEPS _UxGT("Zkroků/mm")
#if IS_KINEMATIC
#define MSG_ASTEPS _UxGT("Akroků/mm")
#define MSG_BSTEPS _UxGT("Bkroků/mm")
#define MSG_CSTEPS _UxGT("Ckroků/mm")
#else
#define MSG_ASTEPS _UxGT("Xkroků/mm")
#define MSG_BSTEPS _UxGT("Ykroků/mm")
#define MSG_CSTEPS _UxGT("Zkroků/mm")
#endif
#define MSG_ESTEPS _UxGT("Ekroků/mm")
#define MSG_E1STEPS _UxGT("E1kroků/mm")
#define MSG_E2STEPS _UxGT("E2kroků/mm")
Expand Down
Loading