Arbitrary change of direction and scale problems
November 08, 2023 03:13AM
Hi everybody,

i’m new to 3D printing but familiar with code and Arduino.
I’ve bought a used 3D Printer (HiPrecy LEO S1) and, after some test prints, i decided to upgrade the firmware (Marlin) but now i’ve go some strange errors while printing:

- the printer makes a slight change of direction there there should be straight lines
- the printed part has a negative scale on the X axis (5mm is 4mm)

This grid should not have these gaps into the rows/columns

the strange thing is that the printer "knows" about the gap 'cause it printed a fill here:

Here, instead, you can see that the X axis is "compressed" and the wall has a gap:

Finally the main problem can be seen clearly here, where the first brim turn is fine and the others have a change of direction:


I don’t know which firmware there were before my update.

I simply downloaded and compiled with Arduino IDE 1.8.19 the lastest firmware for my printer available at the manufacturer:
https://github.com/HiPrecy/Firmware-HiPrecy/tree/LEO/2.0.x-TMC2209

This one compiles without problems, but is also the one that i think is creating the issue on my printer. So i tried to download the lastest firmware from official Marlin repo and update its configurations with the one from the manufacturer, it look simple from the website. But i get a big list of problems during compilation time:

- Arduino IDE:

// [WELL COMPILEX LINES MIXED WITH "Error while detecting..."]
Error while detecting libraries included by C:\Users\ozky2\AppData\Local\Temp\arduino_build_7167\sketch\src\sd\SdFatUtil.cpp
"C:\\Users\\ozky2\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_FYSETCF6 -DARDUINO_ARCH_AVR "-IC:\\Users\\ozky2\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\ozky2\\AppData\\Local\\Arduino15\\packages\\fysetcf6\\hardware\\avr\\1.4.0\\variants\\fysetcf6" "-ID:\\Documenti\\Arduino\\libraries\\TMCStepper\\src" "-IC:\\Users\\ozky2\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\libraries\\SPI\\src" "-IC:\\Users\\ozky2\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\libraries\\SoftwareSerial\\src" "C:\\Users\\ozky2\\AppData\\Local\\Temp\\arduino_build_7167\\sketch\\src\\sd\\SdFile.cpp" -o nul
Error while detecting libraries included by C:\Users\ozky2\AppData\Local\Temp\arduino_build_7167\sketch\src\sd\SdFile.cpp
"C:\\Users\\ozky2\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_FYSETCF6 -DARDUINO_ARCH_AVR "-IC:\\Users\\ozky2\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\ozky2\\AppData\\Local\\Arduino15\\packages\\fysetcf6\\hardware\\avr\\1.4.0\\variants\\fysetcf6" "-ID:\\Documenti\\Arduino\\libraries\\TMCStepper\\src" "-IC:\\Users\\ozky2\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\libraries\\SPI\\src" "-IC:\\Users\\ozky2\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\libraries\\SoftwareSerial\\src" "C:\\Users\\ozky2\\AppData\\Local\\Temp\\arduino_build_7167\\sketch\\src\\sd\\SdVolume.cpp" -o nul
Error while detecting libraries included by C:\Users\ozky2\AppData\Local\Temp\arduino_build_7167\sketch\src\sd\SdVolume.cpp
"C:\\Users\\ozky2\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_FYSETCF6 -DARDUINO_ARCH_AVR "-IC:\\Users\\ozky2\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\ozky2\\AppData\\Local\\Arduino15\\packages\\fysetcf6\\hardware\\avr\\1.4.0\\variants\\fysetcf6" "-ID:\\Documenti\\Arduino\\libraries\\TMCStepper\\src" "-IC:\\Users\\ozky2\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\libraries\\SPI\\src" "-IC:\\Users\\ozky2\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\libraries\\SoftwareSerial\\src" "C:\\Users\\ozky2\\AppData\\Local\\Temp\\arduino_build_7167\\sketch\\src\\sd\\cardreader.cpp" -o nul
Error while detecting libraries included by C:\Users\ozky2\AppData\Local\Temp\arduino_build_7167\sketch\src\sd\cardreader.cpp
// [WELL COMPILED LINES]
In file included from D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\MarlinConfig.h:52:0,
                 from D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\HAL\AVR\HAL.cpp:24:
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\SanityCheck.h:562:6: error: #error "ADVANCED_PAUSE_FEATURE requires a supported LCD controller (or EMERGENCY_PARSER)."
     #error "ADVANCED_PAUSE_FEATURE requires a supported LCD controller (or EMERGENCY_PARSER)."
      ^~~~~
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\SanityCheck.h:1735:4: error: #error "DISABLE_[XYZIJKUVW] is not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING."
   #error "DISABLE_[XYZIJKUVW] is not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING."
    ^~~~~
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\SanityCheck.h:1851:6: error: #error "You cannot set E0_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
     #error "You cannot set E0_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
      ^~~~~
In file included from D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\MarlinConfig.h:52:0,
                 from D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\HAL\AVR\MarlinSerial.cpp:39:
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\SanityCheck.h:562:6: error: #error "ADVANCED_PAUSE_FEATURE requires a supported LCD controller (or EMERGENCY_PARSER)."
     #error "ADVANCED_PAUSE_FEATURE requires a supported LCD controller (or EMERGENCY_PARSER)."
      ^~~~~
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\SanityCheck.h:1735:4: error: #error "DISABLE_[XYZIJKUVW] is not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING."
   #error "DISABLE_[XYZIJKUVW] is not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING."
    ^~~~~
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\SanityCheck.h:1851:6: error: #error "You cannot set E0_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
     #error "You cannot set E0_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
      ^~~~~
In file included from D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\MarlinConfig.h:52:0,
                 from D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\HAL\AVR\eeprom.cpp:24:
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\SanityCheck.h:562:6: error: #error "ADVANCED_PAUSE_FEATURE requires a supported LCD controller (or EMERGENCY_PARSER)."
     #error "ADVANCED_PAUSE_FEATURE requires a supported LCD controller (or EMERGENCY_PARSER)."
      ^~~~~
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\SanityCheck.h:1735:4: error: #error "DISABLE_[XYZIJKUVW] is not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING."
   #error "DISABLE_[XYZIJKUVW] is not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING."
    ^~~~~
In file included from D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\MarlinConfig.h:52:0,
                 from D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\MarlinCore.h:24,
                 from D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\MarlinCore.cpp:31:
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\SanityCheck.h:562:6: error: #error "ADVANCED_PAUSE_FEATURE requires a supported LCD controller (or EMERGENCY_PARSER)."
     #error "ADVANCED_PAUSE_FEATURE requires a supported LCD controller (or EMERGENCY_PARSER)."
      ^~~~~
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\SanityCheck.h:1851:6: error: #error "You cannot set E0_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
     #error "You cannot set E0_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
      ^~~~~
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\SanityCheck.h:3565:6: error: #error "GANTRY_CALIBRATION_SAFE_POSITION Requires GANTRY_CALIBRATION_XY_PARK_FEEDRATE to be set."
     #error "GANTRY_CALIBRATION_SAFE_POSITION Requires GANTRY_CALIBRATION_XY_PARK_FEEDRATE to be set."
      ^~~~~
In file included from D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\MarlinConfig.h:52:0,
                 from D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\HAL\AVR\fast_pwm.cpp:24:
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\SanityCheck.h:562:6: error: #error "ADVANCED_PAUSE_FEATURE requires a supported LCD controller (or EMERGENCY_PARSER)."
     #error "ADVANCED_PAUSE_FEATURE requires a supported LCD controller (or EMERGENCY_PARSER)."
      ^~~~~
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\SanityCheck.h:1735:4: error: #error "DISABLE_[XYZIJKUVW] is not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING."
   #error "DISABLE_[XYZIJKUVW] is not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING."
    ^~~~~
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\SanityCheck.h:1851:6: error: #error "You cannot set E0_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
     #error "You cannot set E0_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
      ^~~~~
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\SanityCheck.h:1735:4: error: #error "DISABLE_[XYZIJKUVW] is not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING."
   #error "DISABLE_[XYZIJKUVW] is not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING."
    ^~~~~
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\SanityCheck.h:1851:6: error: #error "You cannot set E0_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
     #error "You cannot set E0_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
      ^~~~~
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\SanityCheck.h:3565:6: error: #error "GANTRY_CALIBRATION_SAFE_POSITION Requires GANTRY_CALIBRATION_XY_PARK_FEEDRATE to be set."
     #error "GANTRY_CALIBRATION_SAFE_POSITION Requires GANTRY_CALIBRATION_XY_PARK_FEEDRATE to be set."
      ^~~~~
In file included from D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\MarlinConfig.h:52:0,
                 from D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\HAL\AVR\Servo.cpp:55:
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\SanityCheck.h:562:6: error: #error "ADVANCED_PAUSE_FEATURE requires a supported LCD controller (or EMERGENCY_PARSER)."
     #error "ADVANCED_PAUSE_FEATURE requires a supported LCD controller (or EMERGENCY_PARSER)."
      ^~~~~
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\SanityCheck.h:1735:4: error: #error "DISABLE_[XYZIJKUVW] is not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING."
   #error "DISABLE_[XYZIJKUVW] is not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING."
    ^~~~~
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\SanityCheck.h:1851:6: error: #error "You cannot set E0_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
     #error "You cannot set E0_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
      ^~~~~
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\SanityCheck.h:3565:6: error: #error "GANTRY_CALIBRATION_SAFE_POSITION Requires GANTRY_CALIBRATION_XY_PARK_FEEDRATE to be set."
     #error "GANTRY_CALIBRATION_SAFE_POSITION Requires GANTRY_CALIBRATION_XY_PARK_FEEDRATE to be set."
      ^~~~~
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\SanityCheck.h:3565:6: error: #error "GANTRY_CALIBRATION_SAFE_POSITION Requires GANTRY_CALIBRATION_XY_PARK_FEEDRATE to be set."
     #error "GANTRY_CALIBRATION_SAFE_POSITION Requires GANTRY_CALIBRATION_XY_PARK_FEEDRATE to be set."
      ^~~~~
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\SanityCheck.h:3565:6: error: #error "GANTRY_CALIBRATION_SAFE_POSITION Requires GANTRY_CALIBRATION_XY_PARK_FEEDRATE to be set."
     #error "GANTRY_CALIBRATION_SAFE_POSITION Requires GANTRY_CALIBRATION_XY_PARK_FEEDRATE to be set."
      ^~~~~
In file included from D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\MarlinConfig.h:52:0,
                 from D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\HAL\AVR\HAL_SPI.cpp:34:
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\SanityCheck.h:562:6: error: #error "ADVANCED_PAUSE_FEATURE requires a supported LCD controller (or EMERGENCY_PARSER)."
     #error "ADVANCED_PAUSE_FEATURE requires a supported LCD controller (or EMERGENCY_PARSER)."
      ^~~~~
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\SanityCheck.h:3565:6: error: #error "GANTRY_CALIBRATION_SAFE_POSITION Requires GANTRY_CALIBRATION_XY_PARK_FEEDRATE to be set."
     #error "GANTRY_CALIBRATION_SAFE_POSITION Requires GANTRY_CALIBRATION_XY_PARK_FEEDRATE to be set."
      ^~~~~
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\SanityCheck.h:1735:4: error: #error "DISABLE_[XYZIJKUVW] is not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING."
   #error "DISABLE_[XYZIJKUVW] is not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING."
    ^~~~~
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\SanityCheck.h:1851:6: error: #error "You cannot set E0_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
     #error "You cannot set E0_AUTO_FAN_PIN equal to CONTROLLER_FAN_PIN."
      ^~~~~
In file included from D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\MarlinConfigPre.h:37:0,
                 from D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\MarlinConfig.h:28,
                 from D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\HAL\AVR\HAL.cpp:24:
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\core\macros.h:240:48: error: expected ';' before '<=' token
 #define WITHIN(N,L,H)       ((N) >= (L) && (N) <= (H))
                                                ^
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\SanityCheck.h:1707:17: note: in expansion of macro 'WITHIN'
   static_assert(WITHIN(Z_SAFE_HOMING_Y_POINT, Y_MIN_POS, Y_MAX_POS), "Z_SAFE_HOMING_Y_POINT can't be reached by the nozzle.");
                 ^~~~~~
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\core\macros.h:240:48: error: expected unqualified-id before '<=' token
 #define WITHIN(N,L,H)       ((N) >= (L) && (N) <= (H))
                                                ^
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\SanityCheck.h:1707:17: note: in expansion of macro 'WITHIN'
   static_assert(WITHIN(Z_SAFE_HOMING_Y_POINT, Y_MIN_POS, Y_MAX_POS), "Z_SAFE_HOMING_Y_POINT can't be reached by the nozzle.");
                 ^~~~~~
In file included from D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\MarlinConfigPre.h:37:0,
                 from D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\MarlinConfig.h:28,
                 from D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\HAL\AVR\MarlinSerial.cpp:39:
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\core\macros.h:240:48: error: expected ';' before '<=' token
 #define WITHIN(N,L,H)       ((N) >= (L) && (N) <= (H))
                                                ^
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\SanityCheck.h:1707:17: note: in expansion of macro 'WITHIN'
   static_assert(WITHIN(Z_SAFE_HOMING_Y_POINT, Y_MIN_POS, Y_MAX_POS), "Z_SAFE_HOMING_Y_POINT can't be reached by the nozzle.");
                 ^~~~~~
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\core\macros.h:240:48: error: expected unqualified-id before '<=' token
 #define WITHIN(N,L,H)       ((N) >= (L) && (N) <= (H))
                                                ^
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\SanityCheck.h:1707:17: note: in expansion of macro 'WITHIN'
   static_assert(WITHIN(Z_SAFE_HOMING_Y_POINT, Y_MIN_POS, Y_MAX_POS), "Z_SAFE_HOMING_Y_POINT can't be reached by the nozzle.");
                 ^~~~~~
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\SanityCheck.h:3565:6: error: #error "GANTRY_CALIBRATION_SAFE_POSITION Requires GANTRY_CALIBRATION_XY_PARK_FEEDRATE to be set."
     #error "GANTRY_CALIBRATION_SAFE_POSITION Requires GANTRY_CALIBRATION_XY_PARK_FEEDRATE to be set."
      ^~~~~
In file included from D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\MarlinConfigPre.h:37:0,
                 from D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\MarlinConfig.h:28,
                 from D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\HAL\AVR\eeprom.cpp:24:
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\core\macros.h:240:48: error: expected ';' before '<=' token
 #define WITHIN(N,L,H)       ((N) >= (L) && (N) <= (H))
                                                ^
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\SanityCheck.h:1707:17: note: in expansion of macro 'WITHIN'
   static_assert(WITHIN(Z_SAFE_HOMING_Y_POINT, Y_MIN_POS, Y_MAX_POS), "Z_SAFE_HOMING_Y_POINT can't be reached by the nozzle.");
                 ^~~~~~
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\core\macros.h:240:48: error: expected unqualified-id before '<=' token
 #define WITHIN(N,L,H)       ((N) >= (L) && (N) <= (H))
                                                ^
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\SanityCheck.h:1707:17: note: in expansion of macro 'WITHIN'
   static_assert(WITHIN(Z_SAFE_HOMING_Y_POINT, Y_MIN_POS, Y_MAX_POS), "Z_SAFE_HOMING_Y_POINT can't be reached by the nozzle.");
                 ^~~~~~
In file included from D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\MarlinConfigPre.h:37:0,
                 from D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\MarlinConfig.h:28,
                 from D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\HAL\AVR\fast_pwm.cpp:24:
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\core\macros.h:240:48: error: expected ';' before '<=' token
 #define WITHIN(N,L,H)       ((N) >= (L) && (N) <= (H))
                                                ^
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\SanityCheck.h:1707:17: note: in expansion of macro 'WITHIN'
   static_assert(WITHIN(Z_SAFE_HOMING_Y_POINT, Y_MIN_POS, Y_MAX_POS), "Z_SAFE_HOMING_Y_POINT can't be reached by the nozzle.");
                 ^~~~~~
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\core\macros.h:240:48: error: expected unqualified-id before '<=' token
 #define WITHIN(N,L,H)       ((N) >= (L) && (N) <= (H))
                                                ^
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\SanityCheck.h:1707:17: note: in expansion of macro 'WITHIN'
   static_assert(WITHIN(Z_SAFE_HOMING_Y_POINT, Y_MIN_POS, Y_MAX_POS), "Z_SAFE_HOMING_Y_POINT can't be reached by the nozzle.");
                 ^~~~~~
In file included from D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\MarlinConfigPre.h:37:0,
                 from D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\inc\MarlinConfig.h:28,
                 from D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\HAL\AVR\Servo.cpp:55:
D:\Desktop\PRINTER\Marlin-bugfix-2.1.x\Marlin\src\core\macros.h:240:48: error: expected ';' before '<=' token
 #define WITHIN(N,L,H)       ((N) >= (L) && (N) <= (H))
                                                ^



- PlatformIO:

D:\Desktop\PRINTER\Marlin-bugfix-2.1.x> platformio run --silent -e FYSETC_F6_14
Warning! `src_filter` configuration option in section [env:mega2560] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [env:mega1280] is deprecated and will be removed in the next release! Please use `build_src_filter` instead       
Warning! `src_filter` configuration option in section [env:rambo] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [env:FYSETC_F6_13] is deprecated and will be removed in the next release! Please use `build_src_filter` instead   
Warning! `src_filter` configuration option in section [env:FYSETC_F6_14] is deprecated and will be removed in the next release! Please use `build_src_filter` instead   
Warning! `src_filter` configuration option in section [env:sanguino644p] is deprecated and will be removed in the next release! Please use `build_src_filter` instead   
Warning! `src_filter` configuration option in section [env:sanguino1284p] is deprecated and will be removed in the next release! Please use `build_src_filter` instead  
Warning! `src_filter` configuration option in section [env:melzi] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [env:melzi_optiboot] is deprecated and will be removed in the next release! Please use `build_src_filter` instead 
Warning! `src_filter` configuration option in section [env:at90usb1286_cdc] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [env:at90usb1286_dfu] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [envgrinning smileyUE] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [envgrinning smileyUE_USB] is deprecated and will be removed in the next release! Please use `build_src_filter` instead        
Warning! `src_filter` configuration option in section [envgrinning smileyUE_debug] is deprecated and will be removed in the next release! Please use `build_src_filter` instead      
Warning! `src_filter` configuration option in section [env:LPC1768] is deprecated and will be removed in the next release! Please use `build_src_filter` instead        
Warning! `src_filter` configuration option in section [env:LPC1769] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [envconfused smileyTM32F103RC] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [envconfused smileyTM32F103RC_fysetc] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [envconfused smileyTM32F103RC_btt] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [envconfused smileyTM32F103RC_btt_USB] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [envconfused smileyTM32F103RC_btt_512K] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [envconfused smileyTM32F103RC_btt_512K_USB] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [envconfused smileyTM32F103RE] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [envconfused smileyTM32F103RE_btt] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [envconfused smileyTM32F103RE_btt_USB] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [envconfused smileyTM32F4] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [envconfused smileyTM32F7] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [env:ARMED] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [envconfused smileyTM32F103VE_GTM32] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [envconfused smileyTM32F103VE_longer] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [env:mks_robin_mini] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [env:mks_robin_nano] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [env:mks_robin] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [env:mks_robin_pro] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [env:mks_robin_lite] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [env:mks_robin_lite3] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [env:jgaurora_a5s_a1] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [envconfused smileyTM32F103CB_malyan] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [env:chitu_f103] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [envconfused smileyTM32F401VE_STEVAL] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [env:FLYF407ZG] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [envconfused smileyTM32F407VE_black] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [env:BIGTREE_SKR_PRO] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [env:BIGTREE_GTR_V1_0] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [env:BIGTREE_BTT002] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [env:teensy31] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [env:teensy35] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [env:esp32] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_build_flags` configuration option in section [env:linux_native] is deprecated and will be removed in the next release! Please use `build_src_flags` instead
Warning! `src_filter` configuration option in section [env:linux_native] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [envconfused smileyAMD51_grandcentral_m4] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [env:rumba32_f446ve] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [env:rumba32_mks] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
Warning! `src_filter` configuration option in section [env:include_tree] is deprecated and will be removed in the next release! Please use `build_src_filter` instead
UnknownBoard: Unknown board ID 'fysetc_f6_14'



No matter which framework i use, i get errors. Can i say that is not just about to check differences in .h Marlin files ? Where i’m doing wrong ? How could i make it work ?

(Please note that my only successful try worked with Arduino IDE 1.8.19, idk if i’m doing something wrong but PlatformIO seems worse in terms of ease of use, or configuration at least)

My priority is to fix the printer results, i dont care if the firmware is not the lastest, i would also like to learn for what concerns my printer setup but the simpler solution is the one for me.

Some details of my printer:

- HiPrecy LEO S1
- Dual-Z motor system
- FYSETC F6 1.4 motherboard
- TMC2209 Drivers (works as endstops as well)
- 42byg-40015-22b Motors
- Nozzle Induction probe installed

This is my M501 output:


15:00:02.551 : echo:Unknown command: "M80"
15:00:02.561 : Begin file list
15:00:02.670 : /SYSTEM/LEVEL_~1.GCO 165566
15:00:02.673 : /SYSTEM/_RUN_A~1.GCO 298
15:00:02.694 : /SYSTEM/GRID~1.GCO 725372
15:00:02.732 : CARD_T~1.GCO 901922
15:00:02.736 : CFFFP_~1.GCO 736530
15:00:02.736 : CFFFP_~2.GCO 189008
15:00:02.755 : CFFFP_~3.GCO 528212
15:00:02.759 : End file list
15:00:02.761 : echogrinning smileyEBUG:INFO,ERRORS
15:00:51.201 : N16 M501*16
15:00:52.245 : echo:V77 stored settings retrieved (711 bytes; crc 34168)
15:00:52.248 : echo: G21 ; Units in mm (mm)
15:00:52.251 : echo:; Filament settings: Disabled
15:00:52.253 : echo: M200 D1.75
15:00:52.253 : echo: M200 D0
15:00:52.256 : echo:; Steps per unit:
15:00:52.259 : echo: M92 X80.00 Y80.00 Z400.20 E409.00
15:00:52.264 : echo:; Maximum feedrates (units/s):
15:00:52.267 : echo: M203 X300.00 Y300.00 Z5.00 E25.00
15:00:52.274 : echo:; Maximum Acceleration (units/s2):
15:00:52.275 : echo: M201 X3000.00 Y3000.00 Z100.00 E10000.00
15:00:52.281 : echo:; Acceleration (units/s2): P R T
15:00:52.284 : echo: M204 P1000.00 R2000.00 T1000.00
15:00:52.292 : echo:; Advanced: B S T J
15:00:52.295 : echo: M205 B20000.00 S0.00 T0.00 J0.01
15:00:52.297 : echo:; Home offset:
15:00:52.300 : echo: M206 X0.00 Y0.00 Z0.00
15:00:52.302 : echo:; Auto Bed Leveling:
15:00:52.303 : echo: M420 S0 Z0.00
15:00:52.305 : echo: G29 W I0 J0 Z-0.00255
15:00:52.308 : echo: G29 W I1 J0 Z-0.26492
15:00:52.311 : echo: G29 W I2 J0 Z-0.48981
15:00:52.314 : echo: G29 W I3 J0 Z-0.83963
15:00:52.316 : echo: G29 W I0 J1 Z-0.03753
15:00:52.319 : echo: G29 W I1 J1 Z-0.15247
15:00:52.322 : echo: G29 W I2 J1 Z-0.18746
15:00:52.324 : echo: G29 W I3 J1 Z-0.40985
15:00:52.327 : echo: G29 W I0 J2 Z-0.12999
15:00:52.330 : echo: G29 W I1 J2 Z-0.07251
15:00:52.330 : echo: G29 W I2 J2 Z-0.05252
15:00:52.332 : echo: G29 W I3 J2 Z-0.13998
15:00:52.335 : echo: G29 W I0 J3 Z-0.33238
15:00:52.338 : echo: G29 W I1 J3 Z-0.16997
15:00:52.340 : echo: G29 W I2 J3 Z-0.09750
15:00:52.344 : echo: G29 W I3 J3 Z-0.11749
15:00:52.346 : echo:; PID settings:
15:00:52.349 : echo: M301 P18.09 I1.19 D68.56
15:00:52.352 : echo: M304 P20.00 I1.00 D245.50
15:00:52.354 : echo:; Power-Loss Recovery:
15:00:52.354 : echo: M413 S1
15:00:52.357 : echo:; Z-Probe Offset (mm):
15:00:52.360 : echo: M851 X35.00 Y2.00 Z-0.10
15:00:52.363 : echo:; Stepper driver current:
15:00:52.365 : echo: M906 X600 Y700 Z795
15:00:52.365 : echo: M906 T0 E550
15:00:52.368 : echo:; StallGuard threshold:
15:00:52.371 : echo: M914 X100 Y100
15:00:52.373 : echo:; Driver stepping mode:
15:00:52.430 : echo: M569 S1 X Y Z
15:00:52.450 : echo: M569 S1 T0 E
15:00:52.452 : echo:; Filament load/unload lengths:
15:00:52.455 : echo: M603 L0.00 U100.00

Re: Arbitrary change of direction and scale problems
November 16, 2023 10:11PM
The "is deprecated and will be removed " portion of the error messages means that you either are not using a recent release of Marlin or tried to use the old config files with a newer Marlin.

You can't just dump the old config files into a newer Marlin codebase. You'll need to do a side by side comparison and copy the old settings into the new config files.
Re: Arbitrary change of direction and scale problems
November 22, 2023 04:06AM
yeah, i've tried another approach 'cause there is too much difference in configs from version 2.0.5 (that compiles) and lastest versions of marlin (that gives me errors somehow). I don't know if there is an official way to follow the changes in new marlin versions but the only one that works for me is this one: GitHub HiPrecy Marlin 2.0.5 (custom repository i made)

Compiled and checked steps/mm but my prints still are weird:



i've tried a whole spectrum of slicer setting (and slicers too): changed first layer height, layer height, extrusion temperature, etc... all the time the same result.

What could be ?
Re: Arbitrary change of direction and scale problems
November 22, 2023 04:32AM
It looks like a hardware issue.

Check the pulleys on your stepper motors are fixed to the stepper shaft securely.. (a loose pulley will case gaps like that if the grub screw is loose but not fully out)

Its also a plastic wheels on bearing based printer. check all of the wheels are not warn, loose, cracked or have become not round.

Edited 1 time(s). Last edit at 11/22/2023 04:32AM by Dust.
Re: Arbitrary change of direction and scale problems
November 22, 2023 04:48AM
i don't think so. I printed many parts fine and got problem only after firmware upgrade (not moved the printer or anything else). Previous parts i printed are perfectly fine, no elliptical circles and no strange shift in only one axis (Y) in the first centimeter of the model. Also i ask myself how an hardware problem could lead to print into the gaps that there aren't in the slicers.
Re: Arbitrary change of direction and scale problems
November 22, 2023 05:02AM
hardware faults love to crop up when you update firmware.. to ensure maximum confusion..


Gaps are caused just like I just described

Eg loose pulley no X, X move right 10mm, but due to loose pulley, the pulley rotated a little on the shaft until the grub screw gets caught on the flat of the saft, the axis it really only moved 8mm, now X moves left and pulley is back in start position on the other edge of the flat and in correct position again.
This result in two lines of plastic being put down when there should only be one (does this seem familiar?)


same can happen if the wheels are worn or not snug.... the bed or the hotend could move in a direction it shouldn't.
Sorry, only registered users may post in this forum.

Click here to login