|
|
@ -6093,8 +6093,8 @@ void prepare_move() { |
|
|
|
#endif // HAS_CONTROLLERFAN
|
|
|
|
|
|
|
|
#ifdef SCARA |
|
|
|
void calculate_SCARA_forward_Transform(float f_scara[3]) |
|
|
|
{ |
|
|
|
|
|
|
|
void calculate_SCARA_forward_Transform(float f_scara[3]) { |
|
|
|
// Perform forward kinematics, and place results in delta[3]
|
|
|
|
// The maths and first version has been done by QHARLEY . Integrated into masterbranch 06/2014 and slightly restructured by Joachim Cerny in June 2014
|
|
|
|
|
|
|
@ -6108,19 +6108,19 @@ void calculate_SCARA_forward_Transform(float f_scara[3]) |
|
|
|
y_sin = sin(f_scara[Y_AXIS]/SCARA_RAD2DEG) * Linkage_2; |
|
|
|
y_cos = cos(f_scara[Y_AXIS]/SCARA_RAD2DEG) * Linkage_2; |
|
|
|
|
|
|
|
// SERIAL_ECHOPGM(" x_sin="); SERIAL_ECHO(x_sin);
|
|
|
|
// SERIAL_ECHOPGM(" x_cos="); SERIAL_ECHO(x_cos);
|
|
|
|
// SERIAL_ECHOPGM(" y_sin="); SERIAL_ECHO(y_sin);
|
|
|
|
// SERIAL_ECHOPGM(" y_cos="); SERIAL_ECHOLN(y_cos);
|
|
|
|
//SERIAL_ECHOPGM(" x_sin="); SERIAL_ECHO(x_sin);
|
|
|
|
//SERIAL_ECHOPGM(" x_cos="); SERIAL_ECHO(x_cos);
|
|
|
|
//SERIAL_ECHOPGM(" y_sin="); SERIAL_ECHO(y_sin);
|
|
|
|
//SERIAL_ECHOPGM(" y_cos="); SERIAL_ECHOLN(y_cos);
|
|
|
|
|
|
|
|
delta[X_AXIS] = x_cos + y_cos + SCARA_offset_x; //theta
|
|
|
|
delta[Y_AXIS] = x_sin + y_sin + SCARA_offset_y; //theta+phi
|
|
|
|
|
|
|
|
//SERIAL_ECHOPGM(" delta[X_AXIS]="); SERIAL_ECHO(delta[X_AXIS]);
|
|
|
|
//SERIAL_ECHOPGM(" delta[Y_AXIS]="); SERIAL_ECHOLN(delta[Y_AXIS]);
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void calculate_delta(float cartesian[3]){ |
|
|
|
void calculate_delta(float cartesian[3]){ |
|
|
|
//reverse kinematics.
|
|
|
|
// Perform reversed kinematics, and place results in delta[3]
|
|
|
|
// The maths and first version has been done by QHARLEY . Integrated into masterbranch 06/2014 and slightly restructured by Joachim Cerny in June 2014
|
|
|
@ -6165,10 +6165,11 @@ void calculate_delta(float cartesian[3]){ |
|
|
|
SERIAL_ECHOPGM(" S2="); SERIAL_ECHO(SCARA_S2); |
|
|
|
SERIAL_ECHOPGM(" Theta="); SERIAL_ECHO(SCARA_theta); |
|
|
|
SERIAL_ECHOPGM(" Psi="); SERIAL_ECHOLN(SCARA_psi); |
|
|
|
SERIAL_ECHOLN(" ");*/ |
|
|
|
} |
|
|
|
SERIAL_EOL; |
|
|
|
*/ |
|
|
|
} |
|
|
|
|
|
|
|
#endif |
|
|
|
#endif // SCARA
|
|
|
|
|
|
|
|
#ifdef TEMP_STAT_LEDS |
|
|
|
|
|
|
@ -6399,39 +6400,28 @@ void kill() |
|
|
|
st_synchronize(); |
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|
void Stop() { |
|
|
|
disable_all_heaters(); |
|
|
|
if (IsRunning()) { |
|
|
|
Running = false; |
|
|
|
Stopped_gcode_LastN = gcode_LastN; // Save last g_code for restart
|
|
|
|
SERIAL_ERROR_START; |
|
|
|
SERIAL_ERRORLNPGM(MSG_ERR_STOPPED); |
|
|
|
LCD_MESSAGEPGM(MSG_STOPPED); |
|
|
|
} |
|
|
|
} |
|
|
|
#endif // FILAMENT_RUNOUT_SENSOR
|
|
|
|
|
|
|
|
#ifdef FAST_PWM_FAN |
|
|
|
void setPwmFrequency(uint8_t pin, int val) |
|
|
|
{ |
|
|
|
|
|
|
|
void setPwmFrequency(uint8_t pin, int val) { |
|
|
|
val &= 0x07; |
|
|
|
switch(digitalPinToTimer(pin)) |
|
|
|
{ |
|
|
|
switch (digitalPinToTimer(pin)) { |
|
|
|
|
|
|
|
#if defined(TCCR0A) |
|
|
|
case TIMER0A: |
|
|
|
case TIMER0B: |
|
|
|
// TCCR0B &= ~(_BV(CS00) | _BV(CS01) | _BV(CS02));
|
|
|
|
// TCCR0B |= val;
|
|
|
|
// TCCR0B &= ~(_BV(CS00) | _BV(CS01) | _BV(CS02));
|
|
|
|
// TCCR0B |= val;
|
|
|
|
break; |
|
|
|
#endif |
|
|
|
|
|
|
|
#if defined(TCCR1A) |
|
|
|
case TIMER1A: |
|
|
|
case TIMER1B: |
|
|
|
// TCCR1B &= ~(_BV(CS10) | _BV(CS11) | _BV(CS12));
|
|
|
|
// TCCR1B |= val;
|
|
|
|
// TCCR1B &= ~(_BV(CS10) | _BV(CS11) | _BV(CS12));
|
|
|
|
// TCCR1B |= val;
|
|
|
|
break; |
|
|
|
#endif |
|
|
|
|
|
|
@ -6479,8 +6469,20 @@ void setPwmFrequency(uint8_t pin, int val) |
|
|
|
#endif |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#endif // FAST_PWM_FAN
|
|
|
|
|
|
|
|
void Stop() { |
|
|
|
disable_all_heaters(); |
|
|
|
if (IsRunning()) { |
|
|
|
Running = false; |
|
|
|
Stopped_gcode_LastN = gcode_LastN; // Save last g_code for restart
|
|
|
|
SERIAL_ERROR_START; |
|
|
|
SERIAL_ERRORLNPGM(MSG_ERR_STOPPED); |
|
|
|
LCD_MESSAGEPGM(MSG_STOPPED); |
|
|
|
} |
|
|
|
} |
|
|
|
#endif //FAST_PWM_FAN
|
|
|
|
|
|
|
|
bool setTargetedHotend(int code){ |
|
|
|
target_extruder = active_extruder; |
|
|
|