Hi,
I'm having trouble getting the "Advanced Configuration" as described in the manual to work. It says to put the defines into the file APM_Config.h and then build and download. I do that, and then check using the setup | show command in the CLI and I see a lot of default values instead of the values I've set in APM_Config.h.
In particular, things like AIRSPEED_CRUISE, AIRSPEED_FBW_MAX and so on don't appear to be working. I know the file is working since ENABLE_HIL, PS_PROTOCOL, GCS_PROTOCOL are working (I am able to fly it in X-Plane, but it's slow due not taking my airspeed_cruise setting).
It seems like #defines that live in the EEPROM are not getting there when I download, but #defines that are embedded in the source code are working.
I would imagine that if it's not automatic to initialize the EEPROM after downloading there would be a cli command to re-init the EEPROM, but the CLI help only offers "reset" which I'm guessing sets everything to some default values, after which I'd have to redo the radio setup, etc.
My APM_Config.h and CLI transcripts are shown below.
Thanks,
Phil
------------------------------------------------------------------------------------------------------------------------------------
define XPLANE 1
#ifdef XPLANE
#define ENABLE_HIL ENABLED
#define GPS_PROTOCOL GPS_PROTOCOL_IMU
#define GCS_PROTOCOL GCS_PROTOCOL_XPLANE
#define AIRSPEED_SENSOR ENABLED
#define AIRSPEED_CRUISE 30 // or whatever works best for your Xplane selection
#define GCS_PORT 0
#define SERIAL0_BAUD 115200
//Try to see if these settings get through to the settings.
#define AIRSPEED_FBW_MIN 8
#define AIRSPEED_FBW_MAX 50
# define THROTTLE_CRUISE 80
# define THROTTLE_MAX 100
#define HEAD_MAX 25
# define LOITER_RADIUS_DEFAULT 100
# define ALT_HOLD_HOME 75
#else // #ifdef XPLANE
/*
READ THIS. REALLY! READ THIS.
.... etc. etc.
---------------------------------------------------------------------------------------------------------------------------------------------
setup] show
Radio:
CH1: 1072 | 1916
CH2: 1123 | 1966
CH3: 969 | 1943
CH4: 1063 | 1909
CH5: 1000 | 2000
CH6: 1000 | 2000
CH7: 1000 | 2000
CH8: 1000 | 2000
Gains:
P: 0.400,I: 0.000,D: 0.000,IMAX: 5
P: 0.600,I: 0.000,D: 0.000,IMAX: 5
P: 0.000,I: 0.000,D: 0.000,IMAX: 5
P: 0.700,I: 0.000,D: 0.020,IMAX: 5
P: 0.650,I: 0.000,D: 0.000,IMAX: 5
P: 0.650,I: 0.000,D: 0.000,IMAX: 5
P: 0.500,I: 0.000,D: 0.000,IMAX: 20
P: 0.320,I: 0.000,D: 0.000,IMAX: 20
kff:0.200,0.500,0.000
XTRACK_GAIN:1.0000000000
XTRACK_ENTRY_ANGLE: 3000
HEAD_MAX: 6000
PITCH_MAX: 1500
PITCH_MIN: -2500
PITCH_TARGET: 0
User config:
airspeed_cruise: 1000
airspeed_fbw_min: 6
airspeed_fbw_max: 22
airspeed_ratio: 1.993600
throttle_min: 0
throttle_max: 75
throttle_cruise: 45
throttle_failsafe_enabled: 0
throttle_failsafe_value: 975
flight_mode_channel: 1
auto_trim: 1
log_bitmask: -178
RTL:
Hold 75 meters altitude
Replies
Are you doing a reset between each of these. The defines you supply are only saved to eeprom when you do a reset.
Everything you supply overrides the defaults.