Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 1880 → Rev 1903

/branches/V0.84a_var_motorsmoothing/fc.c
1772,10 → 1772,46
if(Mixer.Motor[i][3] == 64) tmp_int += GierMischanteil;
else if(Mixer.Motor[i][3] == -64) tmp_int -= GierMischanteil;
else tmp_int += ((long)GierMischanteil * Mixer.Motor[i][3]) / 64L;
#ifdef WITH_ORIGINAL_MOTORSMOOTHING /// MartinW; set in main.h
#warning : "### with WITH_ORIGINAL_MOTORSMOOTHING ###"
if(tmp_int > tmp_motorwert[i]) tmp_int = (tmp_motorwert[i] + tmp_int) / 2; // MotorSmoothing
else tmp_int = 2 * tmp_int - tmp_motorwert[i]; // MotorSmoothing
#else
#warning : "### without WITH_ORIGINAL_MOTORSMOOTHING, ajustable ###"
// MartinW; variable MS START
if(tmp_int > tmp_motorwert[i]) tmp_int = (tmp_motorwert[i] + tmp_int) / 2; // MotorSmoothing
// else tmp_int = 2 * tmp_int - tmp_motorwert[i]; // MotorSmoothing
// Arthur P: the original code allowed the motor value to drop to 0 or negative values
// straight off, i.e. could amplify an intended decrease excessively while upregulation
// is dampened. The modification would still allow immediate drop below intended value
// but would dampen this. This would still allow for airbraking of the prop to have effect
// but it might lead to less sudden excessive drops in rpm with only gradual recovery.
// 090807 Arthur P: Due to problems with uart.c which still refers to user parameter 1 and 2 and
// possible timing issues with the shutter interval load, removed the shutter interval functions
// and switched to use of userparam6 for the motor smoothing.
// 091114 Inserted modification into 0.76g source code.
// 20100804 Modified v.0.80d code where motorsmoothing is no longer a separate function.
// Downsmoothing either uses default v.0.7x+ 150% downstep (user para 7 == 0),
// 50% downstep (user para 7 == 1 or 2), or downsteps of x% (userpara7 ==):
// 66.6% (3), 75% (4), 80% (5), 90% (10), 95% (20), 97.5% (40), 98% (50), 99% (100).
else
{
if(Parameter_UserParam7 < 2)
{ // Original function
tmp_int = 2 * tmp_int - tmp_motorwert[i];
}
else
{
// If userpara7 >= 2 then allow >= 50% of the intended step down to rapidly reach the intended value.
tmp_int = tmp_int + ((tmp_motorwert[i] - tmp_int)/Parameter_UserParam7);
}
}
// MartinW; variable MS END
#endif
 
if(tmp_int > tmp_motorwert[i]) tmp_int = (tmp_motorwert[i] + tmp_int) / 2; // MotorSmoothing
else tmp_int = 2 * tmp_int - tmp_motorwert[i]; // MotorSmoothing
 
LIMIT_MIN_MAX(tmp_int,(int) MIN_GAS * 4,(int) MAX_GAS * 4);
Motor[i].SetPoint = tmp_int / 4;
Motor[i].SetPointLowerBits = (tmp_int % 4)<<1; // (3 bits total)
/branches/V0.84a_var_motorsmoothing/main.h
6,6 → 6,8
//#define SWITCH_LEARNS_CAREFREE
//#define RECEIVER_SPEKTRUM_EXP
 
//#define WITH_ORIGINAL_MOTORSMOOTHING /// MartinW; with original Code or else with variable Motorsmoothing
 
// neue Hardware
#define ROT_OFF {if((PlatinenVersion == 10)||(PlatinenVersion >= 20)) PORTB &=~0x01; else PORTB |= 0x01;}
#define ROT_ON {if((PlatinenVersion == 10)||(PlatinenVersion >= 20)) PORTB |= 0x01; else PORTB &=~0x01;}
/branches/V0.84a_var_motorsmoothing/makefile
42,7 → 42,7
# Target file name (without extension).
 
ifeq ($(VERSION_PATCH), 0)
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)a_SVN$(REV)
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)a_varMs_SVN$(REV)
endif
ifeq ($(VERSION_PATCH), 1)
TARGET = Flight-Ctrl_$(HEX_NAME)_V$(VERSION_MAJOR)_$(VERSION_MINOR)b_SVN$(REV)
/branches/V0.84a_var_motorsmoothing/version.txt
458,6 → 458,10
- Kanaloffset für Potis von 110 auf 127 erhöht, damit es gleich ist mit allen anderen Kanälen
- POI-Richtung (Soll-Himmelsrichtung) bezieht sich auf den Kamera-Winkel
 
V0.84a_var_motorsmoothing (MartinW):
 
Mit einstellbarer Motor-Glättungsfunktion.
User Parameter 7; 0 = original Code, 2...100 = weichere Einstellung.
empfohlen = 2