Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

control_mpc: add MPC control law #333

Merged
merged 2 commits into from
Aug 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,17 @@ See the [Danger Features document](https://dangerklipper.io/Danger_Features.html

- [fan: reverse FAN](https://github.com/DangerKlippers/danger-klipper/pull/51) ([klipper#4983](https://github.com/Klipper3d/klipper/pull/4983))

- [heater: modify PID without reload](https://github.com/DangerKlippers/danger-klipper/pull/35)
- [heaters: modify PID without reload](https://github.com/DangerKlippers/danger-klipper/pull/35)

- [heater: velocity PID](https://github.com/DangerKlippers/danger-klipper/pull/47) ([klipper#6272](https://github.com/Klipper3d/klipper/pull/6272))
- [heaters: MPC temperature control](https://github.com/DangerKlippers/danger-klipper/pull/333)

- [heater: PID-Profiles](https://github.com/DangerKlippers/danger-klipper/pull/162)
- [heaters: velocity PID](https://github.com/DangerKlippers/danger-klipper/pull/47) ([klipper#6272](https://github.com/Klipper3d/klipper/pull/6272))

- [heater: expose heater thermistor out of min/max](https://github.com/DangerKlippers/danger-klipper/pull/182)
- [heaters: PID-Profiles](https://github.com/DangerKlippers/danger-klipper/pull/162)

- [heater/fan: new heated_fan module](https://github.com/DangerKlippers/danger-klipper/pull/259)
- [heaters: expose heater thermistor out of min/max](https://github.com/DangerKlippers/danger-klipper/pull/182)

- [heaters/fan: new heated_fan module](https://github.com/DangerKlippers/danger-klipper/pull/259)

- [gcode: jinja2.ext.do extension](https://github.com/DangerKlippers/danger-klipper/pull/26) ([klipper#5149](https://github.com/Klipper3d/klipper/pull/5149))

Expand Down Expand Up @@ -119,8 +121,6 @@ See the [Danger Features document](https://dangerklipper.io/Danger_Features.html
If you're feeling adventurous, take a peek at the extra features in the bleeding-edge-v2 branch [feature documentation](docs/Bleeding_Edge.md)
and [feature configuration reference](docs/Config_Reference_Bleeding_Edge.md):

- [heaters: mpc temperature control](https://github.com/DangerKlippers/danger-klipper/pull/268)

- [extruder/pa: do not smooth base extruder position, only advance](https://github.com/DangerKlippers/danger-klipper/pull/266)

- [core: non-critical-mcus](https://github.com/DangerKlippers/danger-klipper/pull/265)
Expand Down
25 changes: 20 additions & 5 deletions docs/Config_Reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,8 @@ The extruder section is used to describe the heater parameters for the
nozzle hotend along with the stepper controlling the extruder. See the
[command reference](G-Codes.md#extruder) for additional information.
See the [pressure advance guide](Pressure_Advance.md) for information
on tuning pressure advance.
on tuning pressure advance. See [PID](PID.md) or [MPC](MPC.md) for more
detailed information about the control methods.

```
[extruder]
Expand Down Expand Up @@ -1022,12 +1023,14 @@ sensor_pin:
# be smoothed to reduce the impact of measurement noise. The default
# is 1 seconds.
control:
# Control algorithm (either pid, pid_v or watermark). This parameter must
# Control algorithm (either pid, pid_v, watermark or mpc). This parameter must
# be provided. pid_v should only be used on well calibrated heaters with
# low to moderate noise.
pid_Kp:
pid_Ki:
pid_Kd:
#
# If control: pid or pid_v
#pid_Kp:
#pid_Ki:
#pid_Kd:
# The proportional (pid_Kp), integral (pid_Ki), and derivative
# (pid_Kd) settings for the PID feedback control system. Klipper
# evaluates the PID settings with the following general formula:
Expand All @@ -1037,11 +1040,23 @@ pid_Kd:
# off and 1.0 being full on. Consider using the PID_CALIBRATE
# command to obtain these parameters. The pid_Kp, pid_Ki, and pid_Kd
# parameters must be provided for PID heaters.
#
# If control: watermark
#max_delta: 2.0
# On 'watermark' controlled heaters this is the number of degrees in
# Celsius above the target temperature before disabling the heater
# as well as the number of degrees below the target before
# re-enabling the heater. The default is 2 degrees Celsius.
#
# If control: mpc
# See MPC.md for details about these parameters.
rogerlz marked this conversation as resolved.
Show resolved Hide resolved
#heater_power:
#cooling_fan:
#ambient_temp_sensor:
#filament_diameter: 1.75
#filament_density: 1.2
#filament_heat_capacity: 1.8
#
#pwm_cycle_time: 0.100
# Time in seconds for each software PWM cycle of the heater. It is
# not recommended to set this unless there is an electrical
Expand Down
2 changes: 1 addition & 1 deletion docs/Danger_Features.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
- [`[z_tilt/quad_gantry_level] increasing_threshold`](./Config_Reference.md#z_tilt) allows you to customize the allowed variation when probing multiple times

## Heaters, Fans, and PID changes

- [Model Predictive Control](./MPC.md) is an advanced temperature control method that offers an alternative to traditional PID control.
- [Velocity PID](./PID.md) can be more accurate than positional PID, but is more susceptible to noisy sensors and may require larger smoothing times
- [`PID_PROFILE [LOAD/SAVE]`](./G-Codes.md#pid_profile) allows you to calibrate and save PID profiles at multiple temperatures and fan speeds, and later restore them. With some clever macros, automatic per-material pid tuning is within reach!
- [`SET_HEATER_PID HEATER= KP= KI= KD=`](./G-Codes.md#set_heater_pid) can update your PID parameters without a reload.
Expand Down
Loading
Loading