0
$\begingroup$

I need help creating a 4 sensor PID wall follower, which has two walls either side of the robot and the goal is to keep the robot central and not crash into the walls, the sensors are positioned in the following photo:
Sensors

So far I have successfully created a right side PID wall follower using sensors 1 and 3 but I am not sure how I should combine the right and left side, I am not sure if I should work out the total error rate for the right and left side then take it away, or work out the total PID by taking the PID from the right and left values.

Any help would be greatly appreciated : )

$\endgroup$
3
  • $\begingroup$ Use the 4 sensors to estimate your x offset relative to the center between the walls then feed it into your PID controller. Also I have seen many people try this on smaller robots with IR sensors/ultrasonics but forget to check if the range they read is the near the max range for the sensor. Most basic trig calculations you make to estimate x offset will assume good distance measurements for all 4 sensors. Just noting that because I have seen it bite people before. $\endgroup$ – EngineeringStudent Dec 11 '19 at 8:44
  • $\begingroup$ People also do combined schemes where they also try to control heading of their robot relative to the wall at the same time they correct x offset $\endgroup$ – EngineeringStudent Dec 11 '19 at 8:44
  • $\begingroup$ Great answer @EngineeringStudent. Why not make it a real answer so that people can up vote it. Comments are for helping to improve questions and answers, and are distracting, so we try to keep them to a minimum. Partial answers, or answers you aren't confident about should still be posted as answers, since they can be improved by future edits. Comments should be considered ephemeral, any comment which no longer actively helps to improve a question or answer may be deleted at any time to tidy up a post. $\endgroup$ – Ben Dec 14 '19 at 14:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.