Commit 3de15132 authored by MagoKimbra's avatar MagoKimbra

Add motor to firmware test

parent 91ba54ae
......@@ -4,7 +4,7 @@
// User-specified version info of this build to display in [Pronterface, etc] terminal window during
// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
// build by the user have been successfully uploaded into firmware.
#define STRING_VERSION_CONFIG_H __DATE__ " 23/10/2014 " __TIME__ // build date and time
#define STRING_VERSION_CONFIG_H __DATE__ " 24/11/2014 " __TIME__ // build date and time
#define STRING_CONFIG_H_AUTHOR "(MagoKimbra: magokimbra@hotmail.com, Version 4.0)" // Who made the changes.
// SERIAL_PORT selects which serial port should be used for communication with the host.
......
......@@ -142,7 +142,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
// these are the offsets to the probe relative to the extruder tip (Hotend - Probe)
#define X_PROBE_OFFSET_FROM_EXTRUDER 0
#define Y_PROBE_OFFSET_FROM_EXTRUDER 20
#define Z_PROBE_OFFSET_FROM_EXTRUDER -2.95
#define Z_PROBE_OFFSET_FROM_EXTRUDER -3.10
#define Z_RAISE_BEFORE_HOMING 10 // (in mm) Raise Z before homing (G28) for Probe Clearance.
// Be sure you have this distance over your Z_MAX_POS in case
......
......@@ -5936,12 +5936,14 @@ void FirmwareTest(){
SERIAL_ECHOLN("--------- by MarlinKimbra -------------");
SERIAL_ECHOLN(" ");
SERIAL_ECHOLN(MSG_FWTEST_01);
SERIAL_ECHOLN(MSG_FWTEST_YES);
SERIAL_ECHOLN(MSG_FWTEST_02);
SERIAL_ECHOLN(MSG_FWTEST_YES_NO);
serial_char = MYSERIAL.read();
while(serial_char!='Y'){
while(serial_char!='y' && serial_char!='Y' && serial_char!='n' && serial_char!='N'){
serial_char = MYSERIAL.read();
}
SERIAL_ECHOLN(MSG_FWTEST_02);
if (serial_char=='y' || serial_char=='Y'){
SERIAL_ECHOLN(MSG_FWTEST_03);
SERIAL_ECHOLN(" ");
SERIAL_ECHOLN("***** ENDSTOP X *****");
#if defined(X_MIN_PIN) && X_MIN_PIN > -1 && X_HOME_DIR == -1
......@@ -5956,17 +5958,18 @@ void FirmwareTest(){
else
{
SERIAL_ECHOLN("X ENDSTOP ERROR");
SERIAL_ECHO(MSG_FWTEST_INVERT);
#if X_HOME_DIR == -1
SERIAL_ECHOLN("Invertire valore in #define X_MIN_ENDSTOP_INVERTING");
SERIAL_ECHOLN("#define X_MIN_ENDSTOP_INVERTING");
#else
SERIAL_ECHOLN("Invertire valore in #define X_MAX_ENDSTOP_INVERTING");
SERIAL_ECHOLN("#define X_MAX_ENDSTOP_INVERTING");
#endif
return;
}
SERIAL_ECHOLN("Premere e tenere premuto l'endstop X.");
SERIAL_ECHOLN(MSG_FWTEST_YES);
serial_char = MYSERIAL.read();
while(serial_char!='Y'){
while(serial_char!='y' && serial_char!='Y'){
serial_char = MYSERIAL.read();
}
#if defined(X_MIN_PIN) && X_MIN_PIN > -1 && X_HOME_DIR == -1
......@@ -5998,17 +6001,18 @@ void FirmwareTest(){
else
{
SERIAL_ECHOLN("Y ENDSTOP ERROR");
SERIAL_ECHO(MSG_FWTEST_INVERT);
#if Y_HOME_DIR == -1
SERIAL_ECHOLN("Invertire valore in #define Y_MIN_ENDSTOP_INVERTING");
SERIAL_ECHOLN("#define Y_MIN_ENDSTOP_INVERTING");
#else
SERIAL_ECHOLN("Invertire valore in #define Y_MAX_ENDSTOP_INVERTING");
SERIAL_ECHOLN("#define Y_MAX_ENDSTOP_INVERTING");
#endif
return;
}
SERIAL_ECHOLN("Premere e tenere premuto l'endstop Y.");
SERIAL_ECHOLN(MSG_FWTEST_YES);
serial_char = MYSERIAL.read();
while(serial_char!='Y'){
while(serial_char!='y' && serial_char!='Y'){
serial_char = MYSERIAL.read();
}
#if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 && Y_HOME_DIR == -1
......@@ -6040,17 +6044,18 @@ void FirmwareTest(){
else
{
SERIAL_ECHOLN("Z ENDSTOP ERROR");
SERIAL_ECHO(MSG_FWTEST_INVERT);
#if Z_HOME_DIR == -1
SERIAL_ECHOLN("Invertire valore in #define Z_MIN_ENDSTOP_INVERTING");
SERIAL_ECHOLN("#define Z_MIN_ENDSTOP_INVERTING");
#else
SERIAL_ECHOLN("Invertire valore in #define Z_MAX_ENDSTOP_INVERTING");
SERIAL_ECHOLN("#define Z_MAX_ENDSTOP_INVERTING");
#endif
return;
}
SERIAL_ECHOLN("Premere e tenere premuto l'endstop Z.");
SERIAL_ECHOLN(MSG_FWTEST_YES);
serial_char = MYSERIAL.read();
while(serial_char!='Y'){
while(serial_char!='y' && serial_char!='Y'){
serial_char = MYSERIAL.read();
}
#if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 && Z_HOME_DIR == -1
......@@ -6070,8 +6075,84 @@ void FirmwareTest(){
}
SERIAL_ECHOLN("ENDSTOP OK");
SERIAL_ECHOLN(" ");
SERIAL_ECHOLN("TEST MOTOR SOON");
}
SERIAL_ECHOLN("***** TEST MOTOR *****");
SERIAL_ECHOLN(MSG_FWTEST_ATTENTION);
SERIAL_ECHOLN(MSG_FWTEST_YES);
serial_char = MYSERIAL.read();
while(serial_char!='y' && serial_char!='Y'){
serial_char = MYSERIAL.read();
}
SERIAL_ECHOLN(MSG_FWTEST_04);
SERIAL_ECHOLN(" ");
SERIAL_ECHOLN("***** MOTOR X *****");
#if defined(PS_ON_PIN) && PS_ON_PIN > -1
SET_OUTPUT(PS_ON_PIN);
WRITE(PS_ON_PIN, PS_ON_AWAKE);
#endif
st_synchronize();
for(int8_t i=0; i < NUM_AXIS; i++) current_position[i] = 0;
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
destination[X_AXIS] = current_position[X_AXIS] + 5;
prepare_move();
st_synchronize();
SERIAL_ECHOLN(MSG_FWTEST_XAXIS);
SERIAL_ECHOLN(MSG_FWTEST_YES_NO);
serial_char = MYSERIAL.read();
while(serial_char!='y' && serial_char!='Y' && serial_char!='n' && serial_char!='N'){
serial_char = MYSERIAL.read();
}
if(serial_char=='y' || serial_char=='Y'){
SERIAL_ECHOLN("MOTOR X OK");
}
else
{
SERIAL_ECHO(MSG_FWTEST_INVERT);
SERIAL_ECHOLN("#define INVERT_X_DIR");
return;
}
SERIAL_ECHOLN(" ");
SERIAL_ECHOLN("***** MOTOR Y *****");
destination[Y_AXIS] = current_position[Y_AXIS] + 5;
prepare_move();
st_synchronize();
SERIAL_ECHOLN(MSG_FWTEST_YAXIS);
SERIAL_ECHOLN(MSG_FWTEST_YES_NO);
serial_char = MYSERIAL.read();
while(serial_char!='y' && serial_char!='Y' && serial_char!='n' && serial_char!='N'){
serial_char = MYSERIAL.read();
}
if(serial_char=='y' || serial_char=='Y'){
SERIAL_ECHOLN("MOTOR Y OK");
}
else
{
SERIAL_ECHO(MSG_FWTEST_INVERT);
SERIAL_ECHOLN("#define INVERT_Y_DIR");
return;
}
SERIAL_ECHOLN(" ");
SERIAL_ECHOLN("***** MOTOR Z *****");
destination[Z_AXIS] = current_position[Z_AXIS] + 5;
prepare_move();
st_synchronize();
SERIAL_ECHOLN(MSG_FWTEST_ZAXIS);
SERIAL_ECHOLN(MSG_FWTEST_YES_NO);
serial_char = MYSERIAL.read();
while(serial_char!='y' && serial_char!='Y' && serial_char!='n' && serial_char!='N'){
serial_char = MYSERIAL.read();
}
if(serial_char=='y' || serial_char=='Y'){
SERIAL_ECHOLN("MOTOR Z OK");
}
else
{
SERIAL_ECHO(MSG_FWTEST_INVERT);
SERIAL_ECHOLN("#define INVERT_Z_DIR");
return;
}
SERIAL_ECHOLN("MOTOR OK");
SERIAL_ECHOLN(" ");
}
#endif //FIRMWARE_TEST
......
......@@ -285,12 +285,20 @@
#define MSG_BAUDRATE "Baudrate"
#ifdef FIRMWARE_TEST
#define MSG_FWTEST_YES "Put the Y command to go forward"
#define MSG_FWTEST_NO "Put the N command to go forward"
#define MSG_FWTEST_YES "Put the Y command to go next"
#define MSG_FWTEST_NO "Put the N command to go next"
#define MSG_FWTEST_YES_NO "Put the Y or N command to go next"
#define MSG_FWTEST_ENDSTOP_ERR "ENDSTOP ERROR! Check wire and connection"
#define MSG_FWTEST_INVERT "Reverse value in "
#define MSG_FWTEST_XAXIS "Has the nozzle moved to the right?"
#define MSG_FWTEST_YAXIS "Has the nozzle moved forward?"
#define MSG_FWTEST_ZAXIS "Has the nozzle moved up?"
#define MSG_FWTEST_01 "Manually move the axes X, Y and Z away from the endstop"
#define MSG_FWTEST_02 "Start check ENDSTOP"
#endif
#define MSG_FWTEST_02 "Do you want check ENDSTOP?"
#define MSG_FWTEST_03 "Start check ENDSTOP"
#define MSG_FWTEST_04 "Start check MOTOR"
#define MSG_FWTEST_ATTENTION "ATTENTION! Check that the three axes are more than 5 mm from the endstop!"
#endif // FIRMWARE_TEST
#endif
......@@ -1004,16 +1012,16 @@
#define MSG_EXTRUDE "Estrudi"
#define MSG_RETRACT "Ritrai"
#define MSG_MOVE_AXIS "Muovi Asse"
#define MSG_MOVE_X "Move X"
#define MSG_MOVE_Y "Move Y"
#define MSG_MOVE_Z "Move Z"
#define MSG_MOVE_X "Muovi X"
#define MSG_MOVE_Y "Muovi Y"
#define MSG_MOVE_Z "Muovi Z"
#define MSG_MOVE_E "Extruder"
#define MSG_MOVE_E1 "Extruder2"
#define MSG_MOVE_E2 "Extruder3"
#define MSG_MOVE_E3 "Extruder4"
#define MSG_MOVE_01MM "Move 0.1mm"
#define MSG_MOVE_1MM "Move 1mm"
#define MSG_MOVE_10MM "Move 10mm"
#define MSG_MOVE_01MM "Muovi 0.1mm"
#define MSG_MOVE_1MM "Muovi 1mm"
#define MSG_MOVE_10MM "Muovi 10mm"
#define MSG_SPEED "Velcit�"
#define MSG_NOZZLE "Ugello"
#define MSG_NOZZLE1 "Ugello2"
......@@ -1102,9 +1110,17 @@
#ifdef FIRMWARE_TEST
#define MSG_FWTEST_YES "Dai il comando Y per andare avanti"
#define MSG_FWTEST_NO "Dai il comando N per andare avanti"
#define MSG_FWTEST_YES_NO "Dai il comando Y o N per andare avanti"
#define MSG_FWTEST_ENDSTOP_ERR "ENDSTOP ERROR! Controllare cavi e connessioni"
#define MSG_FWTEST_INVERT "Invertire valore in "
#define MSG_FWTEST_XAXIS "Il nozzle si e' spostato a destra?"
#define MSG_FWTEST_YAXIS "Il nozzle si e' spostato in avanti"
#define MSG_FWTEST_ZAXIS "Il nozzle si e' spostato in alto"
#define MSG_FWTEST_01 "Muovi manualmente gli assi X, Y e Z lontano dagli endstop"
#define MSG_FWTEST_02 "Inizio controllo ENDSTOP"
#define MSG_FWTEST_02 "Vuoi controllare gli ENDSTOP?"
#define MSG_FWTEST_03 "Inizio controllo ENDSTOP"
#define MSG_FWTEST_04 "Inizio controllo MOTORI"
#define MSG_FWTEST_ATTENTION "ATTENZIONE! Controlla che i tre assi siano a piu' di 5 mm dagli endstop!"
#endif // FIRMWARE_TEST
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment