Skip to content

Commit 9c798fd

Browse files
committed
Minor formatting
1 parent 268bddb commit 9c798fd

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

QuickPID.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ QuickPID::QuickPID(int16_t* Input, uint8_t* Output, int16_t* Setpoint,
2727
mySetpoint = Setpoint;
2828
inAuto = false;
2929

30-
QuickPID::SetOutputLimits(0, 255); // default is same as the arduino PWM limit
30+
QuickPID::SetOutputLimits(0, 255); // default is same as the arduino PWM limit
3131
SampleTimeUs = 100000; // default is 0.1 seconds
3232

3333
QuickPID::SetControllerDirection(ControllerDirection);
@@ -150,24 +150,20 @@ void QuickPID::SetSampleTimeUs(uint32_t NewSampleTimeUs)
150150
if (NewSampleTimeUs > 0)
151151
{
152152
float ratio = (float)NewSampleTimeUs / (float)SampleTimeUs;
153-
//float ratio = FX_FL(FX_DIV(FL_FX(NewSampleTimeUs), FL_FX(SampleTimeUs)));
154153

155154
ki *= ratio;
156-
//ki = FX_FL(FX_MUL(FL_FX(ki), FL_FX(ratio)));
157-
158155
kd /= ratio;
159-
//kd = FX_FL(FX_DIV(FL_FX(kd), FL_FX(ratio)));
160-
//----------------------------------------------------------------------------------------------------------------------------
156+
161157
SampleTimeUs = (uint32_t)NewSampleTimeUs;
162158
}
163159
}
164160

165-
/* SetOutputLimits(...)****************************************************
161+
/* SetOutputLimits(...)********************************************************
166162
This function will be used far more often than SetInputLimits. While
167163
the input to the controller will generally be in the 0-1023 range, which is
168164
the default already, the required output limits might be unique, like using
169165
a time window of 0-8000 needing to clamp it from 0-125.
170-
**************************************************************************/
166+
******************************************************************************/
171167
void QuickPID::SetOutputLimits(uint8_t Min, uint8_t Max)
172168
{
173169
if (Min >= Max) return;

QuickPID.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ class QuickPID
6262
void SetSampleTimeUs(uint32_t);
6363

6464
//Display functions ******************************************************************************************
65-
float GetKp(); // These functions query the pid for interal values. They were created mainly for
66-
float GetKi(); // the pid front-end, where it's important to know what is actually inside the PID.
65+
float GetKp(); // These functions query the pid for interal values. They were created mainly for
66+
float GetKi(); // the pid front-end, where it's important to know what is actually inside the PID.
6767
float GetKd();
6868
int16_t GetError();
6969
bool GetMode();

0 commit comments

Comments
 (0)