Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 2568 → Rev 2569

/C-OSD/trunk/CHANGE.LOG
18,6 → 18,9
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
****************************************************************************/
 
20161212-0845
*adapted structs to reflect FC/NC software V2.16a
20160302-0700
*adapted structs to reflect FC/NC software V2.14a
 
/C-OSD/trunk/README.TXT
33,7 → 33,7
 
Instructions:
Connect the "To FC" port from EPi-OSD to the Debug port of the NaviCtrl.
You will need at least NaviCtrl 2.14a soft to fully enjoy the software.
You will need at least NaviCtrl 2.16a soft to fully enjoy the software.
 
S1 enters a menu where you can cycle through using S2 and toggle/accept choice with S1
 
/C-OSD/trunk/default/dist.bat
20,7 → 20,7
:: ****************************************************************************/
 
set OSDBUILDDATE=%DATE:~-4,4%%DATE:~-7,2%%DATE:~0,2%-%TIME:~0,2%%TIME:~3,2%
set OSDBUILDDATE=20160302-0700
set OSDBUILDDATE=20161212-0845
echo "Building: %OSDBUILDDATE%"
 
:: date /T
/C-OSD/trunk/default/flash-usbasp.bat
20,7 → 20,7
:: ****************************************************************************/
 
:: set FIRMWAREFILE to current version
set FIRMWAREFILE=C-OSD-20160302-0700-pal.hex
set FIRMWAREFILE=C-OSD-20161212-0845-pal.hex
 
:: Read fuses as test
avrdude -c usbasp -p m162 -n -v
/C-OSD/trunk/mk-data-structs.h
85,7 → 85,7
/*
* NaviCtrl OSD Structs
* portions taken and adapted from
* http://svn.mikrokopter.de/filedetails.php?repname=NaviCtrl&path=/tags/V2.12a/uart1.h
* http://svn.mikrokopter.de/filedetails.php?repname=NaviCtrl&path=/tags/V2.16a/uart1.h
*/
typedef struct {
u16 Distance; // distance to target in dm
94,38 → 94,42
 
#define NAVIDATA_VERSION 5
 
typedef struct {
u8 Version; // version of the data structure
GPS_Pos_t CurrentPosition; // see gpspos.h for details
GPS_Pos_t TargetPosition;
GPS_PosDev_t TargetPositionDeviation;
GPS_Pos_t HomePosition;
GPS_PosDev_t HomePositionDeviation;
u8 WaypointIndex; // index of current waypoints running from 0 to WaypointNumber-1
u8 WaypointNumber; // number of stored waypoints
u8 SatsInUse; // number of satellites used for position solution
s16 Altimeter_5cm; // hight according to air pressure
s16 Variometer; // climb(+) and sink(-) rate
u16 FlyingTime; // in seconds
u8 UBat; // Battery Voltage in 0.1 Volts
u16 GroundSpeed; // speed over ground in cm/s (2D)
s16 Heading; // current flight direction in ° as angle to north
s16 CompassHeading; // current compass value in °
s8 AngleNick; // current Nick angle in 1°
s8 AngleRoll; // current Rick angle in 1°
u8 RC_Quality; // RC_Quality
u8 FCStatusFlags; // Flags from FC
u8 NCFlags; // Flags from NC
u8 Errorcode; // 0 --> okay
u8 WP_OperatingRadius; // current WP operation radius around the Home Position in m
s16 TopSpeed; // velocity in vertical direction in cm/s
u8 TargetHoldTime; // time in s to stay at the given target, counts down to 0 if target has been reached
u8 FCStatusFlags2; // StatusFlags2 (since version 5 added)
s16 SetpointAltitude; // setpoint for altitude
u8 Gas; // for future use
u16 Current; // actual current in 0.1A steps
u16 UsedCapacity; // used capacity in mAh
typedef struct // 84 Bytes (note: this is the old protocol)
{
u8 Version; // version of the data structure = 5
GPS_Pos_t CurrentPosition; // see gpspos.h for details
GPS_Pos_t TargetPosition;
GPS_PosDev_t TargetPositionDeviation;
GPS_Pos_t HomePosition;
GPS_PosDev_t HomePositionDeviation;
u8 WaypointIndex; // index of current waypoints running from 0 to WaypointNumber-1
u8 WaypointNumber; // number of stored waypoints
u8 SatsInUse; // number of satellites used for position solution
s16 Altimeter_5cm; // hight according to air pressure
s16 Variometer; // climb(+) and sink(-) rate
u16 FlyingTime; // in seconds
u8 UBat; // Battery Voltage in 0.1 Volts
u16 GroundSpeed; // speed over ground in cm/s (2D)
s16 Heading; // current flight direction in ° as angle to north
s16 CompassHeading; // current compass value in °
s8 AngleNick; // current Nick angle in 1°
s8 AngleRoll; // current Rick angle in 1°
u8 RC_Quality; // RC_Quality
u8 FCStatusFlags; // Flags from FC see main.c FC_STATUS_xxx
u8 NCFlags; // Flags from NC see main.h NC_FLAG_xxx
u8 Errorcode; // 0 --> okay
u8 WP_OperatingRadius; // current WP operation radius around the Home Position in m
s16 TopSpeed; // velocity in vertical direction in cm/s
u8 TargetHoldTime; // time in s to stay at the given target, counts down to 0 if target has been reached
u8 FCStatusFlags2; // StatusFlags2 (since version 5 added)
s16 SetpointAltitude; // setpoint for altitude
u8 Gas; // current gas (thrust)
u16 Current; // actual current in 0.1A steps
u16 UsedCapacity; // used capacity in mAh
u8 reserve1; // to fit into 84 bytes (must be divisible by 3)
u8 reserve2; // to fit into 84 bytes (must be divisible by 3)
} __attribute__((packed)) NaviData_t;
extern NaviData_t NaviData;
 
/*
* NaviCtrl & FCFlags Flags
192,145 → 196,149
/*
* MikroKopter config struct
* portions taken and adapted from
* http://svn.mikrokopter.de/filedetails.php?repname=FlightCtrl&path=/tags/V2.12a/eeprom.h
* http://svn.mikrokopter.de/filedetails.php?repname=FlightCtrl&path=/tags/V2.16a/eeprom.h
*/
 
#define EEPARAM_REVISION 108 // is count up, if paramater stucture has changed (compatibility)
#define EEMIXER_REVISION 1 // is count up, if mixer stucture has changed (compatibility)
#define EEPARAM_REVISION 109 // !!!Update NC also!!! is count up, if paramater stucture has changed (compatibility)
#define EEMIXER_REVISION 1 // is count up, if mixer stucture has changed (compatibility)
#define EE_BACKWARD_COMP 1 // change if the eepropm parameters are not backwards compatible
 
 
 
typedef struct
{
unsigned char Revision;
unsigned char Kanalbelegung[12]; // GAS[0], GIER[1],NICK[2], ROLL[3], POTI1, POTI2, POTI3
unsigned char GlobalConfig; // 0x01=Höhenregler aktiv,0x02=Kompass aktiv, 0x04=GPS aktiv, 0x08=Heading Hold aktiv
unsigned char Hoehe_MinGas; // Wert : 0-100
unsigned char Luftdruck_D; // Wert : 0-250
unsigned char HoeheChannel; // Wert : 0-32
unsigned char Hoehe_P; // Wert : 0-32
unsigned char Hoehe_Verstaerkung; // Wert : 0-50
unsigned char Hoehe_ACC_Wirkung; // Wert : 0-250
unsigned char Hoehe_HoverBand; // Wert : 0-250
unsigned char Hoehe_TiltCompensation; // Wert : 0-250
unsigned char Hoehe_StickNeutralPoint;// Wert : 0-250
unsigned char Stick_P; // Wert : 1-6
unsigned char Stick_D; // Wert : 0-64
unsigned char StickGier_P; // Wert : 1-20
unsigned char Gas_Min; // Wert : 0-32
unsigned char Gas_Max; // Wert : 33-250
unsigned char GyroAccFaktor; // Wert : 1-64
unsigned char KompassWirkung; // Wert : 0-32
unsigned char Gyro_P; // Wert : 10-250
unsigned char Gyro_I; // Wert : 0-250
unsigned char Gyro_D; // Wert : 0-250
unsigned char Gyro_Gier_P; // Wert : 10-250
unsigned char Gyro_Gier_I; // Wert : 0-250
unsigned char Gyro_Stability; // Wert : 0-16
unsigned char UnterspannungsWarnung; // Wert : 0-250
unsigned char NotGas; // Wert : 0-250 //Gaswert bei Empängsverlust
unsigned char NotGasZeit; // Wert : 0-250 // Zeitbis auf NotGas geschaltet wird, wg. Rx-Problemen
unsigned char Receiver; // 0= Summensignal, 1= Spektrum, 2 =Jeti, 3=ACT DSL, 4=ACT S3D
unsigned char I_Faktor; // Wert : 0-250
unsigned char UserParam1; // Wert : 0-250
unsigned char UserParam2; // Wert : 0-250
unsigned char UserParam3; // Wert : 0-250
unsigned char UserParam4; // Wert : 0-250
unsigned char ServoNickControl; // Wert : 0-250 // Stellung des Servos
unsigned char ServoNickComp; // Wert : 0-250 // Einfluss Gyro/Servo
unsigned char ServoNickMin; // Wert : 0-250 // Anschlag
unsigned char ServoNickMax; // Wert : 0-250 // Anschlag
//--- Seit V0.75
unsigned char ServoRollControl; // Wert : 0-250 // Stellung des Servos
unsigned char ServoRollComp; // Wert : 0-250
unsigned char ServoRollMin; // Wert : 0-250
unsigned char ServoRollMax; // Wert : 0-250
//---
unsigned char ServoNickRefresh; // Speed of the Servo
unsigned char Revision;
unsigned char Kanalbelegung[12]; // GAS[0], GIER[1],NICK[2], ROLL[3], POTI1, POTI2, POTI3
unsigned char GlobalConfig; // 0x01=Höhenregler aktiv,0x02=Kompass aktiv, 0x04=GPS aktiv, 0x08=Heading Hold aktiv
unsigned char Hoehe_MinGas; // Wert : 0-100
unsigned char Luftdruck_D; // Wert : 0-250
unsigned char HoeheChannel; // Wert : 0-32
unsigned char Hoehe_P; // Wert : 0-32
unsigned char Hoehe_Verstaerkung; // Wert : 0-50
unsigned char Hoehe_ACC_Wirkung; // Wert : 0-250
unsigned char Hoehe_HoverBand; // Wert : 0-250
unsigned char Hoehe_TiltCompensation; // Wert : 0-250
unsigned char Hoehe_StickNeutralPoint;// Wert : 0-250
unsigned char Stick_P; // Wert : 1-6
unsigned char Stick_D; // Wert : 0-64
unsigned char StickGier_P; // Wert : 1-20
unsigned char Gas_Min; // Wert : 0-32
unsigned char Gas_Max; // Wert : 33-250
unsigned char GyroAccFaktor; // Wert : 1-64
unsigned char KompassWirkung; // Wert : 0-32
unsigned char Gyro_P; // Wert : 10-250
unsigned char Gyro_I; // Wert : 0-250
unsigned char Gyro_D; // Wert : 0-250
unsigned char Gyro_Gier_P; // Wert : 10-250
unsigned char Gyro_Gier_I; // Wert : 0-250
unsigned char Gyro_Stability; // Wert : 0-16
unsigned char UnterspannungsWarnung; // Wert : 0-250
unsigned char NotGas; // Wert : 0-250 //Gaswert bei Empängsverlust
unsigned char NotGasZeit; // Wert : 0-250 // Zeitbis auf NotGas geschaltet wird, wg. Rx-Problemen
unsigned char Receiver; // 0= Summensignal, 1= Spektrum, 2 =Jeti, 3=ACT DSL, 4=ACT S3D
unsigned char I_Faktor; // Wert : 0-250
unsigned char UserParam1; // Wert : 0-250
unsigned char UserParam2; // Wert : 0-250
unsigned char UserParam3; // Wert : 0-250
unsigned char UserParam4; // Wert : 0-250
unsigned char ServoNickControl; // Wert : 0-250 // Stellung des Servos
unsigned char ServoNickComp; // Wert : 0-250 // Einfluss Gyro/Servo
unsigned char ServoNickMin; // Wert : 0-250 // Anschlag
unsigned char ServoNickMax; // Wert : 0-250 // Anschlag
//--- Seit V0.75
unsigned char ServoRollControl; // Wert : 0-250 // Stellung des Servos
unsigned char ServoRollComp; // Wert : 0-250
unsigned char ServoRollMin; // Wert : 0-250
unsigned char ServoRollMax; // Wert : 0-250
//---
unsigned char ServoNickRefresh; // Speed of the Servo
unsigned char ServoManualControlSpeed;//
unsigned char CamOrientation; //
unsigned char Servo3; // Value or mapping of the Servo Output
unsigned char Servo4; // Value or mapping of the Servo Output
unsigned char Servo5; // Value or mapping of the Servo Output
unsigned char LoopGasLimit; // Wert: 0-250 max. Gas während Looping
unsigned char LoopThreshold; // Wert: 0-250 Schwelle für Stickausschlag
unsigned char LoopHysterese; // Wert: 0-250 Hysterese für Stickausschlag
unsigned char AchsKopplung1; // Wert: 0-250 Faktor, mit dem Gier die Achsen Roll und Nick koppelt (NickRollMitkopplung)
unsigned char AchsKopplung2; // Wert: 0-250 Faktor, mit dem Nick und Roll verkoppelt werden
unsigned char CouplingYawCorrection; // Wert: 0-250 Faktor, mit dem Nick und Roll verkoppelt werden
unsigned char WinkelUmschlagNick; // Wert: 0-250 180°-Punkt
unsigned char WinkelUmschlagRoll; // Wert: 0-250 180°-Punkt
unsigned char GyroAccAbgleich; // 1/k (Koppel_ACC_Wirkung)
unsigned char Driftkomp;
unsigned char DynamicStability;
unsigned char UserParam5; // Wert : 0-250
unsigned char UserParam6; // Wert : 0-250
unsigned char UserParam7; // Wert : 0-250
unsigned char UserParam8; // Wert : 0-250
//---Output ---------------------------------------------
unsigned char J16Bitmask; // for the J16 Output
unsigned char J16Timing; // for the J16 Output
unsigned char J17Bitmask; // for the J17 Output
unsigned char J17Timing; // for the J17 Output
// seit version V0.75c
unsigned char WARN_J16_Bitmask; // for the J16 Output
unsigned char WARN_J17_Bitmask; // for the J17 Output
//---NaviCtrl---------------------------------------------
unsigned char AutoPhotoDistance; // Auto Photo
unsigned char NaviGpsModeChannel; // Parameters for the Naviboard
unsigned char NaviGpsGain;
unsigned char NaviGpsP;
unsigned char NaviGpsI;
unsigned char NaviGpsD;
unsigned char NaviGpsPLimit;
unsigned char NaviGpsILimit;
unsigned char NaviGpsDLimit;
unsigned char NaviGpsA;
unsigned char NaviGpsMinSat;
unsigned char NaviStickThreshold;
unsigned char NaviWindCorrection;
unsigned char NaviAccCompensation; // New since 0.86 -> was: SpeedCompensation
unsigned char NaviMaxFlyingRange; // in 10m
unsigned char NaviAngleLimitation;
unsigned char NaviPH_LoginTime;
unsigned char NaviDescendRange;
//---Ext.Ctrl---------------------------------------------
unsigned char ExternalControl; // for serial Control
//---CareFree---------------------------------------------
unsigned char OrientationAngle; // Where is the front-direction?
unsigned char CareFreeChannel; // switch for CareFree
unsigned char Servo3; // Value or mapping of the Servo Output
unsigned char Servo4; // Value or mapping of the Servo Output
unsigned char Servo5; // Value or mapping of the Servo Output
unsigned char LoopGasLimit; // Wert: 0-250 max. Gas während Looping
unsigned char LoopThreshold; // Wert: 0-250 Schwelle für Stickausschlag
unsigned char LoopHysterese; // Wert: 0-250 Hysterese für Stickausschlag
unsigned char AchsKopplung1; // Wert: 0-250 Faktor, mit dem Gier die Achsen Roll und Nick koppelt (NickRollMitkopplung)
unsigned char AchsKopplung2; // Wert: 0-250 Faktor, mit dem Nick und Roll verkoppelt werden
unsigned char CouplingYawCorrection; // Wert: 0-250 Faktor, mit dem Nick und Roll verkoppelt werden
unsigned char WinkelUmschlagNick; // Wert: 0-250 180°-Punkt
unsigned char WinkelUmschlagRoll; // Wert: 0-250 180°-Punkt
unsigned char GyroAccAbgleich; // 1/k (Koppel_ACC_Wirkung)
unsigned char Driftkomp;
unsigned char DynamicStability;
unsigned char UserParam5; // Wert : 0-250
unsigned char UserParam6; // Wert : 0-250
unsigned char UserParam7; // Wert : 0-250
unsigned char UserParam8; // Wert : 0-250
//---Output ---------------------------------------------
unsigned char J16Bitmask; // for the J16 Output
unsigned char J16Timing; // for the J16 Output
unsigned char J17Bitmask; // for the J17 Output
unsigned char J17Timing; // for the J17 Output
// seit version V0.75c
unsigned char WARN_J16_Bitmask; // for the J16 Output
unsigned char WARN_J17_Bitmask; // for the J17 Output
//---NaviCtrl---------------------------------------------
unsigned char AutoPhotoDistance; // Auto Photo
unsigned char NaviGpsModeChannel; // Parameters for the Naviboard
unsigned char NaviGpsGain;
unsigned char NaviGpsP;
unsigned char NaviGpsI;
unsigned char NaviGpsD;
unsigned char NaviGpsPLimit;
unsigned char NaviGpsILimit;
unsigned char NaviGpsDLimit;
unsigned char NaviGpsA;
unsigned char NaviGpsMinSat;
unsigned char NaviStickThreshold;
unsigned char NaviWindCorrection;
unsigned char NaviAccCompensation; // New since 0.86 -> was: SpeedCompensation
unsigned char NaviMaxFlyingRange; // in 10m
unsigned char NaviAngleLimitation;
unsigned char NaviPH_LoginTime;
unsigned char NaviDescendRange;
//---Ext.Ctrl---------------------------------------------
unsigned char ExternalControl; // for serial Control
//---CareFree---------------------------------------------
unsigned char OrientationAngle; // Where is the front-direction?
unsigned char CareFreeChannel; // switch for CareFree
unsigned char MotorSafetySwitch;
unsigned char MotorSmooth;
unsigned char ComingHomeAltitude;
unsigned char FailSafeTime;
unsigned char MaxAltitude;
unsigned char FailsafeChannel; // if the value of this channel is > 100, the MK reports "RC-Lost"
unsigned char ServoFilterNick;
unsigned char ServoFilterRoll;
unsigned char FailsafeChannel; // if the value of this channel is > 100, the MK reports "RC-Lost"
unsigned char ServoFilterNick;
unsigned char ServoFilterRoll;
unsigned char Servo3OnValue;
unsigned char Servo3OffValue;
unsigned char Servo4OnValue;
unsigned char Servo4OffValue;
unsigned char ServoFS_Pos[5];
unsigned char StartLandChannel;
unsigned char LandingSpeed;
unsigned char CompassOffset;
unsigned char AutoLandingVoltage; // in 0,1V 0 -> disabled
unsigned char ComingHomeVoltage; // in 0,1V 0 -> disabled
unsigned char AutoPhotoAtitudes;
unsigned char SingleWpSpeed;
unsigned char LandingPulse;
unsigned char SingleWpControlChannel;
unsigned char MenuKeyChannel;
unsigned char ServoFS_Pos[5];
unsigned char StartLandChannel;
unsigned char LandingSpeed;
unsigned char CompassOffset;
unsigned char AutoLandingVoltage; // in 0,1V 0 -> disabled
unsigned char ComingHomeVoltage; // in 0,1V 0 -> disabled
unsigned char AutoPhotoAtitudes;
unsigned char SingleWpSpeed;
unsigned char LandingPulse;
unsigned char SingleWpControlChannel;
unsigned char MenuKeyChannel;
unsigned char CamCtrlModeChannel;
unsigned char CamCtrlZoomChannel;
unsigned char reserved[32]; // for later use
//------------------------------------------------
unsigned char BitConfig; // (war Loop-Cfg) Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt
unsigned char ServoCompInvert; // // 0x01 = Nick, 0x02 = Roll, 0x04 = relative moving // WICHTIG!!! am Ende lassen
unsigned char ExtraConfig; // bitcodiert
unsigned char GlobalConfig3; // bitcodiert
char Name[12];
unsigned char crc; // must be the last byte!
} paramset_t; // since 2.14 -> size is always 179 Bytes
unsigned char CamCtrlZoomChannel;
unsigned char reserved[32]; // for later use
//------------------------------------------------
unsigned char BitConfig; // (war Loop-Cfg) Bitcodiert: 0x01=oben, 0x02=unten, 0x04=links, 0x08=rechts / wird getrennt behandelt
unsigned char ServoCompInvert; // // 0x01 = Nick, 0x02 = Roll, 0x04 = relative moving // WICHTIG!!! am Ende lassen
unsigned char ExtraConfig; // bitcodiert
unsigned char GlobalConfig3; // bitcodiert
char Name[12];
unsigned char crc; // must be the last byte!
} paramset_t; // since 2.14 -> size is always 179 Bytes
// -> if changed: update NC-Data structure also <-
 
 
typedef struct {