How to design a PID controller(line follower)?

asked 2022-12-20 21:06:26 -0500

TorLee gravatar image

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?

edit retag flag offensive close merge delete

Comments

1

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.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-12-21 06:32:41 -0500 )edit

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.

TorLee gravatar image TorLee  ( 2022-12-21 07:53:05 -0500 )edit
2

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.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-12-21 09:16:54 -0500 )edit

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

TorLee gravatar image TorLee  ( 2022-12-21 10:27:55 -0500 )edit