Firmware 刷 INAV 1.1RC2
另外補充 刷這版軟體 接收機要用PPM 模式比較好,接腳功能才會全開, 尤其是CC3D 一定要用PPM
Quick summary of main features:
- Legacy BARO, SONAR, GPS PH, GPS RTH modes are removed and replaced by ALTHOLD, POSHOLD and RTH modes
- Gyro and accelerometer FIR filtering
- Quaternion IMU logic for Level modes. More precision, less drift and faster performance
- Advanced INS/GPS position estimation for best accuracy
- Advanced accelerometer and magnetometer calibration
- Smart RTH (return to home) that would use the safe altitude to return home - avoid the trees and buildings - and land
- RTH on failsafe (radio signal loss)
- Waypoints and fully autonomous missions (work in progress)
iNav has different config settings and simply restoring old backup will result in poor performance!
Please read the docs before you go fly iNav for the first time:
Advanced accelerometer calibration
CLI variable reference
GPS Failsafe and Glitch Protection
Navigation modes
iNav on GitHub:
https://github.com/iNavFlight/inav
Documentation:
https://github.com/iNavFlight/inav/wiki
Firmware builds:
https://github.com/iNavFlight/inav/releases
===============================================================
Advanced accelerometer calibration
Konstantin Sharlaimov edited this page on 30 Jan · 9 revisions
Pages 15
- Home
- [WiP] Quick setup guide
- Advanced accelerometer calibration
- Coordinate systems
- Custom mixes for exotic setups
- GPS Failsafe and Glitch Protection
- HOWTO setup iNAV for fixed wing
- INAV blackbox variables
- iNav CLI variables
- iNav setup checklist
- Inertial position estimator (INAV)
- Navigation modes
- PID description
- RTH Altitude control modes
- Tested PID values on different types of aircrafts
Accelerometer calibration is mandatory if inertial position estimation is used. Modern accelerometer sensors are accurate, but they require calibration if we want precise measurements. Sensors might be biased, gains on different axis might be different. Advanced 6-point calibration takes care of all irregularities sensor might have.
Accelerometer calibration steps
- Connect the copter to the "Configurator" software, select the "Setup" tab.
- Place copter level (pos 1) and press "Calibrate Accelerometer" button. Advanced calibration has been activated and recorded the 1-st data point.
- Place copter on all sides in sequence (pos 2-6): on its back, right side, nose up, left side, nose down. Press "Calibrate Accelerometer" button for in every position. The advanced calibration algorithm will record 2-nd to 6-th data points.
- After all 6 positions have been recorded advanced calibration will calculate offsets and gains and store them in EEPROM. Accelerometer calibration done.
- Use CLI to verify that accgain_x, accgain_y and accgain_z parameters are NOT ZERO. If they are, algorithm failed to converge, calibration failed and needs to be repeated.
There is no need to place copter perfectly aligned, the algorithm does not care about exact positions as long as they are close to 90 degree apart and copter is stationary in every position.
Level calibration
Proper accelerometer calibration does not guarantee copter being level. Chip might be misaligned on board or the board itself might be mounted at some tiny angle. For level flight and navigation features to work you need to trim the firmware to level flight using "Board Alignment" on the "Configuration" tab.
NOTE! Unlike in "official" Cleanflight firmware board alignment angles are set in degrees*10, so if you need to trim your board 1.5 degrees you should enter "15".
NOTE2! To keep things compatible with official Configurator, angles more than 36 deg and less than -18 deg can only be set through CLI parameters: align_board_pitch, align_board_roll andalign_board_yaw.
This applies to mounting the flight controller at 90 degree to keep USB port accessible. You have to set align_board_yaw=900 from CLI.
Backup and restore the settings
To avoid going through full calibration after resetting the configuration new CLI settings are introduced to get and set accelerometer offsets and gains: acczero_x, acczero_y, acczero_z,accgain_x, accgain_y, accgain_z.
iNav CLI variables
oleost edited this page 7 days ago · 28 revisions
Pages 15
- Home
- [WiP] Quick setup guide
- Advanced accelerometer calibration
- Coordinate systems
- Custom mixes for exotic setups
- GPS Failsafe and Glitch Protection
- HOWTO setup iNAV for fixed wing
- INAV blackbox variables
- iNav CLI variables
- iNav setup checklist
- Inertial position estimator (INAV)
- Navigation modes
- PID description
- RTH Altitude control modes
- Tested PID values on different types of aircrafts
Cleanflight CLI variables related to navigation features
General/Shared Variables
Variable | Description/Units | Min | Max |
---|---|---|---|
align_mag | When using an external magnetometer sensor this should be set to actual sensor alignment relative to board. Values: DEFAULT, CW0, CW90, CW180, CW270, CW0FLIP, CW90FLIP, CW180FLIP, CW270FLIP | ||
align_board_roll | Board alignment on ROLL axis (deg * 10) | -1800 | 3600 |
align_board_pitch | Board alignment on PITCH axis (deg * 10) | -1800 | 3600 |
align_board_yaw | Board alignment on YAW axis (deg * 10) | -1800 | 3600 |
gps_provider | GPS hardware type: NMEA, UBLOX, NAZA, I2C-NAV | ||
gps_nav_model | GPS navigation model: LOW_G (Pedestrian), HIGH_G (Airborne<4G). Currently supported only of Ublox GPS modules. HIGH_G may increase accuracy, especially on fast and agile airplanes, but it requires much better satellite signal quality. Safe default is "LOW_G". | ||
failsafe_procedure | Failsafe type: SET-THR - set throttle tofailsafe_throttle , RTH - execute RTH sequence if possible, land otherwise | ||
max_angle_inclination_rll | Maximum inclination in level mode (ROLL axis) | 100 | 900 |
max_angle_inclination_pit | Maximum inclination in level mode (PITCH axis) | 100 | 900 |
inav_accz_unarmedcal | Controls if inertial position estimator should compute gravity offset on accelerometer Z-axis dynamically when drone is unarmed. Mostly affects accuracy of altitude estimation and althold performace. No real reason to disable this feature. | OFF | ON |
inav_use_gps_velned | Defined if iNav should use velocity data provided by GPS module for doing position and speed estimation. If set to OFF iNav will fallback to calculating velocity from GPS coordinates. Using native velocity data may improve performance on some GPS modules. Some GPS modules introduce significant delay and using native velocity may actually result in much worse performance. Safe default is "OFF" | OFF | ON |
inav_gps_delay | GPS position and velocity data usually arrive with a delay. This parameter defines this delay. Default should be reasonable for most GPS receivers. | 0 | 500 |
inav_gps_min_sats | Minimum number of GPS satellites in view to consider GPS position valid. Some GPS receivers appeared to be very inaccurate with low satellite count. | 5 | 10 |
inav_w_z_baro_p | 0 | 10 | |
inav_w_z_gps_p | 0 | 10 | |
inav_w_z_gps_v | 0 | 10 | |
inav_w_xy_gps_p | 0 | 10 | |
inav_w_xy_gps_v | 0 | 10 | |
inav_w_xy_dr_v | 0 | 10 | |
inav_w_z_res_v | 0 | 10 | |
inav_w_xy_res_v | 0 | 10 | |
inav_w_acc_bias | 0 | 1 | |
inav_max_eph_epv | 0 | 9999 | |
inav_baro_epv | 0 | 9999 | |
nav_alt_p | |||
nav_alt_i | |||
nav_alt_d | |||
nav_vel_p | |||
nav_vel_i | |||
nav_vel_d | |||
nav_navr_p | |||
nav_navr_i | |||
nav_navr_d | |||
nav_use_midrc_for_althold | OFF | ON | |
nav_disarm_on_landing | OFF | ON | |
nav_extra_arming_safety | If set to ON drone won't arm if no GPS fix | OFF | ON |
nav_user_control_mode | Defines how Pitch/Roll input from RC receiver affects flight in POSHOLD mode: ATTI - right stick controls attitude like in ANGLE mode; CRUISE - right stick controls velocity in forward and right direction. | ||
nav_position_timeout | If GPS fails wait for this much seconds before switching to emergency landing mode (0 - disable) | 0 | 10 |
nav_wp_radius | Waypoint radius. Waypoint would be considered reached if machine is within this radius | 100 | 2000 |
nav_max_speed | Maximum velocity firmware is allowed in full auto modes (POSHOLD, RTH, WP) | 10 | 2000 |
nav_manual_speed | Maximum velocity firmware is allowed when processing pilot input for POSHOLD/CRUISE control mode | ||
nav_manual_climb_rate | Maximum climb/descent rate firmware is allowed when processing pilot input for ALTHOLD control mode | ||
nav_pos_hold_deadband | 10 | 250 | |
nav_alt_hold_deadband | 10 | 250 | |
nav_min_rth_distance | |||
nav_rth_alt_mode | Altitude control mode: CURRENT, EXTRA, FIXED, MAX, AT_LEAST | ||
nav_rth_altitude | |||
gyro_soft_lpf_hz | Software-based filter to remove mechanical vibrations from the gyro signal. Value is cutoff frequency (Hz). For larger frames with bigger props set to lower value. Default 60Hz | 0 | 200 |
acc_soft_lpf_hz | Software-based filter to remove mechanical vibrations from the accelerometer measurements. Value is cutoff frequency (Hz). For larger frames with bigger props set to lower value. Default 15Hz | 0 | 200 |
baro_use_median_filter | |||
magzero_x | |||
magzero_y | |||
magzero_z | |||
acczero_x | |||
acczero_y | |||
acczero_z | |||
accgain_x | |||
accgain_y | |||
accgain_z |
Multirotor
Variable | Description/Units | Min | Max |
---|---|---|---|
nav_mc_bank_angle | Maximum banking angle (deg) that multicopter navigation is allowed to set. Machine must be able to satisfy this angle without loosing altitude | 15 | 45 |
nav_mc_hover_thr | Multicopter hover throttle hint for altitude controller. Should be set to approximate throttle value when drone is hovering. | 1000 | 2000 |
nav_mc_min_fly_thr | Max throttle value treated as one of the conditions for landing detection. Must be sufficiently low to guarantee the "not flying" state even with full battery, but high enough for Altitude Hold controller to reach it. | 1000 | 2000 |
throttle_tilt_comp_str | Can be used in ANGLE and HORIZON mode and will automatically boost throttle when banking. Setting is in percentage, 0=disabled. | 0 | 100 |
nav_pos_p | Controls how fast the drone will fly towards the target position. This is a multiplier to convert displacement to target velocity | ||
nav_pos_i | Controls deceleration time. Measured in 1/100 sec. Expected hold position is placed at a distance calculated as decelerationTime * currentVelocity | ||
nav_pos_d | |||
nav_posr_p | P gain of Position-Rate (Velocity to Acceleration) PID controller. Higher P means stronger response when position error occurs. Too much P might cause "nervous" behavior and oscillations | 0 | 255 |
nav_posr_i | I gain of Position-Rate (Velocity to Acceleration) PID controller. Used for drift compensation (caused by wind for example). Higher I means stronger response to drift. Too much I gain might cause target overshot | 0 | 255 |
nav_posr_d | D gain of Position-Rate (Velocity to Acceleration) PID controller. It can damp P and I. Increasing D might help when drone overshoots target. | 0 | 255 |
Fixed-Wing
Variable | Description/Units | Min | Max |
---|---|---|---|
nav_fw_cruise_thr | |||
nav_fw_min_thr | |||
nav_fw_max_thr | |||
nav_fw_bank_angle | |||
nav_fw_climb_angle | |||
nav_fw_dive_angle | |||
nav_fw_pitch2thr | |||
nav_fw_roll2pitch | |||
nav_fw_loiter_radius |
GPS Failsafe and Glitch Protection
RiceCakeWtf edited this page 2 days ago · 7 revisions
Pages 15
- Home
- [WiP] Quick setup guide
- Advanced accelerometer calibration
- Coordinate systems
- Custom mixes for exotic setups
- GPS Failsafe and Glitch Protection
- HOWTO setup iNAV for fixed wing
- INAV blackbox variables
- iNav CLI variables
- iNav setup checklist
- Inertial position estimator (INAV)
- Navigation modes
- PID description
- RTH Altitude control modes
- Tested PID values on different types of aircrafts
Overview
GPS Systems can occasionally drop the signal (lose FIX) or provide significantly inaccurate position information (glitch). While errors are more likely in conditions where the GPS signal can bounce off multiple paths before reaching the receiver (multipathing), errors can occasionally occur even with clear sky.
Without updates from GPS System, the inertial position estimation allow approximately 1.5 seconds of position information but after this the horizontal position drift becomes so large that the horizontal position cannot be maintained at all. At this point the position estimator will report invalid position to the navigation core. If you still have RC radio control it is recommended to take back control using ANGLE, HORIZON, ALTHOLD or ACRO as soon as possible.
Action taken on invalid position is dependent on current flight mode.
GPS glitch protection
Sometimes GPS provides very inaccurate position information despite having the fix and the good satellite count. This event is usually called a "GPS glitch". iNav has logic to detect and ignore inaccurate/inconsistent GPS position updates. Glitches are detected by comparing the new position update received from the GPS unit with a position projected out from the previous update's position and velocity.
The new GPS position is accepted as “good” if:
- the two positions are within the hard coded INAV_GPS_GLITCH_RADIUS (currently 2.5m)
- the new position is within a radius that is 10m/s/s (INAV_GPS_GLITCH_ACCEL) * dt * dt. Where “dt” is the time difference between the two GPS samples.
GPS glitches are treated by the position estimator in the same way as losing GPS fix.
At the moment the code is experimental and "glitched" GPS positions are not ignored.
Action taken on invalid position event
ANGLE, HORIZON, ACRO, ALTHOLD mode
These modes are not GPS-dependent, nothing will happen but you will be unable to switch into an autopilot flight mode (POSHOLD, RTH, WP) until the failure clears.
POSHOLD mode
The copter will be forced into ANGLE mode, pilot will have complete control over copter attitude. If ALTHOLD mode was selected it will remain active. When failure clears POSHOLD more will resume.
RTH and WP modes (including failsafe RTH)
RTH and WP are considered full-auto modes. It is assumed that pilot might have no control over the copter so the safest action in case of invalid position is landing the machine. Copter will enter Emergency Landing state if failure is consistent for over 2 seconds.
Emergency Landing
In case of critical failure, Emergency Landing is triggered. In Emergency Landing state copter is forced into ANGLE mode, ROLL and PITCH input is centered to maintain level, pilot stick input is ignored and copter enters a controlled descent.
While Emergency Landing is active pilot is unable to switch into ALTHOLD, POSHOLD, RTH or WP mode. If pilot wants to regain control of the copter he should switch to ANGLE, HORIZON or ACRO more.
Tips to improve GPS reception and avoid GPS outages and glitches
- Place the GPS module on the outside of your vehicle (in an elevated position or on a mast if appropriate) with a clear view of the sky.
- If GPS module is combined with a compass sensor, place it as far as possible from the motors, ESCs and power wires (at lest 10 cm)
- 1.2-1.3 GHz FPV video transmitters are know to be interfering with GPS reception. If you use such transmitter place it as far as possible from GPS module and expect some degradation in GPS quality
- Select a GPS module with biggest GPS antenna. Bigger GPS antenna - better reception.
- Use a two-system receiver is possible. For example uBlox NEO-M8N is GPS/GLONASS capable receiver. More systems means better noise resistance, more satellites, better accuracy.
Ref : http://www.rcgroups.com/forums/showthread.php?t=2495732
沒有留言:
張貼留言