Quote:
Originally Posted by mwsmith78
It works, but not as smooth as we would like. We still get some drifting, but other times you can see it correcting (especially when we inflate k1).
|
To address these issues, you can try a somewhat more complicated approach.
Take your Z-axis (yaw rate) command from your joystick and integrate it (with a gain tuning constant) to create a yaw angle command.
Take the accumulated yaw angle measurement from the gyro and subtract it from the yaw angle command to form the yaw angle error.
Now you can feed this yaw angle error into a PID. The output from the PID is your modified yaw rate command Z' which gets sent (along with your fwd/rev and strafe joystick commands) to your mecanum logic which converts them in to the four wheel speeds.