Jul 14, 2021 #1 J 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?
Jul 14, 2021 #2 KlausST Advanced Member level 7 Joined Apr 17, 2014 Messages 26,106 Helped 4,916 Reputation 9,857 Reaction score 5,763 Trophy points 1,393 Activity points 175,443 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 Upvote 0 Downvote
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
Jul 14, 2021 #3 danadakk Advanced Member level 6 Joined Mar 26, 2018 Messages 3,518 Helped 426 Reputation 875 Reaction score 803 Trophy points 113 Activity points 15,058 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. Upvote 0 Downvote
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.
Jul 16, 2021 #4 J Justinli Member level 4 Joined Apr 29, 2021 Messages 76 Helped 0 Reputation 0 Reaction score 2 Trophy points 8 Activity points 413 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. Upvote 0 Downvote
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.
Jul 16, 2021 #5 KlausST Advanced Member level 7 Joined Apr 17, 2014 Messages 26,106 Helped 4,916 Reputation 9,857 Reaction score 5,763 Trophy points 1,393 Activity points 175,443 Hi It says "double", which is floating point. It always is with negative Klaus Upvote 0 Downvote