Skip to content

Commit

Permalink
Merge pull request #24 from rosflight/firmware-mixer-updates
Browse files Browse the repository at this point in the history
Firmware mixer updates
  • Loading branch information
bsutherland333 authored Dec 12, 2024
2 parents 7bd2c4b + 8ee96cd commit 56cdb95
Show file tree
Hide file tree
Showing 8 changed files with 521 additions and 139 deletions.
4 changes: 2 additions & 2 deletions docs/developer-guide/firmware/code-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Its main purpose is to handle the interaction between offboard commands and the

### Controller
The controller uses the inputs from the command manager and estimator to compute a control output.
This control output is computed in a generic form (\(x\), \(y\), and \(z\) torques, and force \(F\)), and is later converted into actual motor commands by the mixer.
This control output is computed in a generic form (\(Q_x\), \(Q_y\), and \(Q_z\) torques, and forces \(F_x, F_y,\) and \(F_z\)), and is later converted into actual motor commands by the mixer.

### Mixer
The mixer takes the generic outputs computed by the controller and maps them to actual motor commands depending on the configuration of the vehicle.
The mixer takes the outputs computed by the controller and maps them to actual motor commands depending on the configuration of the vehicle.
24 changes: 12 additions & 12 deletions docs/user-guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

Reading through the pages in this user guide in order should provide you with the information you need to get a vehicle flying with ROSflight. The following is a summary of the steps you'll need to follow to get your vehicle set up, with links to the corresponding documentation pages:

1. [Set up your hardware](hardware-setup.md) (fixed-wing or multirotor platform, flight controller, and companion computer)
2. [Flash your flight controller with the latest ROSflight firmware](flight-controller-setup.md)
3. [Set up your RC transmitter](rc-configuration.md)
4. [Set up ROS2 on your companion computer](ros2-setup.md)
5. [Configure the flight controller for your setup](parameter-configuration.md): the configuration checklists below should help guide you through this process
6. [Run through your preflight checks](preflight-checks.md)
7. [Tune the firmware attitude controller gains](improving-firmware-performance.md) (multirotors only)
8. [Set up autonomous flight via offboard control](autonomous-flight.md) (optional)
1. [Hardware setup](hardware-setup.md): Set up your hardware (fixed-wing or multirotor platform, flight controller, and companion computer)
2. [Flight controller setup](flight-controller-setup.md): Flash your flight controller with the latest ROSflight firmware.
3. [RC Configuration](rc-configuration.md): Set up your RC transmitter.
4. [ROS2 setup](ros2-setup.md): Set up ROS2 on your companion computer.
5. [Parameter configuration](parameter-configuration.md): Configure the flight controller for your setup. The configuration checklists below should help guide you through this process.
6. [Preflight checks](preflight-checks.md): Run through your preflight checks
7. [Improving firmware performance](improving-firmware-performance.md) (multirotors only): Tune the firmware attitude controller gains
8. [Autonomous flight](autonomous-flight.md) (optional): Set up autonomous flight via offboard control

## Configuration Checklist

Expand All @@ -19,7 +19,7 @@ The following checklists should help you get a new vehicle set up for the first

1. Set the `FIXED_WING` parameter (`1` if a fixed-wing, `0` if a multirotor)
2. Set the `RC_TYPE` parameter (`0` if PPM, `1` if SBUS)
3. Set the `MIXER` parameter to the appropriate value described in the [Hardware Setup](hardware-setup.md) page
3. Set the `PRIMARY_MIXER` parameter to the appropriate value described in the [Hardware Setup](hardware-setup.md) page
4. Set the `MOTOR_PWM_UPDATE` parameter (typically `490` for SimonK ESCs, `50` for standard servos)
5. Make sure your [RC transmitter is set up correctly](rc-configuration.md)
6. Set up your RC switches
Expand All @@ -38,7 +38,7 @@ The following checklists should help you get a new vehicle set up for the first

1. Calibrate ESCs
1. Make sure `MOTOR_MIN_PWM` and `MOTOR_MAX_PWM` are correct (usually `1000` and `2000`)
2. Set `MIXER` param to `0` (ESC calibration mixer)
2. Set `PRIMARY_MIXER` param to `0` (ESC calibration mixer)
3. Set `ARM_SPIN_MOTORS` to `0`
4. Perform ESC calibration. For standard ESCs:

Expand All @@ -47,14 +47,14 @@ The following checklists should help you get a new vehicle set up for the first
3. Connect power to the motors
4. Drop the throttle to minimum

5. Set the `MIXER` parameter back to the appropriate value for your vehicle (see the [Hardware Setup](hardware-setup.md#motor-layouts) page)
5. Set the `PRIMARY_MIXER` parameter back to the appropriate value for your vehicle (see the [Hardware Setup](hardware-setup.md#motor-layouts) page)
6. Set `ARM_SPIN_MOTORS` back to `1`

2. The `ARM_SPIN_MOTORS` parameter should be set to `1` so the motors spin slowly when armed. The idle throttle setting can be adjusted with the `MOTOR_IDLE_THR` parameter.
3. You'll most likely want to set the `CAL_GYRO_ARM` param to `1` to enable calibrating gyros before arming
4. Set the `RC_ATT_MODE` parameter to set RC control mode (`0` for rate mode, `1` for angle mode [default])
5. Set torque offsets as described in the [RC trim calculation](improving-firmware-performance.md#rc-trim) section of the Improving Firmware Performance page
6. Set the `FAILSAFE_THR` parameter to specify the throttle level the MAV will hold if the transimtter disconnects. Set the parameter to `0` if you just want the MAV to drop, otherwise determine the amount of throttle required to hover the MAV and set the parameter comfortably below that. DO NOT set it above, as this will result in a runaway MAV. We recommended that you test the throttle level in an enclosed space by powering off the transmitter while hovering, if you set this parameter above 0.
6. Set the `FAILSAFE_THR` parameter to specify the throttle level the MAV will hold if the transmitter disconnects. Set the parameter to `0` if you just want the MAV to drop, otherwise determine the amount of throttle required to hover the MAV and set the parameter comfortably below that. DO NOT set it above, as this will result in a runaway MAV. We recommended that you test the throttle level in an enclosed space by powering off the transmitter while hovering, if you set this parameter above 0.
6. Tune the controller gains as described in the [Multirotor gain tuning](improving-firmware-performance.md#gain-tuning) section of the Improving Firmware Performance page

### Fixed-Wing-Specific Setup
Expand Down
Loading

0 comments on commit 56cdb95

Please sign in to comment.