Log into Tinkercad, build the circuit above, and run the code. Then, intentionally destabilize it. Set Kp = 10 and watch the Serial Plotter explode. Then fix it. That is how you master PID.
// Visualization for Tinkercad Serial Plotter Serial.print("Setpoint:"); Serial.print(setpoint); Serial.print(","); Serial.print("RPM:"); Serial.print(input); Serial.print(","); Serial.print("PWM:"); Serial.println(output); tinkercad pid control