Robotics StackExchange | Archived questions

How to design a PID controller(line follower)?

Hello, everyone! I want know how can I design a PID controller for a line follower. I was thinking that maybe I should obtain a graph of speed versus time of each motor, when subjected to a constant acceleration. In this way, I would find out the transfer function of motors. But, the line follower system has sensors besides motors, so Should I be figure out this transfer function too? Which method you recommend to me?

Asked by TorLee on 2022-12-20 22:06:26 UTC

Comments

With your robot, what kind of commands do you send to ask it to move? In many ros systems, you periodically publish a Twist message to a cmd_vel topic.

Asked by Mike Scheutzow on 2022-12-21 07:32:41 UTC

Thanks for you answer. I understood what you said. But I'm talking about the best way to controller. In this way, I wish know any method for PID control for this case.

Asked by TorLee on 2022-12-21 08:53:05 UTC

My point is that you should design a controller that works at the proper level, but you have not told us whether you want your node to work at high-level (for example, Twist messages) or low-level (for example, sending wheel speed commands to motor controller hardware.)

You should take advantage of the capabilities that your robot already has, but you haven't explained to us what those are. The robot will have very different transfer functions depending on what level your code is working at.

Asked by Mike Scheutzow on 2022-12-21 10:16:54 UTC

Ok. I want that the code works in low level. Because I prioritize performance

Asked by TorLee on 2022-12-21 11:27:55 UTC

Answers