m-lundberg / simple-pid

A simple and easy to use PID controller in Python
MIT License
767 stars 209 forks source link

usage question #20

Closed HaroldSP closed 4 years ago

HaroldSP commented 4 years ago

Hello everyone!

Is there any more detailed usage example?

Let's say, I have a car with a range sensor, which gives me the distance to the wall, and I have the desired distance, so according to an error I send different PWM values to motors.

How the code would look like?

Thanks.

m-lundberg commented 4 years ago

Hello!

There are a few examples in the readme and a complete example application. Is there something specific you don't understand from those examples?

You probably want to set the output_limits on your PID controller to (0, 255) or whatever the max PWM output is in your case.

HaroldSP commented 4 years ago

Thanks!

The example helped.