AVR

AVR Урок 15. ПИД часть 2.

Posted on

#include <mega328p.h> #include <delay.h> float u = 0.0001; float e0 = 500.0, e1 = 0.000001; float Kp = 0.04, Ti = 0.055, Td = 0.00625; float e = 0.000001; float integral = 0.000001; float dif = 0.000001; float SP = 500.0; const float dt = 0.032768; interrupt [TIM0_OVF] void timer0_ovf_isr(void) { e0 = e1; e1 […]