-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfiguration.h
36 lines (28 loc) · 1.97 KB
/
configuration.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* //////////////////////////////////////////////////////////////*
* *******LINE FOLLOWER ROBOT USING PID ALGORITHM*****************
*
* Authur: Thilina Satoru *
* NIBM: Higher Diploma - Robotic Application Development *
* Date: 12/24/2021 *
*///////////////////////////////////////////////////////////////*
///// Mortor pins ///////////////////////
#define INA_M1 4 // left backwards ////
#define INB_M1 5 // left forward ////
#define INC_M2 6 // right forward ////
#define IND_M2 7 // right backwards ////
/////////////////////////////////////////
///////////////////////////////// sensor inputs and pins ///////////////////////////////////////////////////////////
const int sInputs = 8; /// Number of Sensors //////
int sensorPins[sInputs] = {53, 51, 49, 47, 45, 43, 41, 39}; /// IR sensor array Digital pins in Arduino Mega //////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//// CHANGE THE CONSTANTS TO TUNE PID ///////////////////////////////////
const float Kp = 25.5; ////// P => Proportional present errors ////
const float Ki = 0.1; ////// I => Integral past errors ////
const float Kd = 9.0; ////// D => Derivative future errors ////
/////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
float maxSpeed = 180; // max speed the mortor can handle /////
float initSpeed = 100; // initialSpeed < 255(max) /////
float LeftSpeed = 0; // Left mortor speed /////
float RightSpeed = 0; // Right Mortor Speed /////
////////////////////////////////////////////////////////////////////////