|
679 | 679 |
|
680 | 680 | // @section hotend temp
|
681 | 681 |
|
682 |
| -// Enable PIDTEMP for PID control or MPCTEMP for Predictive Model. |
683 |
| -// temperature control. Disable both for bang-bang heating. |
684 |
| -#define PIDTEMP // See the PID Tuning Guide at https://reprap.org/wiki/PID_Tuning |
685 |
| -//#define MPCTEMP // ** EXPERIMENTAL ** |
| 682 | +/** |
| 683 | + * Temperature Control |
| 684 | + * |
| 685 | + * (NONE) : Bang-bang heating |
| 686 | + * PIDTEMP : PID temperature control (~4.1K) |
| 687 | + * MPCTEMP : Predictive Model temperature control. (~1.8K without auto-tune) |
| 688 | + */ |
| 689 | +#define PIDTEMP // See the PID Tuning Guide at https://reprap.org/wiki/PID_Tuning |
| 690 | +//#define MPCTEMP // ** EXPERIMENTAL ** See https://marlinfw.org/docs/features/model_predictive_control.html |
686 | 691 |
|
687 |
| -#define BANG_MAX 255 // Limits current to nozzle while in bang-bang mode; 255=full current |
688 |
| -#define PID_MAX BANG_MAX // Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current |
689 |
| -#define PID_K1 0.95 // Smoothing factor within any PID loop |
| 692 | +#define PID_MAX 255 // Limit hotend current while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current |
| 693 | +#define PID_K1 0.95 // Smoothing factor within any PID loop |
690 | 694 |
|
691 | 695 | #if ENABLED(PIDTEMP)
|
692 | 696 | //#define PID_DEBUG // Print PID debug data to the serial port. Use 'M303 D' to toggle activation.
|
|
708 | 712 | // #define DEFAULT_Ki 1.08
|
709 | 713 | // #define DEFAULT_Kd 114.00
|
710 | 714 | #endif
|
| 715 | +#else |
| 716 | + #define BANG_MAX 255 // Limit hotend current while in bang-bang mode; 255=full current |
711 | 717 | #endif
|
712 | 718 |
|
713 | 719 | /**
|
|
719 | 725 | * @section mpctemp
|
720 | 726 | */
|
721 | 727 | #if ENABLED(MPCTEMP)
|
722 |
| - //#define MPC_AUTOTUNE // Include a method to do MPC auto-tuning (~5664-5882 bytes of flash) |
723 |
| - //#define MPC_EDIT_MENU // Add MPC editing to the "Advanced Settings" menu. (~1300 bytes of flash) |
| 728 | + //#define MPC_AUTOTUNE // Include a method to do MPC auto-tuning (~6.3K bytes of flash) |
| 729 | + //#define MPC_EDIT_MENU // Add MPC editing to the "Advanced Settings" menu. (~1.3K bytes of flash) |
724 | 730 | //#define MPC_AUTOTUNE_MENU // Add MPC auto-tuning to the "Advanced Settings" menu. (~350 bytes of flash)
|
725 | 731 |
|
726 |
| - #define MPC_MAX BANG_MAX // (0..255) Current to nozzle while MPC is active. |
| 732 | + #define MPC_MAX 255 // (0..255) Current to nozzle while MPC is active. |
727 | 733 | #define MPC_HEATER_POWER { 40.0f } // (W) Heat cartridge powers.
|
728 | 734 |
|
729 | 735 | #define MPC_INCLUDE_FAN // Model the fan speed?
|
|
758 | 764 | //====================== PID > Bed Temperature Control ======================
|
759 | 765 | //===========================================================================
|
760 | 766 |
|
| 767 | +// @section bed temp |
| 768 | + |
| 769 | +/** |
| 770 | + * Max Bed Power |
| 771 | + * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). |
| 772 | + * When set to any value below 255, enables a form of PWM to the bed that acts like a divider |
| 773 | + * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) |
| 774 | + */ |
| 775 | +#define MAX_BED_POWER 235 // limits duty cycle to bed; 255=full current |
| 776 | + |
761 | 777 | /**
|
762 | 778 | * PID Bed Heating
|
763 | 779 | *
|
764 |
| - * If this option is enabled set PID constants below. |
765 |
| - * If this option is disabled, bang-bang will be used and BED_LIMIT_SWITCHING will enable hysteresis. |
766 |
| - * |
767 | 780 | * The PID frequency will be the same as the extruder PWM.
|
768 | 781 | * If PID_dT is the default, and correct for the hardware/configuration, that means 7.689Hz,
|
769 | 782 | * which is fine for driving a square wave into a resistive load and does not significantly
|
770 | 783 | * impact FET heating. This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W
|
771 | 784 | * heater. If your configuration is significantly different than this and you don't understand
|
772 | 785 | * the issues involved, don't use bed PID until someone else verifies that your hardware works.
|
773 |
| - * @section bed temp |
| 786 | + * |
| 787 | + * With this option disabled, bang-bang will be used. BED_LIMIT_SWITCHING enables hysteresis. |
774 | 788 | */
|
775 | 789 | #define PIDTEMPBED
|
776 | 790 |
|
777 |
| -//#define BED_LIMIT_SWITCHING |
778 |
| - |
779 |
| -/** |
780 |
| - * Max Bed Power |
781 |
| - * Applies to all forms of bed control (PID, bang-bang, and bang-bang with hysteresis). |
782 |
| - * When set to any value below 255, enables a form of PWM to the bed that acts like a divider |
783 |
| - * so don't use it unless you are OK with PWM on your bed. (See the comment on enabling PIDTEMPBED) |
784 |
| - */ |
785 |
| -#define MAX_BED_POWER 235 // limits duty cycle to bed; 255=full current |
786 |
| - |
787 | 791 | #if ENABLED(PIDTEMPBED)
|
788 | 792 | //#define MIN_BED_POWER 0
|
789 | 793 | //#define PID_BED_DEBUG // Print Bed PID debug data to the serial port.
|
|
799 | 803 | // #define DEFAULT_bedKd 305.4
|
800 | 804 |
|
801 | 805 | // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles.
|
802 |
| -#endif // PIDTEMPBED |
| 806 | +#else |
| 807 | + //#define BED_LIMIT_SWITCHING // Keep the bed temperature within BED_HYSTERESIS of the target |
| 808 | +#endif |
803 | 809 |
|
804 | 810 | //===========================================================================
|
805 | 811 | //==================== PID > Chamber Temperature Control ====================
|
|
0 commit comments