Add PID_FAN_SCALING option (#15585)
This commit is contained in:
@ -55,15 +55,23 @@ typedef enum : int8_t {
|
||||
// PID storage
|
||||
typedef struct { float Kp, Ki, Kd; } PID_t;
|
||||
typedef struct { float Kp, Ki, Kd, Kc; } PIDC_t;
|
||||
#if ENABLED(PID_EXTRUSION_SCALING)
|
||||
typedef PIDC_t hotend_pid_t;
|
||||
#if LPQ_MAX_LEN > 255
|
||||
typedef uint16_t lpq_ptr_t;
|
||||
typedef struct { float Kp, Ki, Kd, Kf; } PIDF_t;
|
||||
typedef struct { float Kp, Ki, Kd, Kc, Kf; } PIDCF_t;
|
||||
|
||||
typedef
|
||||
#if BOTH(PID_EXTRUSION_SCALING, PID_FAN_SCALING)
|
||||
PIDCF_t
|
||||
#elif ENABLED(PID_EXTRUSION_SCALING)
|
||||
PIDC_t
|
||||
#elif ENABLED(PID_FAN_SCALING)
|
||||
PIDF_t
|
||||
#else
|
||||
typedef uint8_t lpq_ptr_t;
|
||||
PID_t
|
||||
#endif
|
||||
#else
|
||||
typedef PID_t hotend_pid_t;
|
||||
hotend_pid_t;
|
||||
|
||||
#if ENABLED(PID_EXTRUSION_SCALING)
|
||||
typedef IF<(LPQ_MAX_LEN > 255), uint16_t, uint8_t>::type lpq_ptr_t;
|
||||
#endif
|
||||
|
||||
#define DUMMY_PID_VALUE 3000.0f
|
||||
@ -77,6 +85,12 @@ typedef struct { float Kp, Ki, Kd, Kc; } PIDC_t;
|
||||
#else
|
||||
#define _PID_Kc(H) 1
|
||||
#endif
|
||||
|
||||
#if ENABLED(PID_FAN_SCALING)
|
||||
#define _PID_Kf(H) Temperature::temp_hotend[H].pid.Kf
|
||||
#else
|
||||
#define _PID_Kf(H) 0
|
||||
#endif
|
||||
#else
|
||||
#define _PID_Kp(H) DUMMY_PID_VALUE
|
||||
#define _PID_Ki(H) DUMMY_PID_VALUE
|
||||
|
Reference in New Issue
Block a user