Sg load meassurement durring self test - 'Belt status'

This commit is contained in:
Robert Pelnar 2017-11-27 04:46:58 +01:00
parent efba30b77e
commit 4dae6f871e
8 changed files with 400 additions and 1659 deletions

View file

@ -9,7 +9,7 @@
// Firmware version
#define FW_version "3.0.12-RC2"
#define FW_build 111
#define FW_build 113
//#define FW_build --BUILD-NUMBER--
#define FW_version_build FW_version " b" STR(FW_build)
@ -104,6 +104,9 @@
#define EEPROM_WIZARD_ACTIVE (EEPROM_XYZ_CAL_SKEW - 1)
#define EEPROM_BELTSTATUS_X (EEPROM_WIZARD_ACTIVE - 2) //uint16
#define EEPROM_BELTSTATUS_Y (EEPROM_BELTSTATUS_X - 2) //uint16
// Currently running firmware, each digit stored as uint16_t.
// The flavor differentiates a dev, alpha, beta, release candidate or a release version.
#define EEPROM_FIRMWARE_VERSION_END (FW_PRUSA3D_MAGIC_LEN+8)

View file

@ -397,9 +397,36 @@ void dcode_12()
eeprom_update_byte((uint8_t*)EEPROM_POWER_COUNT, 0x00);
}
#include "tmc2130.h"
#include "Marlin.h"
#include "planner.h"
extern void st_synchronize();
void dcode_2130()
{
// printf("test");
printf_P(PSTR("D2130 - TMC2130\n"));
uint8_t axis = 0xff;
if (code_seen('X'))
axis = X_AXIS;
else if (code_seen('Y'))
axis = Y_AXIS;
if (axis != 0xff)
{
homeaxis(axis);
tmc2130_sg_meassure_start(axis);
memcpy(destination, current_position, sizeof(destination));
destination[axis] = 200;
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], homing_feedrate[X_AXIS]/60, active_extruder);
st_synchronize();
memcpy(destination, current_position, sizeof(destination));
destination[axis] = 0;
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], homing_feedrate[X_AXIS]/60, active_extruder);
st_synchronize();
uint16_t sg = tmc2130_sg_meassure_stop();
tmc2130_sg_meassure = 0xff;
printf_P(PSTR("Meassure avg = %d\n"), sg);
}
}
void dcode_9125()

View file

@ -4,7 +4,8 @@
use strict;
use warnings;
my @langs = ("en","cz","it","es","de");
#my @langs = ("en","cz","it","es","de");
my @langs = ("en","cz");
sub parselang
{

File diff suppressed because it is too large Load diff

View file

@ -5,9 +5,6 @@
// Language indices into their particular symbol tables.
#define LANG_ID_EN 0
#define LANG_ID_CZ 1
#define LANG_ID_IT 2
#define LANG_ID_ES 3
#define LANG_ID_DE 4
// Language is not defined and it shall be selected from the menu.
#define LANG_ID_FORCE_SELECTION 254
// Language is not defined on a virgin RAMBo board.
@ -17,7 +14,7 @@
#define LANG_ID_DEFAULT LANG_ID_CZ
// Number of languages available in the language table.
#define LANG_NUM 5
#define LANG_NUM 2
// Currectly active language selection.
extern unsigned char lang_selected;
@ -35,8 +32,8 @@ extern const char* const MSG_AMAX_LANG_TABLE[1];
#define MSG_AMAX LANG_TABLE_SELECT_EXPLICIT(MSG_AMAX_LANG_TABLE, 0)
extern const char* const MSG_AUTHOR_LANG_TABLE[1];
#define MSG_AUTHOR LANG_TABLE_SELECT_EXPLICIT(MSG_AUTHOR_LANG_TABLE, 0)
extern const char* const MSG_AUTO_HOME_LANG_TABLE[LANG_NUM];
#define MSG_AUTO_HOME LANG_TABLE_SELECT(MSG_AUTO_HOME_LANG_TABLE)
extern const char* const MSG_AUTO_HOME_LANG_TABLE[1];
#define MSG_AUTO_HOME LANG_TABLE_SELECT_EXPLICIT(MSG_AUTO_HOME_LANG_TABLE, 0)
extern const char* const MSG_A_RETRACT_LANG_TABLE[1];
#define MSG_A_RETRACT LANG_TABLE_SELECT_EXPLICIT(MSG_A_RETRACT_LANG_TABLE, 0)
extern const char* const MSG_BABYSTEPPING_X_LANG_TABLE[1];
@ -53,8 +50,8 @@ extern const char* const MSG_BABYSTEP_Z_LANG_TABLE[LANG_NUM];
#define MSG_BABYSTEP_Z LANG_TABLE_SELECT(MSG_BABYSTEP_Z_LANG_TABLE)
extern const char* const MSG_BABYSTEP_Z_NOT_SET_LANG_TABLE[LANG_NUM];
#define MSG_BABYSTEP_Z_NOT_SET LANG_TABLE_SELECT(MSG_BABYSTEP_Z_NOT_SET_LANG_TABLE)
extern const char* const MSG_BED_LANG_TABLE[LANG_NUM];
#define MSG_BED LANG_TABLE_SELECT(MSG_BED_LANG_TABLE)
extern const char* const MSG_BED_LANG_TABLE[1];
#define MSG_BED LANG_TABLE_SELECT_EXPLICIT(MSG_BED_LANG_TABLE, 0)
extern const char* const MSG_BED_CORRECTION_FRONT_LANG_TABLE[LANG_NUM];
#define MSG_BED_CORRECTION_FRONT LANG_TABLE_SELECT(MSG_BED_CORRECTION_FRONT_LANG_TABLE)
extern const char* const MSG_BED_CORRECTION_LEFT_LANG_TABLE[LANG_NUM];
@ -63,8 +60,8 @@ extern const char* const MSG_BED_CORRECTION_MENU_LANG_TABLE[LANG_NUM];
#define MSG_BED_CORRECTION_MENU LANG_TABLE_SELECT(MSG_BED_CORRECTION_MENU_LANG_TABLE)
extern const char* const MSG_BED_CORRECTION_REAR_LANG_TABLE[LANG_NUM];
#define MSG_BED_CORRECTION_REAR LANG_TABLE_SELECT(MSG_BED_CORRECTION_REAR_LANG_TABLE)
extern const char* const MSG_BED_CORRECTION_RESET_LANG_TABLE[LANG_NUM];
#define MSG_BED_CORRECTION_RESET LANG_TABLE_SELECT(MSG_BED_CORRECTION_RESET_LANG_TABLE)
extern const char* const MSG_BED_CORRECTION_RESET_LANG_TABLE[1];
#define MSG_BED_CORRECTION_RESET LANG_TABLE_SELECT_EXPLICIT(MSG_BED_CORRECTION_RESET_LANG_TABLE, 0)
extern const char* const MSG_BED_CORRECTION_RIGHT_LANG_TABLE[LANG_NUM];
#define MSG_BED_CORRECTION_RIGHT LANG_TABLE_SELECT(MSG_BED_CORRECTION_RIGHT_LANG_TABLE)
extern const char* const MSG_BED_DONE_LANG_TABLE[LANG_NUM];
@ -157,8 +154,8 @@ extern const char* const MSG_DATE_LANG_TABLE[LANG_NUM];
#define MSG_DATE LANG_TABLE_SELECT(MSG_DATE_LANG_TABLE)
extern const char* const MSG_DISABLE_STEPPERS_LANG_TABLE[LANG_NUM];
#define MSG_DISABLE_STEPPERS LANG_TABLE_SELECT(MSG_DISABLE_STEPPERS_LANG_TABLE)
extern const char* const MSG_DWELL_LANG_TABLE[LANG_NUM];
#define MSG_DWELL LANG_TABLE_SELECT(MSG_DWELL_LANG_TABLE)
extern const char* const MSG_DWELL_LANG_TABLE[1];
#define MSG_DWELL LANG_TABLE_SELECT_EXPLICIT(MSG_DWELL_LANG_TABLE, 0)
extern const char* const MSG_ENDSTOPS_HIT_LANG_TABLE[1];
#define MSG_ENDSTOPS_HIT LANG_TABLE_SELECT_EXPLICIT(MSG_ENDSTOPS_HIT_LANG_TABLE, 0)
extern const char* const MSG_ENDSTOP_HIT_LANG_TABLE[1];
@ -189,16 +186,16 @@ extern const char* const MSG_ERR_STOPPED_LANG_TABLE[1];
#define MSG_ERR_STOPPED LANG_TABLE_SELECT_EXPLICIT(MSG_ERR_STOPPED_LANG_TABLE, 0)
extern const char* const MSG_EXTERNAL_RESET_LANG_TABLE[1];
#define MSG_EXTERNAL_RESET LANG_TABLE_SELECT_EXPLICIT(MSG_EXTERNAL_RESET_LANG_TABLE, 0)
extern const char* const MSG_EXTRUDER_LANG_TABLE[LANG_NUM];
#define MSG_EXTRUDER LANG_TABLE_SELECT(MSG_EXTRUDER_LANG_TABLE)
extern const char* const MSG_EXTRUDER_1_LANG_TABLE[LANG_NUM];
#define MSG_EXTRUDER_1 LANG_TABLE_SELECT(MSG_EXTRUDER_1_LANG_TABLE)
extern const char* const MSG_EXTRUDER_2_LANG_TABLE[LANG_NUM];
#define MSG_EXTRUDER_2 LANG_TABLE_SELECT(MSG_EXTRUDER_2_LANG_TABLE)
extern const char* const MSG_EXTRUDER_3_LANG_TABLE[LANG_NUM];
#define MSG_EXTRUDER_3 LANG_TABLE_SELECT(MSG_EXTRUDER_3_LANG_TABLE)
extern const char* const MSG_EXTRUDER_4_LANG_TABLE[LANG_NUM];
#define MSG_EXTRUDER_4 LANG_TABLE_SELECT(MSG_EXTRUDER_4_LANG_TABLE)
extern const char* const MSG_EXTRUDER_LANG_TABLE[1];
#define MSG_EXTRUDER LANG_TABLE_SELECT_EXPLICIT(MSG_EXTRUDER_LANG_TABLE, 0)
extern const char* const MSG_EXTRUDER_1_LANG_TABLE[1];
#define MSG_EXTRUDER_1 LANG_TABLE_SELECT_EXPLICIT(MSG_EXTRUDER_1_LANG_TABLE, 0)
extern const char* const MSG_EXTRUDER_2_LANG_TABLE[1];
#define MSG_EXTRUDER_2 LANG_TABLE_SELECT_EXPLICIT(MSG_EXTRUDER_2_LANG_TABLE, 0)
extern const char* const MSG_EXTRUDER_3_LANG_TABLE[1];
#define MSG_EXTRUDER_3 LANG_TABLE_SELECT_EXPLICIT(MSG_EXTRUDER_3_LANG_TABLE, 0)
extern const char* const MSG_EXTRUDER_4_LANG_TABLE[1];
#define MSG_EXTRUDER_4 LANG_TABLE_SELECT_EXPLICIT(MSG_EXTRUDER_4_LANG_TABLE, 0)
extern const char* const MSG_E_CAL_KNOB_LANG_TABLE[LANG_NUM];
#define MSG_E_CAL_KNOB LANG_TABLE_SELECT(MSG_E_CAL_KNOB_LANG_TABLE)
extern const char* const MSG_Enqueing_LANG_TABLE[1];
@ -283,8 +280,8 @@ extern const char* const MSG_INSERT_FILAMENT_LANG_TABLE[LANG_NUM];
#define MSG_INSERT_FILAMENT LANG_TABLE_SELECT(MSG_INSERT_FILAMENT_LANG_TABLE)
extern const char* const MSG_INVALID_EXTRUDER_LANG_TABLE[1];
#define MSG_INVALID_EXTRUDER LANG_TABLE_SELECT_EXPLICIT(MSG_INVALID_EXTRUDER_LANG_TABLE, 0)
extern const char* const MSG_KILLED_LANG_TABLE[LANG_NUM];
#define MSG_KILLED LANG_TABLE_SELECT(MSG_KILLED_LANG_TABLE)
extern const char* const MSG_KILLED_LANG_TABLE[1];
#define MSG_KILLED LANG_TABLE_SELECT_EXPLICIT(MSG_KILLED_LANG_TABLE, 0)
extern const char* const MSG_LANGUAGE_NAME_LANG_TABLE[LANG_NUM];
#define MSG_LANGUAGE_NAME LANG_TABLE_SELECT(MSG_LANGUAGE_NAME_LANG_TABLE)
#define MSG_LANGUAGE_NAME_EXPLICIT(LANG) LANG_TABLE_SELECT_EXPLICIT(MSG_LANGUAGE_NAME_LANG_TABLE, LANG)
@ -345,8 +342,8 @@ extern const char* const MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE2_LANG_TABLE[LANG_
#define MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE2 LANG_TABLE_SELECT(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE2_LANG_TABLE)
extern const char* const MSG_MENU_CALIBRATION_LANG_TABLE[LANG_NUM];
#define MSG_MENU_CALIBRATION LANG_TABLE_SELECT(MSG_MENU_CALIBRATION_LANG_TABLE)
extern const char* const MSG_MESH_BED_LEVELING_LANG_TABLE[LANG_NUM];
#define MSG_MESH_BED_LEVELING LANG_TABLE_SELECT(MSG_MESH_BED_LEVELING_LANG_TABLE)
extern const char* const MSG_MESH_BED_LEVELING_LANG_TABLE[1];
#define MSG_MESH_BED_LEVELING LANG_TABLE_SELECT_EXPLICIT(MSG_MESH_BED_LEVELING_LANG_TABLE, 0)
extern const char* const MSG_MIN_LANG_TABLE[1];
#define MSG_MIN LANG_TABLE_SELECT_EXPLICIT(MSG_MIN_LANG_TABLE, 0)
extern const char* const MSG_MOTION_LANG_TABLE[1];
@ -363,8 +360,8 @@ extern const char* const MSG_MOVE_CARRIAGE_TO_THE_TOP_LANG_TABLE[LANG_NUM];
#define MSG_MOVE_CARRIAGE_TO_THE_TOP LANG_TABLE_SELECT(MSG_MOVE_CARRIAGE_TO_THE_TOP_LANG_TABLE)
extern const char* const MSG_MOVE_CARRIAGE_TO_THE_TOP_Z_LANG_TABLE[LANG_NUM];
#define MSG_MOVE_CARRIAGE_TO_THE_TOP_Z LANG_TABLE_SELECT(MSG_MOVE_CARRIAGE_TO_THE_TOP_Z_LANG_TABLE)
extern const char* const MSG_MOVE_E_LANG_TABLE[LANG_NUM];
#define MSG_MOVE_E LANG_TABLE_SELECT(MSG_MOVE_E_LANG_TABLE)
extern const char* const MSG_MOVE_E_LANG_TABLE[1];
#define MSG_MOVE_E LANG_TABLE_SELECT_EXPLICIT(MSG_MOVE_E_LANG_TABLE, 0)
extern const char* const MSG_MOVE_X_LANG_TABLE[LANG_NUM];
#define MSG_MOVE_X LANG_TABLE_SELECT(MSG_MOVE_X_LANG_TABLE)
extern const char* const MSG_MOVE_Y_LANG_TABLE[LANG_NUM];
@ -389,8 +386,8 @@ extern const char* const MSG_NOZZLE2_LANG_TABLE[1];
#define MSG_NOZZLE2 LANG_TABLE_SELECT_EXPLICIT(MSG_NOZZLE2_LANG_TABLE, 0)
extern const char* const MSG_NO_CARD_LANG_TABLE[LANG_NUM];
#define MSG_NO_CARD LANG_TABLE_SELECT(MSG_NO_CARD_LANG_TABLE)
extern const char* const MSG_NO_MOVE_LANG_TABLE[LANG_NUM];
#define MSG_NO_MOVE LANG_TABLE_SELECT(MSG_NO_MOVE_LANG_TABLE)
extern const char* const MSG_NO_MOVE_LANG_TABLE[1];
#define MSG_NO_MOVE LANG_TABLE_SELECT_EXPLICIT(MSG_NO_MOVE_LANG_TABLE, 0)
extern const char* const MSG_OFF_LANG_TABLE[1];
#define MSG_OFF LANG_TABLE_SELECT_EXPLICIT(MSG_OFF_LANG_TABLE, 0)
extern const char* const MSG_OK_LANG_TABLE[1];
@ -507,14 +504,14 @@ extern const char* const MSG_SD_WORKDIR_FAIL_LANG_TABLE[1];
#define MSG_SD_WORKDIR_FAIL LANG_TABLE_SELECT_EXPLICIT(MSG_SD_WORKDIR_FAIL_LANG_TABLE, 0)
extern const char* const MSG_SD_WRITE_TO_FILE_LANG_TABLE[1];
#define MSG_SD_WRITE_TO_FILE LANG_TABLE_SELECT_EXPLICIT(MSG_SD_WRITE_TO_FILE_LANG_TABLE, 0)
extern const char* const MSG_SELFTEST_LANG_TABLE[LANG_NUM];
#define MSG_SELFTEST LANG_TABLE_SELECT(MSG_SELFTEST_LANG_TABLE)
extern const char* const MSG_SELFTEST_LANG_TABLE[1];
#define MSG_SELFTEST LANG_TABLE_SELECT_EXPLICIT(MSG_SELFTEST_LANG_TABLE, 0)
extern const char* const MSG_SELFTEST_AXIS_LANG_TABLE[1];
#define MSG_SELFTEST_AXIS LANG_TABLE_SELECT_EXPLICIT(MSG_SELFTEST_AXIS_LANG_TABLE, 0)
extern const char* const MSG_SELFTEST_AXIS_LENGTH_LANG_TABLE[1];
#define MSG_SELFTEST_AXIS_LENGTH LANG_TABLE_SELECT_EXPLICIT(MSG_SELFTEST_AXIS_LENGTH_LANG_TABLE, 0)
extern const char* const MSG_SELFTEST_BEDHEATER_LANG_TABLE[LANG_NUM];
#define MSG_SELFTEST_BEDHEATER LANG_TABLE_SELECT(MSG_SELFTEST_BEDHEATER_LANG_TABLE)
extern const char* const MSG_SELFTEST_BEDHEATER_LANG_TABLE[1];
#define MSG_SELFTEST_BEDHEATER LANG_TABLE_SELECT_EXPLICIT(MSG_SELFTEST_BEDHEATER_LANG_TABLE, 0)
extern const char* const MSG_SELFTEST_CHECK_ALLCORRECT_LANG_TABLE[LANG_NUM];
#define MSG_SELFTEST_CHECK_ALLCORRECT LANG_TABLE_SELECT(MSG_SELFTEST_CHECK_ALLCORRECT_LANG_TABLE)
extern const char* const MSG_SELFTEST_CHECK_BED_LANG_TABLE[LANG_NUM];
@ -531,14 +528,14 @@ extern const char* const MSG_SELFTEST_CHECK_Z_LANG_TABLE[LANG_NUM];
#define MSG_SELFTEST_CHECK_Z LANG_TABLE_SELECT(MSG_SELFTEST_CHECK_Z_LANG_TABLE)
extern const char* const MSG_SELFTEST_COOLING_FAN_LANG_TABLE[LANG_NUM];
#define MSG_SELFTEST_COOLING_FAN LANG_TABLE_SELECT(MSG_SELFTEST_COOLING_FAN_LANG_TABLE)
extern const char* const MSG_SELFTEST_ENDSTOP_LANG_TABLE[LANG_NUM];
#define MSG_SELFTEST_ENDSTOP LANG_TABLE_SELECT(MSG_SELFTEST_ENDSTOP_LANG_TABLE)
extern const char* const MSG_SELFTEST_ENDSTOPS_LANG_TABLE[LANG_NUM];
#define MSG_SELFTEST_ENDSTOPS LANG_TABLE_SELECT(MSG_SELFTEST_ENDSTOPS_LANG_TABLE)
extern const char* const MSG_SELFTEST_ENDSTOP_NOTHIT_LANG_TABLE[LANG_NUM];
#define MSG_SELFTEST_ENDSTOP_NOTHIT LANG_TABLE_SELECT(MSG_SELFTEST_ENDSTOP_NOTHIT_LANG_TABLE)
extern const char* const MSG_SELFTEST_ERROR_LANG_TABLE[LANG_NUM];
#define MSG_SELFTEST_ERROR LANG_TABLE_SELECT(MSG_SELFTEST_ERROR_LANG_TABLE)
extern const char* const MSG_SELFTEST_ENDSTOP_LANG_TABLE[1];
#define MSG_SELFTEST_ENDSTOP LANG_TABLE_SELECT_EXPLICIT(MSG_SELFTEST_ENDSTOP_LANG_TABLE, 0)
extern const char* const MSG_SELFTEST_ENDSTOPS_LANG_TABLE[1];
#define MSG_SELFTEST_ENDSTOPS LANG_TABLE_SELECT_EXPLICIT(MSG_SELFTEST_ENDSTOPS_LANG_TABLE, 0)
extern const char* const MSG_SELFTEST_ENDSTOP_NOTHIT_LANG_TABLE[1];
#define MSG_SELFTEST_ENDSTOP_NOTHIT LANG_TABLE_SELECT_EXPLICIT(MSG_SELFTEST_ENDSTOP_NOTHIT_LANG_TABLE, 0)
extern const char* const MSG_SELFTEST_ERROR_LANG_TABLE[1];
#define MSG_SELFTEST_ERROR LANG_TABLE_SELECT_EXPLICIT(MSG_SELFTEST_ERROR_LANG_TABLE, 0)
extern const char* const MSG_SELFTEST_EXTRUDER_FAN_LANG_TABLE[LANG_NUM];
#define MSG_SELFTEST_EXTRUDER_FAN LANG_TABLE_SELECT(MSG_SELFTEST_EXTRUDER_FAN_LANG_TABLE)
extern const char* const MSG_SELFTEST_FAILED_LANG_TABLE[LANG_NUM];
@ -549,18 +546,18 @@ extern const char* const MSG_SELFTEST_FAN_NO_LANG_TABLE[LANG_NUM];
#define MSG_SELFTEST_FAN_NO LANG_TABLE_SELECT(MSG_SELFTEST_FAN_NO_LANG_TABLE)
extern const char* const MSG_SELFTEST_FAN_YES_LANG_TABLE[LANG_NUM];
#define MSG_SELFTEST_FAN_YES LANG_TABLE_SELECT(MSG_SELFTEST_FAN_YES_LANG_TABLE)
extern const char* const MSG_SELFTEST_HEATERTHERMISTOR_LANG_TABLE[LANG_NUM];
#define MSG_SELFTEST_HEATERTHERMISTOR LANG_TABLE_SELECT(MSG_SELFTEST_HEATERTHERMISTOR_LANG_TABLE)
extern const char* const MSG_SELFTEST_MOTOR_LANG_TABLE[LANG_NUM];
#define MSG_SELFTEST_MOTOR LANG_TABLE_SELECT(MSG_SELFTEST_MOTOR_LANG_TABLE)
extern const char* const MSG_SELFTEST_HEATERTHERMISTOR_LANG_TABLE[1];
#define MSG_SELFTEST_HEATERTHERMISTOR LANG_TABLE_SELECT_EXPLICIT(MSG_SELFTEST_HEATERTHERMISTOR_LANG_TABLE, 0)
extern const char* const MSG_SELFTEST_MOTOR_LANG_TABLE[1];
#define MSG_SELFTEST_MOTOR LANG_TABLE_SELECT_EXPLICIT(MSG_SELFTEST_MOTOR_LANG_TABLE, 0)
extern const char* const MSG_SELFTEST_NOTCONNECTED_LANG_TABLE[LANG_NUM];
#define MSG_SELFTEST_NOTCONNECTED LANG_TABLE_SELECT(MSG_SELFTEST_NOTCONNECTED_LANG_TABLE)
extern const char* const MSG_SELFTEST_OK_LANG_TABLE[LANG_NUM];
#define MSG_SELFTEST_OK LANG_TABLE_SELECT(MSG_SELFTEST_OK_LANG_TABLE)
extern const char* const MSG_SELFTEST_OK_LANG_TABLE[1];
#define MSG_SELFTEST_OK LANG_TABLE_SELECT_EXPLICIT(MSG_SELFTEST_OK_LANG_TABLE, 0)
extern const char* const MSG_SELFTEST_PLEASECHECK_LANG_TABLE[LANG_NUM];
#define MSG_SELFTEST_PLEASECHECK LANG_TABLE_SELECT(MSG_SELFTEST_PLEASECHECK_LANG_TABLE)
extern const char* const MSG_SELFTEST_START_LANG_TABLE[LANG_NUM];
#define MSG_SELFTEST_START LANG_TABLE_SELECT(MSG_SELFTEST_START_LANG_TABLE)
extern const char* const MSG_SELFTEST_START_LANG_TABLE[1];
#define MSG_SELFTEST_START LANG_TABLE_SELECT_EXPLICIT(MSG_SELFTEST_START_LANG_TABLE, 0)
extern const char* const MSG_SELFTEST_WIRINGERROR_LANG_TABLE[LANG_NUM];
#define MSG_SELFTEST_WIRINGERROR LANG_TABLE_SELECT(MSG_SELFTEST_WIRINGERROR_LANG_TABLE)
extern const char* const MSG_SERIAL_ERROR_MENU_STRUCTURE_LANG_TABLE[1];
@ -603,8 +600,8 @@ extern const char* const MSG_STEEL_SHEET_CHECK_LANG_TABLE[1];
#define MSG_STEEL_SHEET_CHECK LANG_TABLE_SELECT_EXPLICIT(MSG_STEEL_SHEET_CHECK_LANG_TABLE, 0)
extern const char* const MSG_STEPPER_TOO_HIGH_LANG_TABLE[1];
#define MSG_STEPPER_TOO_HIGH LANG_TABLE_SELECT_EXPLICIT(MSG_STEPPER_TOO_HIGH_LANG_TABLE, 0)
extern const char* const MSG_STOPPED_LANG_TABLE[LANG_NUM];
#define MSG_STOPPED LANG_TABLE_SELECT(MSG_STOPPED_LANG_TABLE)
extern const char* const MSG_STOPPED_LANG_TABLE[1];
#define MSG_STOPPED LANG_TABLE_SELECT_EXPLICIT(MSG_STOPPED_LANG_TABLE, 0)
extern const char* const MSG_STOP_PRINT_LANG_TABLE[LANG_NUM];
#define MSG_STOP_PRINT LANG_TABLE_SELECT(MSG_STOP_PRINT_LANG_TABLE)
extern const char* const MSG_STORE_EPROM_LANG_TABLE[1];
@ -627,10 +624,10 @@ extern const char* const MSG_TEMP_CALIBRATION_OFF_LANG_TABLE[LANG_NUM];
#define MSG_TEMP_CALIBRATION_OFF LANG_TABLE_SELECT(MSG_TEMP_CALIBRATION_OFF_LANG_TABLE)
extern const char* const MSG_TEMP_CALIBRATION_ON_LANG_TABLE[LANG_NUM];
#define MSG_TEMP_CALIBRATION_ON LANG_TABLE_SELECT(MSG_TEMP_CALIBRATION_ON_LANG_TABLE)
extern const char* const MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY_OFF_LANG_TABLE[LANG_NUM];
#define MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY_OFF LANG_TABLE_SELECT(MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY_OFF_LANG_TABLE)
extern const char* const MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY_ON_LANG_TABLE[LANG_NUM];
#define MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY_ON LANG_TABLE_SELECT(MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY_ON_LANG_TABLE)
extern const char* const MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY_OFF_LANG_TABLE[1];
#define MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY_OFF LANG_TABLE_SELECT_EXPLICIT(MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY_OFF_LANG_TABLE, 0)
extern const char* const MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY_ON_LANG_TABLE[1];
#define MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY_ON LANG_TABLE_SELECT_EXPLICIT(MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY_ON_LANG_TABLE, 0)
extern const char* const MSG_TUNE_LANG_TABLE[LANG_NUM];
#define MSG_TUNE LANG_TABLE_SELECT(MSG_TUNE_LANG_TABLE)
extern const char* const MSG_UNKNOWN_COMMAND_LANG_TABLE[1];
@ -653,8 +650,8 @@ extern const char* const MSG_USB_PRINTING_LANG_TABLE[LANG_NUM];
#define MSG_USB_PRINTING LANG_TABLE_SELECT(MSG_USB_PRINTING_LANG_TABLE)
extern const char* const MSG_USED_LANG_TABLE[LANG_NUM];
#define MSG_USED LANG_TABLE_SELECT(MSG_USED_LANG_TABLE)
extern const char* const MSG_USERWAIT_LANG_TABLE[LANG_NUM];
#define MSG_USERWAIT LANG_TABLE_SELECT(MSG_USERWAIT_LANG_TABLE)
extern const char* const MSG_USERWAIT_LANG_TABLE[1];
#define MSG_USERWAIT LANG_TABLE_SELECT_EXPLICIT(MSG_USERWAIT_LANG_TABLE, 0)
extern const char* const MSG_V2_CALIBRATION_LANG_TABLE[LANG_NUM];
#define MSG_V2_CALIBRATION LANG_TABLE_SELECT(MSG_V2_CALIBRATION_LANG_TABLE)
extern const char* const MSG_VMIN_LANG_TABLE[1];

View file

@ -56,6 +56,11 @@ uint32_t tmc2130_sg_pos[4] = {0, 0, 0, 0};
uint8_t sg_homing_axes_mask = 0x00;
uint8_t tmc2130_sg_meassure = 0xff;
uint16_t tmc2130_sg_meassure_cnt = 0;
uint32_t tmc2130_sg_meassure_val = 0;
bool tmc2130_sg_stop_on_crash = true;
bool tmc2130_sg_crash = false;
uint8_t tmc2130_diag_mask = 0x00;
@ -285,7 +290,16 @@ bool tmc2130_update_sg()
// uint16_t tstep = tmc2130_rd_TSTEP(tmc2130_cs[0]);
// MYSERIAL.print("TSTEP_X=");
// MYSERIAL.println((int)tstep);
if (tmc2130_sg_meassure <= E_AXIS)
{
uint8_t cs = tmc2130_cs[tmc2130_sg_meassure];
uint16_t sg = tmc2130_rd_DRV_STATUS(cs) & 0x3ff;
tmc2130_sg_meassure_val += sg;
tmc2130_sg_meassure_cnt++;
// printf_P(PSTR("tmc2130_update_sg - meassure - sg=%d\n"), sg);
return true;
}
#ifdef TMC2130_SG_HOMING_SW_XY
if (sg_homing_axes_mask & X_AXIS_MASK) tmc2130_update_sg_axis(X_AXIS);
if (sg_homing_axes_mask & Y_AXIS_MASK) tmc2130_update_sg_axis(Y_AXIS);
@ -430,6 +444,20 @@ void tmc2130_home_restart(uint8_t axis)
tmc2130_axis_stalled[axis] = false;
}
void tmc2130_sg_meassure_start(uint8_t axis)
{
tmc2130_sg_meassure = axis;
tmc2130_sg_meassure_cnt = 0;
tmc2130_sg_meassure_val = 0;
}
uint16_t tmc2130_sg_meassure_stop()
{
tmc2130_sg_meassure = 0xff;
return tmc2130_sg_meassure_val / tmc2130_sg_meassure_cnt;
}
bool tmc2130_wait_standstill_xy(int timeout)
{
// MYSERIAL.println("tmc2130_wait_standstill_xy");
@ -741,11 +769,11 @@ uint8_t tmc2130_txrx(uint8_t cs, uint8_t addr, uint32_t wval, uint32_t* rval)
void tmc2130_eeprom_load_config()
{
}
void tmc2130_eeprom_save_config()
{
}

View file

@ -16,6 +16,9 @@ extern uint8_t tmc2130_sg_thr[4];
extern bool tmc2130_sg_stop_on_crash;
extern bool tmc2130_sg_crash;
extern uint8_t tmc2130_sg_meassure;
extern uint16_t tmc2130_sg_meassure_cnt;
extern uint32_t tmc2130_sg_meassure_val;
#define TMC2130_MODE_NORMAL 0
#define TMC2130_MODE_SILENT 1
@ -35,6 +38,12 @@ extern void tmc2130_home_exit();
//restart homing (called from homeaxis befor move)
extern void tmc2130_home_restart(uint8_t axis);
//start stallguard meassuring for single axis
extern void tmc2130_sg_meassure_start(uint8_t axis);
//stop current stallguard meassuring and report result
extern uint16_t tmc2130_sg_meassure_stop();
//set holding current for any axis (M911)
extern void tmc2130_set_current_h(uint8_t axis, uint8_t current);
//set running current for any axis (M912)

View file

@ -1530,6 +1530,8 @@ static void lcd_menu_fails_stats()
static void lcd_menu_temperatures()
{
fprintf_P(lcdout, PSTR(ESC_H(1,1) "Ambient: %d%c" ESC_H(1,2) "PINDA: %d%c"), (int)current_temperature_ambient, '\x01', (int)current_temperature_pinda, '\x01');
/*
lcd.setCursor(1, 1);
lcd.print("Ambient: ");
lcd.setCursor(12, 1);
@ -1539,7 +1541,17 @@ static void lcd_menu_temperatures()
lcd.print("PINDA: ");
lcd.setCursor(12, 2);
lcd.print(ftostr31ns(current_temperature_pinda));
lcd.print(LCD_STR_DEGREE);
lcd.print(LCD_STR_DEGREE);*/
if (lcd_clicked())
{
lcd_quick_feedback();
lcd_return_to_status();
}
}
static void lcd_menu_belt_status()
{
fprintf_P(lcdout, PSTR(ESC_H(1,0) "Belt status" ESC_H(2,1) "X %d" ESC_H(2,2) "Y %d" ), eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X)), eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y)));
if (lcd_clicked())
{
lcd_quick_feedback();
@ -1636,6 +1648,7 @@ static void lcd_support_menu()
if (!IS_SD_PRINTING && !is_usb_printing) MENU_ITEM(function, MSG_XYZ_DETAILS, lcd_service_mode_show_result);
MENU_ITEM(submenu, MSG_INFO_EXTRUDER, lcd_menu_extruder_info);
MENU_ITEM(submenu, PSTR("Belt status"), lcd_menu_belt_status);
MENU_ITEM(submenu, PSTR("Temperatures"), lcd_menu_temperatures);
if (fans_check_enabled == true) {
@ -5477,9 +5490,8 @@ static bool lcd_selfcheck_axis_sg(char axis) {
tmc2130_home_exit();
}
// first axis length measurement begin
tmc2130_home_enter(X_AXIS_MASK << axis);
current_position[axis] -= (axis_length + margin);
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
@ -5488,11 +5500,14 @@ static bool lcd_selfcheck_axis_sg(char axis) {
st_synchronize();
tmc2130_home_exit();
tmc2130_sg_meassure_start(axis);
current_position_init = st_get_position_mm(axis);
current_position[axis] += 2 * margin;
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
st_synchronize();
current_position[axis] += axis_length;
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
@ -5500,11 +5515,17 @@ static bool lcd_selfcheck_axis_sg(char axis) {
st_synchronize();
tmc2130_home_exit();
uint16_t sg1 = tmc2130_sg_meassure_stop();
printf_P(PSTR("%c AXIS SG1=%d\n"), 'X'+axis, sg1);
eeprom_write_word(((uint16_t*)((axis == X_AXIS)?EEPROM_BELTSTATUS_X:EEPROM_BELTSTATUS_Y)), sg1);
current_position_final = st_get_position_mm(axis);
measured_axis_length[0] = abs(current_position_final - current_position_init);
// first measurement end and second measurement begin
current_position[axis] -= margin;
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[3], manual_feedrate[0] / 60, active_extruder);
st_synchronize();
@ -5519,7 +5540,8 @@ static bool lcd_selfcheck_axis_sg(char axis) {
current_position_init = st_get_position_mm(axis);
measured_axis_length[1] = abs(current_position_final - current_position_init);
//end of second measurement, now check for possible errors:
for(int i = 0; i < 2; i++){ //check if measured axis length corresponds to expected length