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

Reverse type of controller #14

Open
bmandl opened this issue May 30, 2015 · 2 comments
Open

Reverse type of controller #14

bmandl opened this issue May 30, 2015 · 2 comments

Comments

@bmandl
Copy link

bmandl commented May 30, 2015

This two lines of code are made for DIRECT type of pid controller. What if user wants reverse type? Output will never step in other direction. We have to swap +'s and -'s.

    //oscillate the output base on the input's relation to the setpoint

    if(refVal>setpoint+noiseBand) *output = outputStart-oStep;
    else if (refVal<setpoint-noiseBand) *output = outputStart+oStep;

To this:

    //oscillate the output base on the input's relation to the setpoint

    if(refVal>setpoint+noiseBand) *output = outputStart+oStep;
    else if (refVal<setpoint-noiseBand) *output = outputStart-oStep;
@br3ttb
Copy link
Owner

br3ttb commented May 30, 2015

this is a valid problem. if you (or someone) deals with it in a branch I will merge.

@bmandl
Copy link
Author

bmandl commented May 30, 2015

I wouldn't find out if I wouldn't strugle with this issue for a month. First, when I had no idea what is wrong, I tried to solve it with setting output step to negative value. Oscilation acctualy worked, but parameters were negative. So I jumped into source of library.

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

2 participants