Hello,
Please find the answer
attached below. If the answer has helped you please give a
thumbs up rating. Thank you and have a nice
day!
NOTE: Since you have not mentioned which language to code in, I am supplying you the pseudo-code for the PID controllers for straight line motionn as well as the speed:
********* Pseudo Code ********
int sum1=0;
int sum2=0;
while()
{
int errorPos = position - 1000; // desired setpoint of position = 1000
int errorspeed = speed - 10; // desired setpoint for speed = 10
int newAngle = Kp1 * errorPos + Kd1* (errorPos - lastError1) + Ki1*(sum1);
int newSpeed = Kp2 * errorspeed + Kd2* (errorspeed - lastError2)
+ Ki2*(sum2);
lastError1 = errorPos;
lastError2 = errorspeed;
sum1 = sum1+errorPos;
sum2 = sum2+errorspeed;
int headingAngle = BaseAngle + newAngle;
int speed = Basespeed + newspeed;
}
*************************************************************
PS: Please do not forget the thumbs
up!!
Project Description: PID is used widely in many applications such as temperature control systems, automotive indust...
By using Arduino Uno
Project Description: PID is used widely in many applications such as temperature control systems, automotive industries, and robotics. In this project, you will implement multiple PID controllers on a zumo robot. The robot must move in a straight line without drifting and it must adjust its speed when it is approaching an obstacle or when an obstacle suddenly gets in its way. To achieve the above part, you will use two PID controllers; one for the...
write the whole code please by using Arduino Uno
Project Description: PID is used widely in many applications such as temperature control systems, automotive industries, and robotics. In this project, you will implement multiple PID controllers on a zumo robot. The robot must move in a straight line without drifting and it must adjust its speed when it is approaching an obstacle or when an obstacle suddenly gets in its way. To achieve the above part, you will use two...