Skip to content

v0.4.0 - Multi-Airframe Support and 3-Axis Control System#48

Open
BryanSouza91 wants to merge 28 commits into
mainfrom
dev
Open

v0.4.0 - Multi-Airframe Support and 3-Axis Control System#48
BryanSouza91 wants to merge 28 commits into
mainfrom
dev

Conversation

@BryanSouza91
Copy link
Copy Markdown
Owner

@BryanSouza91 BryanSouza91 commented Apr 10, 2026

Multi-Airframe Support and 3-Axis Control System

Summary

This update transitions WingFC from a fixed elevon controller to a modular, multi-airframe flight control system. It introduces a dedicated mixing layer, expands hardware output support to 5 servos, and upgrades the stabilization engine to full 3-axis control (Pitch, Roll, and Yaw).

Major Changes

1. Modular Airframe Mixer

  • Created mixer.go to decouple PID control outputs from physical servo movements.
  • Added support for several airframe types including Elevons, T-Tail (Single/Dual Aileron), and V-Tail (Single/Dual Aileron).
  • Aircraft type is now selectable via a single constant in config.go.

2. 3-Axis Stabilization

  • Yaw Control: Added a third PID controller for Yaw/Rudder stabilization.
  • Kalman Upgrade: Upgraded the Kalman Filter from 2x2 to 3x3 matrices in kalman.go to track Pitch, Roll, and Yaw states simultaneously.
  • Matrix Math: Expanded the internal matrix library to support the higher-dimension calculations required for 3-axis fusion.

3. Hardware and PWM Improvements

  • Expanded Outputs: Increased supported servo channels from 2 to 5.
  • Frequency Separation: Configured the Seeed XIAO nRF52840 to use separate PWM instances. Servos can run at 50Hz (compatible with analog servos) while the ESC runs at 400Hz for faster throttle response.
  • Servo Calibration: Added per-servo min/max limits, subtrim offsets, and signal reversal settings in config.go.

Modified Files

  • config.go: Added aircraft types, servo reversals, and yaw PID constants.
  • main.go: Integrated new 3-axis control and mixer logic.
  • hardware.go: Updated pin mappings and PWM peripheral configurations.
  • helpers.go: Implemented setAllServos() and applyReversal() functions.
  • kalman.go: Refactored for 3-axis state estimation.
  • mixer.go: (New) Core mixing logic for different aircraft configurations.
  • matrix.go: Added support for 3x3 and 3x2 matrix operations.
  • dshot.go: Added support for DShot ESCs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant