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 aa69a03 commit 809e065
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions dcservoESP_wifi.ino
Expand Up @@ -217,8 +217,7 @@ void loop() {
if(!client) client = server.available();
input = encoder0Pos;
setpoint=target1;
myPID.Compute();
//if(Serial.available()) process_line();
while(!myPID.Compute()); // wait till PID is actually computed
if(client && client.available()) process_line();
pwmOut(output);
if(auto1) if(millis() % 3000 == 0) target1=random(2000); // that was for self test with no input from main controller
Expand Down

0 comments on commit 809e065

Please sign in to comment.