Skip to content

Commit

Permalink
Merge branch 'bugfix-2.1.x' into Geeetech-A10T
Browse files Browse the repository at this point in the history
  • Loading branch information
vert committed Jan 30, 2023
2 parents c09db78 + 67bc855 commit 464c851
Show file tree
Hide file tree
Showing 125 changed files with 1,811 additions and 1,074 deletions.
72 changes: 62 additions & 10 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
*
* Advanced settings can be found in Configuration_adv.h
*/
#define CONFIGURATION_H_VERSION 02010200
#define CONFIGURATION_H_VERSION 02010300

//===========================================================================
//============================= Getting Started =============================
Expand Down Expand Up @@ -927,7 +927,7 @@
#endif

// Print surface diameter/2 minus unreachable space (avoid collisions with vertical towers).
#define DELTA_PRINTABLE_RADIUS 140.0 // (mm)
#define PRINTABLE_RADIUS 140.0 // (mm)

// Maximum reachable area
#define DELTA_MAX_RADIUS 140.0 // (mm)
Expand Down Expand Up @@ -981,7 +981,7 @@
#if ENABLED(MORGAN_SCARA)

//#define DEBUG_SCARA_KINEMATICS
#define SCARA_FEEDRATE_SCALING // Convert XY feedrate from mm/s to degrees/s on the fly
#define FEEDRATE_SCALING // Convert XY feedrate from mm/s to degrees/s on the fly
// Radius around the center where the arm cannot reach
#define MIDDLE_DEAD_ZONE_R 0 // (mm)
Expand Down Expand Up @@ -1016,7 +1016,7 @@
#define TPARA_OFFSET_Y 0 // (mm)
#define TPARA_OFFSET_Z 0 // (mm)

#define SCARA_FEEDRATE_SCALING // Convert XY feedrate from mm/s to degrees/s on the fly
#define FEEDRATE_SCALING // Convert XY feedrate from mm/s to degrees/s on the fly
// Radius around the center where the arm cannot reach
#define MIDDLE_DEAD_ZONE_R 0 // (mm)
Expand All @@ -1026,6 +1026,59 @@
#define PSI_HOMING_OFFSET 0
#endif

// @section polar

/**
* POLAR Kinematics
* developed by Kadir ilkimen for PolarBear CNC and babyBear
* https://github.com/kadirilkimen/Polar-Bear-Cnc-Machine
* https://github.com/kadirilkimen/babyBear-3D-printer
*
* A polar machine can have different configurations.
* This kinematics is only compatible with the following configuration:
* X : Independent linear
* Y or B : Polar
* Z : Independent linear
*
* For example, PolarBear has CoreXZ plus Polar Y or B.
*
* Motion problem for Polar axis near center / origin:
*
* 3D printing:
* Movements very close to the center of the polar axis take more time than others.
* This brief delay results in more material deposition due to the pressure in the nozzle.
*
* Current Kinematics and feedrate scaling deals with this by making the movement as fast
* as possible. It works for slow movements but doesn't work well with fast ones. A more
* complicated extrusion compensation must be implemented.
*
* Ideally, it should estimate that a long rotation near the center is ahead and will cause
* unwanted deposition. Therefore it can compensate the extrusion beforehand.
*
* Laser cutting:
* Same thing would be a problem for laser engraving too. As it spends time rotating at the
* center point, more likely it will burn more material than it should. Therefore similar
* compensation would be implemented for laser-cutting operations.
*
* Milling:
* This shouldn't be a problem for cutting/milling operations.
*/
//#define POLAR
#if ENABLED(POLAR)
#define DEFAULT_SEGMENTS_PER_SECOND 180 // If movement is choppy try lowering this value
#define PRINTABLE_RADIUS 82.0f // (mm) Maximum travel of X axis

// Movements fall inside POLAR_FAST_RADIUS are assigned the highest possible feedrate
// to compensate unwanted deposition related to the near-origin motion problem.
#define POLAR_FAST_RADIUS 3.0f // (mm)

// Radius which is unreachable by the tool.
// Needed if the tool is not perfectly aligned to the center of the polar axis.
#define POLAR_CENTER_OFFSET 0.0f // (mm)

#define FEEDRATE_SCALING // Convert XY feedrate from mm/s to degrees/s on the fly
#endif

// @section machine

// Articulated robot (arm). Joints are directly mapped to axes with no kinematics.
Expand Down Expand Up @@ -1428,13 +1481,13 @@
// 2 or 3 sets of coordinates for deploying and retracting the spring loaded touch probe on G29,
// if servo actuated touch probe is not defined. Uncomment as appropriate for your printer/probe.

#define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, DELTA_PRINTABLE_RADIUS, 100.0 }
#define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, PRINTABLE_RADIUS, 100.0 }
#define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_FEEDRATE

#define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, DELTA_PRINTABLE_RADIUS, 100.0 }
#define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, PRINTABLE_RADIUS, 100.0 }
#define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_FEEDRATE)/10

#define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (DELTA_PRINTABLE_RADIUS) * 0.75, 100.0 }
#define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (PRINTABLE_RADIUS) * 0.75, 100.0 }
#define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_FEEDRATE

#define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } // Move the probe into position
Expand Down Expand Up @@ -1962,7 +2015,7 @@
//#define EXTRAPOLATE_BEYOND_GRID

//
// Experimental Subdivision of the grid by Catmull-Rom method.
// Subdivision of the grid by Catmull-Rom method.
// Synthesizes intermediate points to produce a more detailed mesh.
//
//#define ABL_BILINEAR_SUBDIVISION
Expand Down Expand Up @@ -2237,7 +2290,7 @@
#endif

/**
* Clean Nozzle Feature -- EXPERIMENTAL
* Clean Nozzle Feature
*
* Adds the G12 command to perform a nozzle cleaning process.
*
Expand Down Expand Up @@ -2271,7 +2324,6 @@
* Before starting, the nozzle moves to NOZZLE_CLEAN_START_POINT.
*
* Caveats: The ending Z should be the same as starting Z.
* Attention: EXPERIMENTAL. G-code arguments may change.
*/
//#define NOZZLE_CLEAN_FEATURE

Expand Down
20 changes: 9 additions & 11 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*
* Basic settings can be found in Configuration.h
*/
#define CONFIGURATION_ADV_H_VERSION 02010200
#define CONFIGURATION_ADV_H_VERSION 02010300

// @section develop

Expand Down Expand Up @@ -375,7 +375,7 @@
#endif

#if ENABLED(PIDTEMP)
// Add an experimental additional term to the heater power, proportional to the extrusion speed.
// Add an additional term to the heater power, proportional to the extrusion speed.
// A well-chosen Kc value should add just enough power to melt the increased material volume.
#define PID_EXTRUSION_SCALING
#if ENABLED(PID_EXTRUSION_SCALING)
Expand All @@ -384,7 +384,7 @@
#endif

/**
* Add an experimental additional term to the heater power, proportional to the fan speed.
* Add an additional term to the heater power, proportional to the fan speed.
* A well-chosen Kf value should add just enough power to compensate for power-loss from the cooling fan.
* You can either just add a constant compensation with the DEFAULT_Kf value
* or follow the instruction below to get speed-dependent compensation.
Expand Down Expand Up @@ -493,7 +493,8 @@
* the minimum temperature your thermistor can read. The lower the better/safer.
* This shouldn't need to be more than 30 seconds (30000)
*/
//#define MILLISECONDS_PREHEAT_TIME 0
//#define PREHEAT_TIME_HOTEND_MS 0
//#define PREHEAT_TIME_BED_MS 0

// @section extruder

Expand Down Expand Up @@ -1430,14 +1431,12 @@

#endif // HAS_MARLINUI_MENU

#if ANY(HAS_DISPLAY, DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI)
#if HAS_DISPLAY
//#define SOUND_MENU_ITEM // Add a mute option to the LCD menu
#define SOUND_ON_DEFAULT // Buzzer/speaker default enabled state
#endif
#if EITHER(HAS_DISPLAY, DWIN_LCD_PROUI)
// The timeout (in ms) to return to the status screen from sub-menus
#define LCD_TIMEOUT_TO_STATUS 60000
// The timeout to return to the status screen from sub-menus
//#define LCD_TIMEOUT_TO_STATUS 15000 // (ms)

#if ENABLED(SHOW_BOOTSCREEN)
#define BOOTSCREEN_TIMEOUT 4000 // (ms) Total Duration to display the boot screen(s)
Expand Down Expand Up @@ -1484,7 +1483,7 @@
#endif
#endif

#endif // HAS_DISPLAY || DWIN_LCD_PROUI
#endif // HAS_DISPLAY

// Add 'M73' to set print job progress, overrides Marlin's built-in estimate
//#define SET_PROGRESS_MANUALLY
Expand Down Expand Up @@ -2125,7 +2124,6 @@
#endif
//#define ADVANCE_K_EXTRA // Add a second linear advance constant, configurable with M900 L.
//#define LA_DEBUG // Print debug information to serial during operation. Disable for production use.
//#define EXPERIMENTAL_SCURVE // Allow S-Curve Acceleration to be used with LA.
//#define ALLOW_LOW_EJERK // Allow a DEFAULT_EJERK value of <10. Recommended for direct drive hotends.
//#define EXPERIMENTAL_I2S_LA // Allow I2S_STEPPER_STREAM to be used with LA. Performance degrades as the LA step rate reaches ~20kHz.
#endif
Expand Down
2 changes: 1 addition & 1 deletion Marlin/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
* here we define this default string as the date where the latest release
* version was tagged.
*/
//#define STRING_DISTRIBUTION_DATE "2023-01-10"
//#define STRING_DISTRIBUTION_DATE "2023-01-27"

/**
* Defines a generic printer name to be output to the LCD after booting Marlin.
Expand Down
32 changes: 15 additions & 17 deletions Marlin/src/HAL/ESP32/i2s.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,30 +149,28 @@ void stepperTask(void *parameter) {
dma.rw_pos = 0;

while (dma.rw_pos < DMA_SAMPLE_COUNT) {
// Fill with the port data post pulse_phase until the next step
if (nextMainISR && TERN1(LIN_ADVANCE, nextAdvanceISR))
i2s_push_sample();

// i2s_push_sample() is also called from Stepper::pulse_phase_isr() and Stepper::advance_isr()
// in a rare case where both are called, we need to double decrement the counters
const uint8_t push_count = 1 + (!nextMainISR && TERN0(LIN_ADVANCE, !nextAdvanceISR));

if (!nextMainISR) {
Stepper::pulse_phase_isr();
nextMainISR = Stepper::block_phase_isr();
}
#if ENABLED(LIN_ADVANCE)
if (!nextAdvanceISR) {
else if (!nextAdvanceISR) {
Stepper::advance_isr();
nextAdvanceISR = Stepper::la_interval;
}
else if (nextAdvanceISR == Stepper::LA_ADV_NEVER)
nextAdvanceISR = Stepper::la_interval;
#endif
else
i2s_push_sample();

if (!nextMainISR) {
Stepper::pulse_phase_isr();
nextMainISR = Stepper::block_phase_isr();
}
nextMainISR--;

nextMainISR -= push_count;
TERN_(LIN_ADVANCE, nextAdvanceISR -= push_count);
#if ENABLED(LIN_ADVANCE)
if (nextAdvanceISR == Stepper::LA_ADV_NEVER)
nextAdvanceISR = Stepper::la_interval;

if (nextAdvanceISR && nextAdvanceISR != Stepper::LA_ADV_NEVER)
nextAdvanceISR--;
#endif
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/HAL/NATIVE_SIM/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ class MarlinHAL {
MarlinHAL() {}

// Watchdog
static void watchdog_init() IF_DISABLED(USE_WATCHDOG, {});
static void watchdog_refresh() IF_DISABLED(USE_WATCHDOG, {});
static void watchdog_init();
static void watchdog_refresh();

static void init() {} // Called early in setup()
static void init_board() {} // Called less early in setup()
Expand Down
11 changes: 7 additions & 4 deletions Marlin/src/HAL/NATIVE_SIM/tft/tft_spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@
#endif

#define DATASIZE_8BIT 8
#define DATASIZE_16BIT 16
#define TFT_IO_DRIVER TFT_SPI
#define DATASIZE_16BIT 16
#define TFT_IO_DRIVER TFT_SPI
#define DMA_MAX_SIZE 0xFFFF

#define DMA_MINC_ENABLE 1
#define DMA_MINC_ENABLE 1
#define DMA_MINC_DISABLE 0

class TFT_SPI {
Expand All @@ -58,7 +59,9 @@ class TFT_SPI {
static void WriteData(uint16_t Data);
static void WriteReg(uint16_t Reg);

static void WriteSequence_DMA(uint16_t *Data, uint16_t Count) { WriteSequence(Data, Count); }
static void WriteMultiple_DMA(uint16_t Color, uint16_t Count) { WriteMultiple(Color, Count); }

static void WriteSequence(uint16_t *Data, uint16_t Count);
// static void WriteMultiple(uint16_t Color, uint16_t Count);
static void WriteMultiple(uint16_t Color, uint32_t Count);
};
8 changes: 7 additions & 1 deletion Marlin/src/HAL/STM32/sdio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@ void HAL_SD_MspInit(SD_HandleTypeDef *hsd) {

go_to_transfer_speed();

hsd.Init.ClockPowerSave = SDIO_CLOCK_POWER_SAVE_ENABLE;
hsd.Init.ClockDiv = 8;

#if PINS_EXIST(SDIO_D1, SDIO_D2, SDIO_D3) // go to 4 bit wide mode if pins are defined
retry_Cnt = retryCnt;
for (;;) {
Expand Down Expand Up @@ -433,7 +436,10 @@ bool SDIO_WriteBlock(uint32_t block, const uint8_t *src) {
#else

uint8_t retries = SDIO_READ_RETRIES;
while (retries--) if (SDIO_ReadWriteBlock_DMA(block, src, nullptr)) return true;
while (retries--) {
if (SDIO_ReadWriteBlock_DMA(block, src, nullptr)) return true;
delay(10);
}
return false;

#endif
Expand Down
28 changes: 24 additions & 4 deletions Marlin/src/HAL/STM32F1/onboard_sd.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once

/*-----------------------------------------------------------------------
/ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
/ * Copyright (c) 2019 BigTreeTech [https://github.com/bigtreetech]
/ * Low level disk interface module include file (C)ChaN, 2015
/ * Low level disk interface module include file (c) ChaN, 2015
/-----------------------------------------------------------------------*/

#pragma once

#define _DISKIO_WRITE 1 /* 1: Enable disk_write function */
#define _DISKIO_IOCTL 1 /* 1: Enable disk_ioctl function */
#define _DISKIO_ISDIO 0 /* 1: Enable iSDIO control function */
Expand Down
2 changes: 2 additions & 0 deletions Marlin/src/MarlinCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@
#include "module/polargraph.h"
#elif IS_SCARA
#include "module/scara.h"
#elif ENABLED(POLAR)
#include "module/polar.h"
#endif

#if HAS_LEVELING
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/core/language.h
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@
#define STR_S_SEG_PER_SEC "S<seg-per-sec>"
#define STR_DELTA_SETTINGS "Delta (L<diagonal-rod> R<radius> H<height> S<seg-per-sec> XYZ<tower-angle-trim> ABC<rod-trim>)"
#define STR_SCARA_SETTINGS "SCARA"
#define STR_POLAR_SETTINGS "Polar"
#define STR_POLARGRAPH_SETTINGS "Polargraph"
#define STR_SCARA_P_T_Z "P<theta-psi-offset> T<theta-offset> Z<home-offset>"
#define STR_ENDSTOP_ADJUSTMENT "Endstop adjustment"
Expand Down
Loading

0 comments on commit 464c851

Please sign in to comment.