diff --git a/config/printer-anycubic-4maxpro-2.0-2021.cfg b/config/printer-anycubic-4maxpro-2.0-2021.cfg index e0c83b6aeaa3..203e3c8f2f37 100644 --- a/config/printer-anycubic-4maxpro-2.0-2021.cfg +++ b/config/printer-anycubic-4maxpro-2.0-2021.cfg @@ -126,7 +126,6 @@ restart_method: arduino kinematics: cartesian max_velocity: 150 max_accel: 3000 -max_accel_to_decel: 1500 max_z_velocity: 7 max_z_accel: 50 square_corner_velocity: 5 diff --git a/config/printer-anycubic-kobra-go-2022.cfg b/config/printer-anycubic-kobra-go-2022.cfg index d4fc409f0cfd..bb8a9267f68b 100644 --- a/config/printer-anycubic-kobra-go-2022.cfg +++ b/config/printer-anycubic-kobra-go-2022.cfg @@ -118,7 +118,7 @@ cycle_time: 0.00005 #20kHz [output_pin enable_pin] pin: PB6 -static_value: 1 +value: 1 #This pin enables the bed, hotend, extruder fan, part fan. [mcu] diff --git a/config/printer-anycubic-kobra-plus-2022.cfg b/config/printer-anycubic-kobra-plus-2022.cfg index 96099797042c..3f71caab81b5 100644 --- a/config/printer-anycubic-kobra-plus-2022.cfg +++ b/config/printer-anycubic-kobra-plus-2022.cfg @@ -14,6 +14,7 @@ # To build the firmware, use the following configuration: # - Micro-controller: Huada Semiconductor HC32F460 # - Communication interface: Serial (PA3 & PA2) - Anycube +# - Clock Speed: 200 MHz # # Installation: # 1. Rename the klipper bin to `firmware.bin` and copy it to an SD Card. @@ -144,10 +145,9 @@ max_temp: 120 pause_on_runout: True switch_pin: !PC13 -[heater_fan controller_fan] +[controller_fan controller_fan] pin: PA14 heater: heater_bed -heater_temp: 45.0 [heater_fan hotend_fan] pin: PA13 diff --git a/config/printer-sovol-sv05-2022.cfg b/config/printer-sovol-sv05-2022.cfg index dafc6f3cf322..0ec03f84a186 100644 --- a/config/printer-sovol-sv05-2022.cfg +++ b/config/printer-sovol-sv05-2022.cfg @@ -19,7 +19,7 @@ restart_method: command kinematics: cartesian max_velocity: 300 max_accel: 1000 -max_accel_to_decel: 1000 +minimum_cruise_ratio: 0.0 max_z_velocity: 5 max_z_accel: 100 diff --git a/docs/Config_Changes.md b/docs/Config_Changes.md index 980c4f33ac7f..668732f994c5 100644 --- a/docs/Config_Changes.md +++ b/docs/Config_Changes.md @@ -8,6 +8,14 @@ All dates in this document are approximate. ## Changes +20240313: The `max_accel_to_decel` parameter in the `[printer]` config +section has been deprecated. The `ACCEL_TO_DECEL` parameter of the +`SET_VELOCITY_LIMIT` command has been deprecated. The +`printer.toolhead.max_accel_to_decel` status has been removed. Use the +[minimum_cruise_ratio parameter](./Config_Reference.md#printer) +instead. The deprecated features will be removed in the near future, +and using them in the interim may result in subtly different behavior. + 20240215: Several deprecated features have been removed. Using "NTC 100K beta 3950" as a thermistor name has been removed (deprecated on 20211110). The `SYNC_STEPPER_TO_EXTRUDER` and diff --git a/docs/Config_Reference.md b/docs/Config_Reference.md index 14b89200fb00..1b833eaf1e7f 100644 --- a/docs/Config_Reference.md +++ b/docs/Config_Reference.md @@ -97,13 +97,22 @@ max_accel: # will do so at the rate specified here. The value specified here # may be changed at runtime using the SET_VELOCITY_LIMIT command. # This parameter must be specified. -#max_accel_to_decel: -# A pseudo acceleration (in mm/s^2) controlling how fast the -# toolhead may go from acceleration to deceleration. It is used to -# reduce the top speed of short zig-zag moves (and thus reduce -# printer vibration from these moves). The value specified here may -# be changed at runtime using the SET_VELOCITY_LIMIT command. The -# default is half of max_accel. +#minimum_cruise_ratio: 0.5 +# Most moves will accelerate to a cruising speed, travel at that +# cruising speed, and then decelerate. However, some moves that +# travel a short distance could nominally accelerate and then +# immediately decelerate. This option reduces the top speed of these +# moves to ensure there is always a minimum distance traveled at a +# cruising speed. That is, it enforces a minimum distance traveled +# at cruising speed relative to the total distance traveled. It is +# intended to reduce the top speed of short zigzag moves (and thus +# reduce printer vibration from these moves). For example, a +# minimum_cruise_ratio of 0.5 would ensure that a standalone 1.5mm +# move would have a minimum cruising distance of 0.75mm. Specify a +# ratio of 0.0 to disable this feature (there would be no minimum +# cruising distance enforced between acceleration and deceleration). +# The value specified here may be changed at runtime using the +# SET_VELOCITY_LIMIT command. The default is 0.5. #square_corner_velocity: 5.0 # The maximum velocity (in mm/s) that the toolhead may travel a 90 # degree corner at. A non-zero value can reduce changes in extruder @@ -116,6 +125,8 @@ max_accel: # decelerate to zero at each corner. The value specified here may be # changed at runtime using the SET_VELOCITY_LIMIT command. The # default is 5mm/s. +#max_accel_to_decel: +# This parameter is deprecated and should no longer be used. ``` ### [stepper] diff --git a/docs/G-Codes.md b/docs/G-Codes.md index 199dc283b7ce..1f88937aa7d9 100644 --- a/docs/G-Codes.md +++ b/docs/G-Codes.md @@ -1291,7 +1291,7 @@ The toolhead module is automatically loaded. #### SET_VELOCITY_LIMIT `SET_VELOCITY_LIMIT [VELOCITY=] [ACCEL=] -[ACCEL_TO_DECEL=] [SQUARE_CORNER_VELOCITY=]`: This +[MINIMUM_CRUISE_RATIO=] [SQUARE_CORNER_VELOCITY=]`: This command can alter the velocity limits that were specified in the printer config file. See the [printer config section](Config_Reference.md#printer) for a diff --git a/docs/Kinematics.md b/docs/Kinematics.md index 313d5dce035c..1996579d2315 100644 --- a/docs/Kinematics.md +++ b/docs/Kinematics.md @@ -96,7 +96,7 @@ Key formula for look-ahead: end_velocity^2 = start_velocity^2 + 2*accel*move_distance ``` -### Smoothed look-ahead +### Minimum cruise ratio Klipper also implements a mechanism for smoothing out the motions of short "zigzag" moves. Consider the following moves: @@ -105,21 +105,27 @@ short "zigzag" moves. Consider the following moves: In the above, the frequent changes from acceleration to deceleration can cause the machine to vibrate which causes stress on the machine -and increases the noise. To reduce this, Klipper tracks both regular -move acceleration as well as a virtual "acceleration to deceleration" -rate. Using this system, the top speed of these short "zigzag" moves -are limited to smooth out the printer motion: +and increases the noise. Klipper implements a mechanism to ensure +there is always some movement at a cruising speed between acceleration +and deceleration. This is done by reducing the top speed of some moves +(or sequence of moves) to ensure there is a minimum distance traveled +at cruising speed relative to the distance traveled during +acceleration and deceleration. + +Klipper implements this feature by tracking both a regular move +acceleration as well as a virtual "acceleration to deceleration" rate: ![smoothed](img/smoothed.svg.png) Specifically, the code calculates what the velocity of each move would be if it were limited to this virtual "acceleration to deceleration" -rate (half the normal acceleration rate by default). In the above -picture the dashed gray lines represent this virtual acceleration rate -for the first move. If a move can not reach its full cruising speed -using this virtual acceleration rate then its top speed is reduced to -the maximum speed it could obtain at this virtual acceleration -rate. For most moves the limit will be at or above the move's existing +rate. In the above picture the dashed gray lines represent this +virtual acceleration rate for the first move. If a move can not reach +its full cruising speed using this virtual acceleration rate then its +top speed is reduced to the maximum speed it could obtain at this +virtual acceleration rate. + +For most moves the limit will be at or above the move's existing limits and no change in behavior is induced. For short zigzag moves, however, this limit reduces the top speed. Note that it does not change the actual acceleration within the move - the move continues to diff --git a/docs/Resonance_Compensation.md b/docs/Resonance_Compensation.md index aaeaf7abf054..31f1b35e3b05 100644 --- a/docs/Resonance_Compensation.md +++ b/docs/Resonance_Compensation.md @@ -48,8 +48,8 @@ First, measure the **ringing frequency**. to 5.0. It is not advised to increase it when using input shaper because it can cause more smoothing in parts - it is better to use higher acceleration value instead. -2. Increase `max_accel_to_decel` by issuing the following command: - `SET_VELOCITY_LIMIT ACCEL_TO_DECEL=7000` +2. Disable the `miminum_cruise_ratio` feature by issuing the following + command: `SET_VELOCITY_LIMIT MINIMUM_CRUISE_RATIO=0` 3. Disable Pressure Advance: `SET_PRESSURE_ADVANCE ADVANCE=0` 4. If you have already added `[input_shaper]` section to the printer.cfg, execute `SET_INPUT_SHAPER SHAPER_FREQ_X=0 SHAPER_FREQ_Y=0` command. If you @@ -149,7 +149,7 @@ a few other related parameters. Print the ringing test model as follows: 1. Restart the firmware: `RESTART` -2. Prepare for test: `SET_VELOCITY_LIMIT ACCEL_TO_DECEL=7000` +2. Prepare for test: `SET_VELOCITY_LIMIT MINIMUM_CRUISE_RATIO=0` 3. Disable Pressure Advance: `SET_PRESSURE_ADVANCE ADVANCE=0` 4. Execute: `SET_INPUT_SHAPER SHAPER_TYPE=MZV` 5. Execute the command: @@ -270,7 +270,7 @@ frequencies after enabling [input_shaper], this section will not help with that. Assuming that you have sliced the ringing model with suggested parameters, complete the following steps for each of the axes X and Y: -1. Prepare for test: `SET_VELOCITY_LIMIT ACCEL_TO_DECEL=7000` +1. Prepare for test: `SET_VELOCITY_LIMIT MINIMUM_CRUISE_RATIO=0` 2. Make sure Pressure Advance is disabled: `SET_PRESSURE_ADVANCE ADVANCE=0` 3. Execute: `SET_INPUT_SHAPER SHAPER_TYPE=ZV` 4. From the existing ringing test model with your chosen input shaper select @@ -331,7 +331,7 @@ with suggested parameters, print the test model 3 times as follows. First time, prior to printing, run 1. `RESTART` -2. `SET_VELOCITY_LIMIT ACCEL_TO_DECEL=7000` +2. `SET_VELOCITY_LIMIT MINIMUM_CRUISE_RATIO=0` 3. `SET_PRESSURE_ADVANCE ADVANCE=0` 4. `SET_INPUT_SHAPER SHAPER_TYPE=2HUMP_EI SHAPER_FREQ_X=60 SHAPER_FREQ_Y=60` 5. `TUNING_TOWER COMMAND=SET_VELOCITY_LIMIT PARAMETER=ACCEL START=1500 STEP_DELTA=500 STEP_HEIGHT=5` diff --git a/docs/Status_Reference.md b/docs/Status_Reference.md index 055d1dc0eac0..0e72a12b1f9f 100644 --- a/docs/Status_Reference.md +++ b/docs/Status_Reference.md @@ -511,7 +511,7 @@ The following information is available in the `toolhead` object limit value (eg, `axis_minimum.x`, `axis_maximum.z`). - For Delta printers the `cone_start_z` is the max z height at maximum radius (`printer.toolhead.cone_start_z`). -- `max_velocity`, `max_accel`, `max_accel_to_decel`, +- `max_velocity`, `max_accel`, `minimum_cruise_ratio`, `square_corner_velocity`: The current printing limits that are in effect. This may differ from the config file settings if a `SET_VELOCITY_LIMIT` (or `M204`) command alters them at run-time. diff --git a/klippy/configfile.py b/klippy/configfile.py index f099b563406d..b1f7d6d69e75 100644 --- a/klippy/configfile.py +++ b/klippy/configfile.py @@ -143,6 +143,8 @@ def __init__(self, printer): self.printer = printer self.autosave = None self.deprecated = {} + self.runtime_warnings = [] + self.deprecate_warnings = [] self.status_raw_config = {} self.status_save_pending = {} self.status_settings = {} @@ -314,6 +316,11 @@ def log_config(self, config): "======================="] self.printer.set_rollover_info("config", "\n".join(lines)) # Status reporting + def runtime_warning(self, msg): + logging.warn(msg) + res = {'type': 'runtime_warning', 'message': msg} + self.runtime_warnings.append(res) + self.status_warnings = self.runtime_warnings + self.deprecate_warnings def deprecate(self, section, option, value=None, msg=None): self.deprecated[(section, option, value)] = msg def _build_status(self, config): @@ -325,7 +332,7 @@ def _build_status(self, config): self.status_settings = {} for (section, option), value in config.access_tracking.items(): self.status_settings.setdefault(section, {})[option] = value - self.status_warnings = [] + self.deprecate_warnings = [] for (section, option, value), msg in self.deprecated.items(): if value is None: res = {'type': 'deprecated_option'} @@ -334,7 +341,8 @@ def _build_status(self, config): res['message'] = msg res['section'] = section res['option'] = option - self.status_warnings.append(res) + self.deprecate_warnings.append(res) + self.status_warnings = self.runtime_warnings + self.deprecate_warnings def get_status(self, eventtime): return {'config': self.status_raw_config, 'settings': self.status_settings, diff --git a/klippy/extras/heaters.py b/klippy/extras/heaters.py index 1c29aae81a16..5480501326b4 100644 --- a/klippy/extras/heaters.py +++ b/klippy/extras/heaters.py @@ -18,7 +18,8 @@ class Heater: def __init__(self, config, sensor): self.printer = config.get_printer() - self.name = config.get_name().split()[-1] + self.name = config.get_name() + self.short_name = short_name = self.name.split()[-1] # Setup sensor self.sensor = sensor self.min_temp = config.getfloat('min_temp', minval=KELVIN_TO_CELSIUS) @@ -36,6 +37,7 @@ def __init__(self, config, sensor): self.max_power = config.getfloat('max_power', 1., above=0., maxval=1.) self.smooth_time = config.getfloat('smooth_time', 1., above=0.) self.inv_smooth_time = 1. / self.smooth_time + self.is_shutdown = False self.lock = threading.Lock() self.last_temp = self.smoothed_temp = self.target_temp = 0. self.last_temp_time = 0. @@ -55,14 +57,16 @@ def __init__(self, config, sensor): self.mcu_pwm.setup_cycle_time(pwm_cycle_time) self.mcu_pwm.setup_max_duration(MAX_HEAT_TIME) # Load additional modules - self.printer.load_object(config, "verify_heater %s" % (self.name,)) + self.printer.load_object(config, "verify_heater %s" % (short_name,)) self.printer.load_object(config, "pid_calibrate") gcode = self.printer.lookup_object("gcode") gcode.register_mux_command("SET_HEATER_TEMPERATURE", "HEATER", - self.name, self.cmd_SET_HEATER_TEMPERATURE, + short_name, self.cmd_SET_HEATER_TEMPERATURE, desc=self.cmd_SET_HEATER_TEMPERATURE_help) + self.printer.register_event_handler("klippy:shutdown", + self._handle_shutdown) def set_pwm(self, read_time, value): - if self.target_temp <= 0.: + if self.target_temp <= 0. or self.is_shutdown: value = 0. if ((read_time < self.next_pwm_time or not self.last_pwm_value) and abs(value - self.last_pwm_value) < 0.05): @@ -86,7 +90,11 @@ def temperature_callback(self, read_time, temp): self.smoothed_temp += temp_diff * adj_time self.can_extrude = (self.smoothed_temp >= self.min_extrude_temp) #logging.debug("temp: %.3f %f = %f", read_time, temp) + def _handle_shutdown(self): + self.is_shutdown = True # External commands + def get_name(self): + return self.name def get_pwm_delay(self): return self.pwm_delay def get_max_power(self): @@ -127,7 +135,7 @@ def stats(self, eventtime): last_pwm_value = self.last_pwm_value is_active = target_temp or last_temp > 50. return is_active, '%s: target=%.0f temp=%.1f pwm=%.3f' % ( - self.name, target_temp, last_temp, last_pwm_value) + self.short_name, target_temp, last_temp, last_pwm_value) def get_status(self, eventtime): with self.lock: target_temp = self.target_temp diff --git a/klippy/extras/pid_calibrate.py b/klippy/extras/pid_calibrate.py index f32f1be79856..20641167224d 100644 --- a/klippy/extras/pid_calibrate.py +++ b/klippy/extras/pid_calibrate.py @@ -43,11 +43,12 @@ def cmd_PID_CALIBRATE(self, gcmd): "The SAVE_CONFIG command will update the printer config file\n" "with these parameters and restart the printer." % (Kp, Ki, Kd)) # Store results for SAVE_CONFIG + cfgname = heater.get_name() configfile = self.printer.lookup_object('configfile') - configfile.set(heater_name, 'control', 'pid') - configfile.set(heater_name, 'pid_Kp', "%.3f" % (Kp,)) - configfile.set(heater_name, 'pid_Ki', "%.3f" % (Ki,)) - configfile.set(heater_name, 'pid_Kd', "%.3f" % (Kd,)) + configfile.set(cfgname, 'control', 'pid') + configfile.set(cfgname, 'pid_Kp', "%.3f" % (Kp,)) + configfile.set(cfgname, 'pid_Ki', "%.3f" % (Ki,)) + configfile.set(cfgname, 'pid_Kd', "%.3f" % (Kd,)) TUNE_PID_DELTA = 5.0 diff --git a/klippy/extras/resonance_tester.py b/klippy/extras/resonance_tester.py index d249412cadcc..fe8717d58545 100644 --- a/klippy/extras/resonance_tester.py +++ b/klippy/extras/resonance_tester.py @@ -77,11 +77,11 @@ def run_test(self, axis, gcmd): systime = self.printer.get_reactor().monotonic() toolhead_info = toolhead.get_status(systime) old_max_accel = toolhead_info['max_accel'] - old_max_accel_to_decel = toolhead_info['max_accel_to_decel'] + old_minimum_cruise_ratio = toolhead_info['minimum_cruise_ratio'] max_accel = self.freq_end * self.accel_per_hz self.gcode.run_script_from_command( - "SET_VELOCITY_LIMIT ACCEL=%.3f ACCEL_TO_DECEL=%.3f" % ( - max_accel, max_accel)) + "SET_VELOCITY_LIMIT ACCEL=%.3f MINIMUM_CRUISE_RATIO=0" + % (max_accel,)) input_shaper = self.printer.lookup_object('input_shaper', None) if input_shaper is not None and not gcmd.get_int('INPUT_SHAPING', 0): input_shaper.disable_shaping() @@ -108,8 +108,8 @@ def run_test(self, axis, gcmd): gcmd.respond_info("Testing frequency %.0f Hz" % (freq,)) # Restore the original acceleration values self.gcode.run_script_from_command( - "SET_VELOCITY_LIMIT ACCEL=%.3f ACCEL_TO_DECEL=%.3f" % ( - old_max_accel, old_max_accel_to_decel)) + "SET_VELOCITY_LIMIT ACCEL=%.3f MINIMUM_CRUISE_RATIO=%.3f" + % (old_max_accel, old_minimum_cruise_ratio)) # Restore input shaper if it was disabled for resonance testing if input_shaper is not None: input_shaper.enable_shaping() diff --git a/klippy/mcu.py b/klippy/mcu.py index f9b547c94479..366f78062775 100644 --- a/klippy/mcu.py +++ b/klippy/mcu.py @@ -588,6 +588,7 @@ def __init__(self, config, clocksync): printer.register_event_handler("klippy:connect", self._connect) printer.register_event_handler("klippy:shutdown", self._shutdown) printer.register_event_handler("klippy:disconnect", self._disconnect) + printer.register_event_handler("klippy:ready", self._ready) # Serial callbacks def _handle_mcu_stats(self, params): count = params['count'] @@ -799,6 +800,21 @@ def _mcu_identify(self): self.register_response(self._handle_shutdown, 'shutdown') self.register_response(self._handle_shutdown, 'is_shutdown') self.register_response(self._handle_mcu_stats, 'stats') + def _ready(self): + if self.is_fileoutput(): + return + # Check that reported mcu frequency is in range + mcu_freq = self._mcu_freq + systime = self._reactor.monotonic() + get_clock = self._clocksync.get_clock + calc_freq = get_clock(systime + 1) - get_clock(systime) + mcu_freq_mhz = int(mcu_freq / 1000000. + 0.5) + calc_freq_mhz = int(calc_freq / 1000000. + 0.5) + if mcu_freq_mhz != calc_freq_mhz: + pconfig = self._printer.lookup_object('configfile') + msg = ("MCU '%s' configured for %dMhz but running at %dMhz!" + % (self._name, mcu_freq_mhz, calc_freq_mhz)) + pconfig.runtime_warning(msg) # Config creation helpers def setup_pin(self, pin_type, pin_params): pcs = {'endstop': MCU_endstop, diff --git a/klippy/toolhead.py b/klippy/toolhead.py index ce014365c6f9..d386ec8e923b 100644 --- a/klippy/toolhead.py +++ b/klippy/toolhead.py @@ -217,12 +217,19 @@ def __init__(self, config): # Velocity and acceleration control self.max_velocity = config.getfloat('max_velocity', above=0.) self.max_accel = config.getfloat('max_accel', above=0.) - self.requested_accel_to_decel = config.getfloat( - 'max_accel_to_decel', self.max_accel * 0.5, above=0.) - self.max_accel_to_decel = self.requested_accel_to_decel + self.min_cruise_ratio = config.getfloat('minimum_cruise_ratio', None, + below=1., minval=0.) + if self.min_cruise_ratio is None: + self.min_cruise_ratio = 0.5 + req_accel_to_decel = config.getfloat('max_accel_to_decel', None, + above=0.) + if req_accel_to_decel is not None: + config.deprecate('max_accel_to_decel') + self.min_cruise_ratio = 1. - min(1., (req_accel_to_decel + / self.max_accel)) self.square_corner_velocity = config.getfloat( 'square_corner_velocity', 5., minval=0.) - self.junction_deviation = 0. + self.junction_deviation = self.max_accel_to_decel = 0. self._calc_junction_deviation() # Input stall detection self.check_stall_time = 0. @@ -561,7 +568,7 @@ def get_status(self, eventtime): 'position': self.Coord(*self.commanded_pos), 'max_velocity': self.max_velocity, 'max_accel': self.max_accel, - 'max_accel_to_decel': self.requested_accel_to_decel, + 'minimum_cruise_ratio': self.min_cruise_ratio, 'square_corner_velocity': self.square_corner_velocity}) return res def _handle_shutdown(self): @@ -600,8 +607,7 @@ def get_max_velocity(self): def _calc_junction_deviation(self): scv2 = self.square_corner_velocity**2 self.junction_deviation = scv2 * (math.sqrt(2.) - 1.) / self.max_accel - self.max_accel_to_decel = min(self.requested_accel_to_decel, - self.max_accel) + self.max_accel_to_decel = self.max_accel * (1. - self.min_cruise_ratio) def cmd_G4(self, gcmd): # Dwell delay = gcmd.get_float('P', 0., minval=0.) / 1000. @@ -615,29 +621,34 @@ def cmd_SET_VELOCITY_LIMIT(self, gcmd): max_accel = gcmd.get_float('ACCEL', None, above=0.) square_corner_velocity = gcmd.get_float( 'SQUARE_CORNER_VELOCITY', None, minval=0.) - requested_accel_to_decel = gcmd.get_float( - 'ACCEL_TO_DECEL', None, above=0.) + min_cruise_ratio = gcmd.get_float( + 'MINIMUM_CRUISE_RATIO', None, minval=0., below=1.) + if min_cruise_ratio is None: + req_accel_to_decel = gcmd.get_float('ACCEL_TO_DECEL', + None, above=0.) + if req_accel_to_decel is not None and max_accel is not None: + min_cruise_ratio = 1. - min(1., req_accel_to_decel / max_accel) + elif req_accel_to_decel is not None and max_accel is None: + min_cruise_ratio = 1. - min(1., (req_accel_to_decel + / self.max_accel)) if max_velocity is not None: self.max_velocity = max_velocity if max_accel is not None: self.max_accel = max_accel if square_corner_velocity is not None: self.square_corner_velocity = square_corner_velocity - if requested_accel_to_decel is not None: - self.requested_accel_to_decel = requested_accel_to_decel + if min_cruise_ratio is not None: + self.min_cruise_ratio = min_cruise_ratio self._calc_junction_deviation() msg = ("max_velocity: %.6f\n" "max_accel: %.6f\n" - "max_accel_to_decel: %.6f\n" + "minimum_cruise_ratio: %.6f\n" "square_corner_velocity: %.6f" % ( self.max_velocity, self.max_accel, - self.requested_accel_to_decel, - self.square_corner_velocity)) + self.min_cruise_ratio, self.square_corner_velocity)) self.printer.set_rollover_info("toolhead", "toolhead: %s" % (msg,)) - if (max_velocity is None and - max_accel is None and - square_corner_velocity is None and - requested_accel_to_decel is None): + if (max_velocity is None and max_accel is None + and square_corner_velocity is None and min_cruise_ratio is None): gcmd.respond_info(msg, log=False) def cmd_M204(self, gcmd): # Use S for accel diff --git a/scripts/buildcommands.py b/scripts/buildcommands.py index 2acf3e84699d..236373c2f078 100644 --- a/scripts/buildcommands.py +++ b/scripts/buildcommands.py @@ -1,7 +1,7 @@ #!/usr/bin/env python2 # Script to handle build time requests embedded in C code. # -# Copyright (C) 2016-2021 Kevin O'Connor +# Copyright (C) 2016-2024 Kevin O'Connor # # This file may be distributed under the terms of the GNU GPLv3 license. import sys, os, subprocess, optparse, logging, shlex, socket, time, traceback @@ -518,6 +518,8 @@ def __init__(self): def update_data_dictionary(self, data): data['version'] = self.version data['build_versions'] = self.toolstr + data['app'] = 'Klipper' + data['license'] = 'GNU GPLv3' def generate_code(self, options): cleanbuild, self.toolstr = tool_versions(options.tools) self.version = build_version(options.extra, cleanbuild) diff --git a/src/avr/Kconfig b/src/avr/Kconfig index f1ad54395442..d4d78d279392 100644 --- a/src/avr/Kconfig +++ b/src/avr/Kconfig @@ -11,7 +11,7 @@ config AVR_SELECT select HAVE_GPIO_I2C select HAVE_GPIO_HARD_PWM select HAVE_STRICT_TIMING - select HAVE_LIMITED_CODE_SIZE if MACH_atmega168 || MACH_atmega328 || MACH_atmega328p + select HAVE_LIMITED_CODE_SIZE if MACH_atmega168 || MACH_atmega328 || MACH_atmega328p || MACH_atmega32u4 config BOARD_DIRECTORY string diff --git a/src/stm32/stm32f0_i2c.c b/src/stm32/stm32f0_i2c.c index e9cadccbdfad..21e65488eda0 100644 --- a/src/stm32/stm32f0_i2c.c +++ b/src/stm32/stm32f0_i2c.c @@ -44,6 +44,8 @@ struct i2c_info { #ifdef I2C3 DECL_ENUMERATION("i2c_bus", "i2c3_PB3_PB4", 5); DECL_CONSTANT_STR("BUS_PINS_i2c3_PB3_PB4", "PB3,PB4"); + DECL_ENUMERATION("i2c_bus", "i2c3_PC0_PC1", 6); + DECL_CONSTANT_STR("BUS_PINS_i2c3_PC0_PC1", "PC0,PC1"); #endif #elif CONFIG_MACH_STM32L4 DECL_ENUMERATION("i2c_bus", "i2c1_PB6_PB7", 0); @@ -99,6 +101,7 @@ static const struct i2c_info i2c_bus[] = { { I2C2, GPIO('B', 13), GPIO('B', 14), GPIO_FUNCTION(6) }, #ifdef I2C3 { I2C3, GPIO('B', 3), GPIO('B', 4), GPIO_FUNCTION(6) }, + { I2C3, GPIO('C', 0), GPIO('C', 1), GPIO_FUNCTION(6) }, #endif #elif CONFIG_MACH_STM32L4 { I2C1, GPIO('B', 6), GPIO('B', 7), GPIO_FUNCTION(4) }, diff --git a/src/stm32/stm32f0_serial.c b/src/stm32/stm32f0_serial.c index e48960f1163c..b7f067b63fe0 100644 --- a/src/stm32/stm32f0_serial.c +++ b/src/stm32/stm32f0_serial.c @@ -68,7 +68,7 @@ DECL_CONSTANT_STR("RESERVE_PINS_serial", "PD9,PD8"); #define GPIO_Rx GPIO('D', 9) #define GPIO_Tx GPIO('D', 8) - #define USARTx_FUNCTION GPIO_FUNCTION(7) + #define USARTx_FUNCTION GPIO_FUNCTION(CONFIG_MACH_STM32G0 ? 0 : 7) #define USARTx USART3 #define USARTx_IRQn USART3_IRQn #elif CONFIG_STM32_SERIAL_UART4