Open MattMgn opened 5 years ago
Thanks, Matt. I'll revisit this. I vaguely remember fiddling with this during testing on the bot. Agree something fishy is going on here.
@MattMgn good catch, I'm working this issue now. It requires fixing the bb2 sensor frames to align with the correct PID orientation.
Hi,
I have just noticed a minor bug into your PID controller. The first argument of you PID processing function
double PidControl::getOutput(double actual, double setpoint)
, represents the monitored value and the second one represents the target value.However, when this function is called by
BobbleBalanceController.cpp
, it is used like this:DesiredTilt = VelocityControlPID.getOutput(DesiredVelocity, ForwardVelocity);
TiltEffort = TiltControlPID.getOutput(DesiredTilt, Tilt);
HeadingEffort = TurningControlPID.getOutput(DesiredTurnRate, TurnRate);
From what I understand DesiredVelocity is your target and ForwardVelocity your estimated value, which are inverted regarding your function definition. You might have also a sign reversal somewhere else.
Nice project btw.
Matt