Motion Control library for 2, 3 inputs Full Bridge + Quadrature Encoder, motor system (also called a 2 wheels robot)
Dependencies: Encoder_Nucleo_16_bits
Dependents: FRC_2018 FRC2018_Bis 0hackton_08_06_18 lib_FRC_2019 ... more
Diff: PID.cpp
- Revision:
- 12:13f42fe66fb1
- Parent:
- 8:4553677e8b99
- Child:
- 13:0227a21c181a
diff -r cf0b7380a45f -r 13f42fe66fb1 PID.cpp --- a/PID.cpp Thu Oct 24 13:20:07 2019 +0000 +++ b/PID.cpp Fri Oct 25 08:05:11 2019 +0000 @@ -152,7 +152,7 @@ deltaX = meanDist * cos (_THETA); deltaY = meanDist * sin (_THETA); - deltaTheta = diffDist / 230; + deltaTheta = atan2(diffDist,230.0); _X += deltaX; _Y += deltaY;