Merge remote-tracking branch 'origin/baro2' into baro2

# Conflicts:
#	UAV-ControlSystem/src/Flight/pid.c
This commit is contained in:
Jonas Holmberg 2016-11-10 10:33:01 +01:00
commit abe3af0f46
2 changed files with 4 additions and 7 deletions

View File

@ -26,6 +26,7 @@
#define PTERM_SCALE 0.032029f /*P-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 BAROMETER_SCALE 20
#define RADIO_RANGE 500 /*Radio range input*/
#define BAROMETER_RANGE 3 /*Determines the range of the maximum height (limits the rc input)*/
@ -113,7 +114,7 @@ void getCurrentValues(float sensorValues[3], uint8_t ID_profile)
break;
case PID_ID_BAROMETER:
sensorValues[0] = barometer_GetCurrentAveragedtAltitude()*20;
sensorValues[0] = barometer_GetCurrentAveragedtAltitude()*BAROMETER_SCALE;
break;
default:
@ -174,7 +175,7 @@ void getPointRate(float *desiredCommand, uint8_t ID_profile)
//desiredCommand[THROTTLE] = convertData(RADIO_RANGE, BAROMETER_RANGE, 0, rc_input.Throttle*throttleRate);
desiredCommand[THROTTLE] = 3*20;
desiredCommand[THROTTLE] = 1*BAROMETER_SCALE;
break;
default:

View File

@ -105,11 +105,7 @@ void mix()
int16_t RPY_Mix_Max = 0; // Maximum desired command for any motor
int16_t throttle = PidProfile[PID_ID_BAROMETER].PID_Out[THROTTLE];
if (PidProfile[PID_ID_BAROMETER].pidEnabled && flags_IsSet_ID(systemFlags_flightmode_barometer_id))
{
throttle += 1482;
}
if (PidProfile[PID_ID_BAROMETER].pidEnabled && flags_IsSet_ID(systemFlags_flightmode_barometer_id)) throttle += 1482;
/* Mixer Full Scale enabled */
if (flags_IsSet_ID(systemFlags_mixerfullscale_id))