-
Thread
Schaltung für DC Drehzahlregelung mit optischer Rückkopplung gesucht
geht. Schaltplan anbei. Das Programm kann eine KI erstellen [c] /* * main.c * * ATtiny85 / AVR-GCC * * CPU: 8 MHz * Fan PWM: 25 kHz, OC0B / PB1 * Optical sensor: PB3 / PCINT3, active LOW * Target: 90 RPM (1 pulse/revolution) * Measurement:
volatile uint8_t pulse_received = 0; volatile uint8_t have_pulse = 0; static uint8_t pwm_value = 20; static int16_t kp = 26; // Q8.8 static int16_t ki = 2; // Q8.8 static int16_t kd = 0; // Q8.8 static int32_t integral = 20L * Q8; static int16_t last_error = 0; static uint32_t last_control_ms