convert_KeilToMbed
Dependencies: DigitDisplay Motor PID mbed millis
Fork of DagonFly__RoadToJapan_15Mei_Ultimate by
Diff: main.cpp
- Revision:
- 49:0c9148ab8585
- Parent:
- 48:3006386dc8df
- Child:
- 50:8bc9dbca2ffa
diff -r 3006386dc8df -r 0c9148ab8585 main.cpp --- a/main.cpp Sat May 13 07:27:51 2017 +0000 +++ b/main.cpp Sat May 13 15:17:23 2017 +0000 @@ -57,8 +57,8 @@ // indek 2 untuk motor depan, 1 untuk motor belakang double speed, speed2; const double maxSpeed = 0.95, minSpeed = -0.95, Ts = 12.5; -const double kpA1=0.1478, kdA1=0.9295, kiA1=0.0004226; -const double kpA2=0.13978, kdA2=0.9222, kiA2=0.00038636; +const double kpA1=0.19982, kdA1=0.91824, kiA1=0.00072609; +const double kpA2=0.20481, kdA2=0.92191, kiA2=0.00076326; double a1,b1,c1; double a2,b2,c2; double current_error1, previous_error1_1 = 0, previous_error1_2 = 0; @@ -131,9 +131,6 @@ joysticknucleo joystick(PA_0,PA_1); Serial pc(USBTX,USBRX); -/* Deklarasi Encoder Base */ -encoderKRAI encoderBase(PC_4, PB_15, 2000, encoderKRAI::X2_ENCODING); //inA, inB, pin Indeks (NC = tak ada), 2xresolusi, mode pembacaan - /* Deklarasi Encoder Launcher */ encoderKRAI encLauncherDpn( PC_10, PC_11, 28, encoderKRAI::X4_ENCODING); encoderKRAI encLauncherBlk( PC_12, PD_2, 28, encoderKRAI::X4_ENCODING);