Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to tune setOutputLimits for two different motor? #13

Open
ghost opened this issue Apr 4, 2023 · 1 comment
Open

how to tune setOutputLimits for two different motor? #13

ghost opened this issue Apr 4, 2023 · 1 comment

Comments

@ghost
Copy link

ghost commented Apr 4, 2023

I am using this code to control the speed of two dc motors. But the output is not what I am expecting. I have set the bias to 0 as I only wish to get the PID value for my error. As I am using two motors and want them to work like differential, I plan to manually add and subtract the PID value with my motor's base speed (base speed = 200).
But the problem is when I set output limits to (0, 255), after mycontroller.calculate() I am getting an output value of either 0 or 255 resulting in my ultimate motor speed1 = base speed + output = 455 and motor speed2 = base speed - output = -55. But I expect a value between 0 and 255 depending on the error. Any hints on how I can achieve that?

@PowerBroker2
Copy link
Owner

I'm not sure I understand your approach/issue, but regardless: the bias is the output bias. Usually, this is set to the midpoint between your min and max output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant