This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
config.h [2016/05/29 01:30] silverxxx |
config.h [2017/11/09 22:08] (current) sirdomsen |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====Firmware configuration==== | + | ==== Firmware configuration ==== |
The " | The " | ||
+ | Other files can contain some settings too, notably the **pid.c** - for acro mode pids , **angle_pid.c** , for level mode pids, and **hardware.h** - depending on the particular code, hardware specific information. | ||
The settings are broken down into a few categories: | The settings are broken down into a few categories: | ||
+ | |||
* Settings that affect flight control, such as rate , expo, and switch assignment | * Settings that affect flight control, such as rate , expo, and switch assignment | ||
- | * Settings | + | * Settings |
- | * settings | + | * settings |
This info is for the H8 mini code, some settings may differ slightly in some builds. | This info is for the H8 mini code, some settings may differ slightly in some builds. | ||
- | ====Flight control settings==== | + | |
+ | ==== Flight control settings ==== | ||
This settings comprise of rate control, high and low, expo, if needed to be performed by quad itself ( for stock tx) and switch config, mainly for level mode switching. | This settings comprise of rate control, high and low, expo, if needed to be performed by quad itself ( for stock tx) and switch config, mainly for level mode switching. | ||
- | ===Rate=== | + | === Rate === |
- | The rate is changed by the following lines in control.h file. The unit is degrees / second, and is for low rates. So on low rates (stock tx) the quad will perform a 180 degree turn in 1 second at maximum control deflection. | + | The rate is changed by the following lines in config.h file. The unit is degrees / second, and (on some firmwares) |
< | < | ||
Line 26: | Line 29: | ||
High rates are controlled by a multiplier, which is applied to the low rates above. | High rates are controlled by a multiplier, which is applied to the low rates above. | ||
+ | |||
< | < | ||
// multiplier for high rates | // multiplier for high rates | ||
Line 33: | Line 37: | ||
</ | </ | ||
- | ===Switches (auxiliary channels)=== | + | **Note**: On some firmwares the **high** |
+ | |||
+ | < | ||
+ | // rate in deg/sec | ||
+ | // for acro mode | ||
+ | #define MAX_RATE 360.0 | ||
+ | #define MAX_RATEYAW 360.0 | ||
+ | |||
+ | #define LOW_RATES_MULTI 0.5f | ||
+ | </ | ||
+ | |||
+ | === Switches (auxiliary channels) === | ||
In this firmware, the switches/ | In this firmware, the switches/ | ||
Line 42: | Line 57: | ||
< | < | ||
- | |||
// level / acro mode switch | // level / acro mode switch | ||
- | // CH_AUX1 = gestures | + | |
- | // 0 - flip | + | // CH_FLIP - 0 - flip |
- | // 1 - expert | + | // CH_EXPERT - 1 - expert |
- | // 2 - headfree | + | // CH_HEADFREE - 2 - headfree |
- | // 3 - headingreturn | + | // CH_RTH - 3 - headingreturn |
- | // 4 - AUX1 ( gestures <<v and >> | + | // CH_AUX1 - 4 - AUX1 ( gestures <<v and>> |
- | // 5 - AUX2+ ( none ) | + | // CH_AUX2 - 5 - AUX2+ ( up - up - up ) |
- | // 6 - Pitch trims | + | // CH_AUX3 - gravity channel ( on if inverted , updated at zero throttle) |
- | // 7 - Roll trims | + | // CH_PIT_TRIM - 6 - Pitch trims |
- | // 8 - Throttle trims | + | // CH_RLL_TRIM - 7 - Roll trims |
- | // 9 - Yaw trims | + | // CH_THR_TRIM - 8 - Throttle trims |
- | // 10 - on always | + | // CH_YAW_TRIM - 9 - Yaw trims |
- | // 11 - off always | + | // CH_INV 10 - Inverted mode |
- | // CH_ON , CH_OFF , CH_FLIP , CH_EXPERT | + | // CH_VID 7 - |
- | // CH_HEADFREE , CH_RTH , CH_AUX1 , CH_AUX2 , CH_AUX3 , CH_AUX4 | + | // CH_PIC 8 - |
- | // CH_PIT_TRIM, | + | // CH_ON - 10 - on always |
+ | // CH_OFF - 11 - off always | ||
+ | // | ||
+ | // devo can use DEVO_CHAN_5 - DEVO_CHAN_10 | ||
#define LEVELMODE CH_AUX1 | #define LEVELMODE CH_AUX1 | ||
</ | </ | ||
+ | |||
+ | Virtual channels: Not all channels are sent from the transmitter, | ||
+ | |||
+ | **Stock tx** | ||
+ | |||
+ | The trim buttons do not do anything in the stock tx. To use the trims for controlling a function, set the function channel to the trim (such as CH_PIT_TRIM - pitch trims) and enable "# | ||
+ | |||
+ | //Do not enable " | ||
**Devo tx** | **Devo tx** | ||
Line 68: | Line 94: | ||
The devo channels are assigned as follows in the devo itself: | The devo channels are assigned as follows in the devo itself: | ||
+ | |||
< | < | ||
CHANNEL1 | CHANNEL1 | ||
Line 80: | Line 107: | ||
CHANNEL10, | CHANNEL10, | ||
CHANNEL11, | CHANNEL11, | ||
+ | CHANNEL12, | ||
</ | </ | ||
- | The quad firmware supports " | ||
- | ====Software features==== | + | Silverware also supports to set simply a channel number as numbered in DeviationTX:< |
+ | |||
+ | <font 14px/ | ||
+ | |||
+ | ==== Software features ==== | ||
The configuration file also contains options to enable a number of features, which may be needed on a personal basis. | The configuration file also contains options to enable a number of features, which may be needed on a personal basis. | ||
Feature list: | Feature list: | ||
+ | |||
- auto throttle | - auto throttle | ||
- lower throttle (mix) | - lower throttle (mix) | ||
Line 100: | Line 132: | ||
The auto throttle will keep a constant upwards thrust as the quad leans in one direction. Used in level mode, usually. | The auto throttle will keep a constant upwards thrust as the quad leans in one direction. Used in level mode, usually. | ||
- | Example: Suppose the quadcopter is at a 45 degrees angle. Because of the angle, only half the thrust will contribute to maintaining | + | Example: Suppose the quadcopter is at a 45 degrees angle. Because of the angle, only half the thrust will contribute to maintaining |
< | < | ||
#define AUTO_THROTTLE | #define AUTO_THROTTLE | ||
</ | </ | ||
+ | |||
**Lower throttle feature** | **Lower throttle feature** | ||
Line 115: | Line 149: | ||
The motor filter is a 3 tap hanning fir filter that is applied to the motor output. Enabled by default, as it uses little resources. | The motor filter is a 3 tap hanning fir filter that is applied to the motor output. Enabled by default, as it uses little resources. | ||
+ | |||
< | < | ||
#define MOTOR_FILTER | #define MOTOR_FILTER | ||
</ | </ | ||
+ | |||
**Clipff feature** | **Clipff feature** | ||
The clip feedforward feature is an experimental feature that is supposed to help improve control near full throttle, and also help with vibration issues. It may also improve maximum throttle by a small amount in presence of vibration. | The clip feedforward feature is an experimental feature that is supposed to help improve control near full throttle, and also help with vibration issues. It may also improve maximum throttle by a small amount in presence of vibration. | ||
+ | |||
< | < | ||
#define CLIP_FF | #define CLIP_FF | ||
</ | </ | ||
+ | |||
**Throttle transient compensation feature** | **Throttle transient compensation feature** | ||
Line 136: | Line 174: | ||
**Gyro lpf filter (software)** | **Gyro lpf filter (software)** | ||
- | The software lpf filter is a custom gyro filter, additional to the hardware filter which is present in the gyro device. The hardware filter is set around 43Hz by default, but for additional vibration removal, a software filter can be added. Recommended: | + | The software lpf filter is a custom gyro filter, additional to the hardware filter which is present in the gyro device. The hardware filter is set around 43Hz by default, but for additional vibration removal, a software filter can be added. Recommended: |
Enabling the filter may require slight lowering of D term, if set near maximum. A lowering of D term may need lowering of P term. As such , it's probably a good idea to have the filter enabled before you tune a quad. | Enabling the filter may require slight lowering of D term, if set near maximum. A lowering of D term may need lowering of P term. As such , it's probably a good idea to have the filter enabled before you tune a quad. | ||
Line 170: | Line 208: | ||
</ | </ | ||
- | ===What Gyro filters do=== | + | === |
- | [[http:// | + | |
- | + | ||
- | Unfortunately, | + | |
- | + | ||
- | I usually set the 88hz second order filter, because I found that it does not usually need a pid change. | + | |
- | + | ||
- | The hardware filter seems to not work well on zero setting ( 260 Hz), but it works fine on 1 and higher( 180 Hz). But I am not sure if changing from 3 to 1 would allow a perceivably improved response. | + | |
- | The hw filter lag saving is 3ms from 3 to 1 , and 2ms from 3 to 2, but I am not sure if it translates to higher usable D term, and hence improved response. | ||
- | You might get higher response by turning off the D term filter in the pid file, also, turning the motor filters off could reduce lag. Both of this filters filter less than the software filter, so it's possible that they are largely redundant with the software filter on. | ||
- | ===to be continued=== |