|
Algoritmo PID M303 February 16, 2021 05:20AM |
Registered: 11 years ago Posts: 292 |
|
Re: Algoritmo PID M303 February 16, 2021 11:55AM |
Registered: 8 years ago Posts: 1,059 |
act->pid.Max
t1 = millis(),
t2 = t1;
t_high = 0.0,
t_low = 0.0;
maxTemp = 0.0,
minTemp = 1000.0;
Ku = (4.0f * d) / (float(M_PI) * (maxTemp - minTemp) * 0.5f),
Tu = ((float)(t_low + t_high) * 0.001f);
tune_pid.Kp = 0.6f * Ku;
tune_pid.Ki = 1.2f * Ku / Tu;
tune_pid.Kd = 0.075f * Ku * Tu;
bias += (d * (t_high - t_low)) / (t_low + t_high);
bias = constrain(bias, 20, pid.Max - 20);
d = (bias > pid.Max/2) ? pid.Max - 1 - bias : bias;
if(bias > pid.Max / 2) {
pid.Max - 1 - bias;
} else {
bias;
}
bias = act->pid.Max >> 1, d = act->pid.Max >> 1;
bias = constrain(bias, 20, pid.Max - 20);
pwm_value = (bias + d);
if (method == 0) {
|
Re: Algoritmo PID M303 February 17, 2021 04:34AM |
Registered: 11 years ago Posts: 292 |
|
Re: Algoritmo PID M303 February 19, 2021 01:17PM |
Registered: 8 years ago Posts: 1,059 |