Changes to scaling of the I-term. It is now 200 times smaller

This commit is contained in:
philsson 2016-10-31 11:18:35 +01:00
parent dab5b5626d
commit e6ce36f9e9
2 changed files with 7 additions and 5 deletions

View File

@ -22,7 +22,7 @@
#define PTERM_SCALE 0.032029f /*P-term used as a scale value to the PID controller*/ #define PTERM_SCALE 0.032029f /*P-term used as a scale value to the PID controller*/
#define ITERM_SCALE 0.244381f /*I-term used as a scale value to the PID controller*/ #define ITERM_SCALE 0.0012f /*I-term used as a scale value to the PID controller*/
#define DTERM_SCALE 0.000529f /*D-term used as a scale value to the PID controller*/ #define DTERM_SCALE 0.000529f /*D-term used as a scale value to the PID controller*/
#define RADIO_RANGE 500 /*Radio range input*/ #define RADIO_RANGE 500 /*Radio range input*/
@ -31,7 +31,7 @@
#define GYRO_RANGE 720 /*Determines the maximum rotational limit (limits the rc input)*/ #define GYRO_RANGE 720 /*Determines the maximum rotational limit (limits the rc input)*/
#define COMPASS_RANGE 180 /*Determines the maximum compass limit (limits the rc input)*/ #define COMPASS_RANGE 180 /*Determines the maximum compass limit (limits the rc input)*/
#define PID_MAX_I 256/2 /*Constrains ITerm*/ #define PID_MAX_I 256 /*Constrains ITerm*/
#define PID_MAX_D 512 /*Constrains DTerm*/ #define PID_MAX_D 512 /*Constrains DTerm*/
/*Struct that belongs to a certain PID controller*/ /*Struct that belongs to a certain PID controller*/

View File

@ -47,6 +47,10 @@ void init_system()
//Configure the clock //Configure the clock
system_clock_config(); system_clock_config();
//init motors to run with oneshot 125, small delay
HAL_Delay(1000);
pwmEnableAllMotors(Oneshot125);
//Initializes all the pids that are used in the system. This part will also init the gyro and accelerometer. //Initializes all the pids that are used in the system. This part will also init the gyro and accelerometer.
pidInit(); pidInit();
@ -97,9 +101,7 @@ void init_system()
#endif #endif
//init motors to run with oneshot 125, small delay
HAL_Delay(1000);
pwmEnableAllMotors(Oneshot125);
} }