Can the Arduino PID library Output negative numbers?

Status
Not open for further replies.

Justinli

Member level 4
Joined
Apr 29, 2021
Messages
76
Helped
0
Reputation
0
Reaction score
2
Trophy points
8
Activity points
413
Can the Arduino PID library Output negative numbers?
 

Hi,

I guess you already did read the according documentation....

How are the input and output variables defined? This should give at least a clue

Klaus
 

The variables are declared as signed, double, however there is a basic example
using a PWM as output, which one would think is unsigned...In example .ino
file I see no casting to unsigned.

Take a look at C code in library....


Regards, Dana.
 

The sample program in the PID library that I use has no negative numbers.
I heard that it can be done by modifying the library file.
 

Hi

It says "double", which is floating point. It always is with negative

Klaus
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…