Skip to content

Commit

Permalink
Fix pid timing problem
Browse files Browse the repository at this point in the history
  • Loading branch information
misan committed Jul 18, 2016
1 parent d458dcc commit 814ea9d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dcservoProMicro_trapezoidal.ino
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void loop() {
vel = encoder0Pos - input;
input = encoder0Pos;
setpoint = target1;
myPID.Compute();
while(!myPID.Compute()); // wait till PID is actually computed
setspeed = output;
if (Serial.available()) process_line(); // it may induce a glitch to move motion, so use it sparingly
if (auto1) if (millis() % 1000 == 0) trapezoidal(random(6000)); //target1 = random(2000); // that was for self test with no input from main controller
Expand Down

0 comments on commit 814ea9d

Please sign in to comment.