Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added data labeling task 2 assigned to shubham(10) #15

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added 10 - Labeling task2.zip
Binary file not shown.
Binary file added 10_labels.zip
Binary file not shown.
39 changes: 39 additions & 0 deletions PID code.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
int analogPin = 3; // connected to pressure sensors (middle terminal) connected to analog pin 3

int Kp ;//constant multiplied with the Proportional to fine tune the system
int Ki ;//constant multiplied with the integral part to fine tune the system
int Kd ;//constant multiplied with the differential part to fine tune the system
int val = 0; // variable to store the value read
int p ;
int i ;
int d ;
int e ;
int s ;
int t1;
int t2=1;

void set (int sp,int p,int i,int d)
{
s=sp;
Kp=p;
Ki=i;
Kd=d;
}


void setup()
{
Serial.begin(9600); // setup serial(9600 times the arduino chip will commuicaten with the computer
}

void loop()
{
t1++;
val = analogRead(analogPin); // read the input pin
Serial.println(val); // debug value
e = s-val;
p=e*Kp;
i=(i+e)*Ki;
d=((e-d)/(t2-t1))*Kd;
t2++;
}