Giter VIP home page Giter VIP logo

fastpid's Issues

Hello my friend

Help with the FastPID library. When the feedback changes, the output changes between 0 and 1.

Update License

I have ported this to C.

I desire to add a MIT License on my forked repository: https://github.com/SRA-VJTI/FastPID

Since your License file is missing the copyright names and year, technically I can re license.

Can you please let me know if it is possible

allow for fractional parameters

I'm not sure if this is an issue for your target application, but oftentimes a parameter value of 1 is just too big. older industrial pids (whose internals are all integer math) will often divide the parameter by a fixed value (and tell the user what that is). So it might be /10 for P and D, /100 for I. The user then enters a P of 50 if they want 5. This allows the user to have an effective P value of as low as 0.1, which can be helpful for aggressive processes.

fixed point

I'd like your thoughts on avoiding the use of floats altogether.
Patched FastPID so the library uses fixed-point integers instead of float.
You define a scale factor SCALE in FastPID.h.
Kp, Ki, Kd and hz are then fixed-point integers, witch scaling factor SCALE.
Use case is a small arm processor without FPU.
What is your opinion?

FastPID_patch.txt

Sous Vide example

Should the step() be called in a blink without delay type of conditional statement ensuring 10hz is achieved or is 200ms delay at end of loop sufficient?

type conflict

In line 53 of FastPID.h the variable _p is defined as uint32_t.
In line 88 of FastPID.cpp "P = int32_t(_p) * int32_t(err);" is used as signed int.
This is should not be an issue but maybe the definition should be fixed.

v1.3.2 not released to Arduino?

Hi!

Forgive my ignorance, but when I use the Arduino library manager (v1.8.13) I can only install FastPID up to v1.3.1.

You released v1.3.2 back in 2019.

How are your changes propagated to Arduino library manager?

Ported to C

I don't know if this is of interest to anyone, but I've ported this to straight C so that I can use it with avr-gcc rather than Arduino. You can find the fork at https://github.com/larsks/FastPID. Since there's nothing AVR-specific in the code, I've also added some simple unit tests that compile on the host.

I have not yet ported the example code: because the standard avr-libc environment has neither millis()/micros() nor any serial support I'll have to add in some additional code to make the examples work as intended.

The new unit tests are run by travis for pull requests and commits.

Use FastPID for cooling?

Hi

I wonder how to use FastPID for cooling, i.e. you want the output to increase when the input increases? One way of doing it would be to use negative Kp,Ki and Kd. But the FastPID do not accept values below 0. By modifying the library I have done tests with negative values and works as intended, but I assume the check for negative values are there for a reason?

/Henrik

Appying bit shift to possibly negative value.

In the step() function in the end there is:
// Remove the integer scaling factor.
int16_t rval = out >> PARAM_SHIFT;
out variable type here is: int64_t out
When applying shift to the negative integer, the sign bit gets shifted also and may mess up the result.
So when the limits are set to allow also for negative values, what happens? Or are only postitive values allowed, and I missed that? Seems to be no check done for that in the code to allow only positive values.

[Feature Request] Setting a maximum and minimum output

Hello!

Thanks for your excellent library, I'm using it to control a boost regulator, and I'd like to make a feature request - The PWM to the FET needs to be constrained between 30 and 180, and doing so without your library being "aware" causes it to seemingly rise above 180 internally. This means when the feedback drops below the setpoint, the output takes a long time to drop back down from whatever it is internally to less than 180. Similarly to the upper end, the library takes a long time to begin increasing the output, since it has to go from 0-30 before anything appears to happen.

With a built-in constrain function, the values would be clamped internally so this wouldn't be a problem.

Thanks
-Elijah

how to use setoutput range?

Hi, newbie here.

How do i use the bool setOutputRange(int16_t min, int16_t max); command to set the range i cant figure it out. Thankyou :)

[Feature Reques] Anti-windup

You enabled setting the max and min output - can you also clamp the integer term to a settable limit, not just the limit of the int32? This will enable better motor tuning.

Thanks!
Saul

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.