Some more fixes on mixer. Not working well!
This commit is contained in:
parent
4da4736257
commit
6bdcb6e853
@ -199,14 +199,16 @@ void mix()
|
|||||||
PidProfile[PID_ID_GYRO].PID_Out[YAW] * mixerUAV[i].yaw * ((mixerConfig.yaw_reverse_direction) ? -1 : 1);
|
PidProfile[PID_ID_GYRO].PID_Out[YAW] * mixerUAV[i].yaw * ((mixerConfig.yaw_reverse_direction) ? -1 : 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < MOTOR_COUNT; i++)
|
|
||||||
// Find the minimum and maximum motor output
|
|
||||||
if (RPY_Mix[i] < RPY_Mix_Min) RPY_Mix_Min = RPY_Mix[i];
|
|
||||||
|
|
||||||
|
|
||||||
/* Mixer Low Scale - Scaling output around low throttle */
|
/* Mixer Low Scale - Scaling output around low throttle */
|
||||||
if (flags_IsSet_ID(systemFlags_mixerlowscale_id))
|
if (flags_IsSet_ID(systemFlags_mixerlowscale_id))
|
||||||
{
|
{
|
||||||
|
for (int i = 0; i < MOTOR_COUNT; i++)
|
||||||
|
// Find the minimum and maximum motor output
|
||||||
|
if (RPY_Mix[i] < RPY_Mix_Min) RPY_Mix_Min = RPY_Mix[i];
|
||||||
|
|
||||||
uint16_t RPY_Mix_Min_Overshoot = (RPY_Mix_Min < mixerConfig.minThrottle) ? mixerConfig.minThrottle - RPY_Mix_Min : 0;
|
uint16_t RPY_Mix_Min_Overshoot = (RPY_Mix_Min < mixerConfig.minThrottle) ? mixerConfig.minThrottle - RPY_Mix_Min : 0;
|
||||||
|
|
||||||
if (RPY_Mix_Min_Overshoot > 0 ) //|| RPY_Mix_Max_Overshoot > 0)
|
if (RPY_Mix_Min_Overshoot > 0 ) //|| RPY_Mix_Max_Overshoot > 0)
|
||||||
@ -221,10 +223,11 @@ void mix()
|
|||||||
for (int i = 0; i < MOTOR_COUNT; i++)
|
for (int i = 0; i < MOTOR_COUNT; i++)
|
||||||
RPY_Mix[i] = (((float)(RPY_Mix[i] - throttle)) * (1 - mix_scale_reduction)) + throttle;
|
RPY_Mix[i] = (((float)(RPY_Mix[i] - throttle)) * (1 - mix_scale_reduction)) + throttle;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* Recalculating RPY_Mix_Min */
|
/* Recalculating RPY_Mix_Min */
|
||||||
RPY_Mix_Min = throttleMid;
|
RPY_Mix_Min = throttleMid;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for (int i = 0; i < MOTOR_COUNT; i++)
|
for (int i = 0; i < MOTOR_COUNT; i++)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user