Loading
Loading
IoT Lab content is currently available in Arabic only. We're working on an English version.
عرض بالعربية →How do drones maintain their balance? Understanding the math behind smooth movement.
float error = setPoint - currentPosition;
float P = Kp * error;
I = I + (Ki * error);
float D = Kd * (error - lastError);
float output = P + I + D;
lastError = error;
// استخدم output لضبط سرعة المحركاتSetting a high Kp constant that causes the robot to oscillate violently and lose the line entirely. Tuning the constants is an art that requires trial and error.