From 913d7d6304f15cdfcf4d38b544fc37bcc0d421e6 Mon Sep 17 00:00:00 2001 From: Kevin Harrington Date: Thu, 22 Jun 2017 00:40:56 -0400 Subject: [PATCH] merge --- src/main.cpp | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index c7a562b..540d7ed 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -14,17 +14,6 @@ void runPid(){ // next update all control outputs for (int i=0;iupdateControl(); -//Handle any chip errors after the critical timing -<<<<<<< HEAD - //for (int i=0;iencoder->error.status) - pid[0]->encoder->handleErrors(); -======= - // for (int i=0;iencoder->error.status) - // pid[i]->encoder->handleErrors(); ->>>>>>> 1c7e80a67149c5392c883f52c8119d793b79b7e5 - } int main() { @@ -39,21 +28,13 @@ void runPid(){ for (int i=0;istate.config.Enabled=false;// disable PID to start with } -<<<<<<< HEAD pidTimer.attach(&runPid, 0.004); -======= - pidTimer.attach(&runPid, 0.001); ->>>>>>> 1c7e80a67149c5392c883f52c8119d793b79b7e5 // capture 100 ms of encoders before starting wait_ms(100); for (int i=0;iInitilizePidController(); -<<<<<<< HEAD //pid[i]->ZeroPID();// set the current encoder value to 0 -======= - pid[i]->ZeroPID();// set the current encoder value to 0 ->>>>>>> 1c7e80a67149c5392c883f52c8119d793b79b7e5 // this should be replaced by calibration routine pid[i]->SetPIDEnabled( true);// Enable PID to start control } @@ -71,11 +52,7 @@ void runPid(){ pid[0]->startHomingLink( CALIBRARTION_home_velocity, 123); */ float timeBetweenPrints = 2000; -<<<<<<< HEAD float bounds = 800; -======= - float bounds = 500; ->>>>>>> 1c7e80a67149c5392c883f52c8119d793b79b7e5 RunEveryObject printer(0,1000); RunEveryObject setpoint(0,timeBetweenPrints); float iterator=0; @@ -87,7 +64,6 @@ void runPid(){ if(setpoint.RunEvery(current)>0){ // sweep some setpoints if(direction) -<<<<<<< HEAD iterator+=bounds/4; else iterator-=bounds/4; @@ -98,18 +74,6 @@ void runPid(){ pid[0]->state.Output, pid[0]->state.OutputSet ); -======= - iterator+=bounds/3; - else - iterator-=bounds/3; - if(iterator>bounds){ - direction=false; - } - if(iterator<-bounds){ - direction=true; - } - ->>>>>>> 1c7e80a67149c5392c883f52c8119d793b79b7e5 for (int i=0;ibounds){ direction=false; } @@ -128,9 +91,6 @@ void runPid(){ direction=true; } -======= - printf("\n\nUpdating setpoint %f\n\n",iterator); ->>>>>>> 1c7e80a67149c5392c883f52c8119d793b79b7e5 } wait_ms(1);