AutoTrim is an automatic trim control system that integrates with Microsoft Flight Simulator 2020 via FSUIPC. The program continuously reads trim data from the simulator and uses a PID controller to physically adjust the Honeycomb Bravo trim wheel through an Arduino controlled motor, providing automatic pitch control and vertical speed hold.
Example of auto trim on a Boeing 737
Global Configuration: Adjust PID controller parameters, vertical speed, and Arduino communicationProfile Management: Save and load different configurations for different aircraftStandalone Mode: Works without hardware
FSUIPC Connection: Real-time simulator data readingLow Latency: Fast response to changing flight conditionsInput Capture: Captures key and button combinations at simulator level
VS Adjustment: Adjust vertical speed in 100 fpm steps (configurable)Hold VS: Set and maintain current vertical speedAuto Level: Set and maintain 0 fpm vertical speed
Precise Control: PID algorithm optimized for smooth trim with anti-windupConfigurable Parameters: Fine-tuning of P, I, and D constantsAdaptive Response: Automatic compensation based on flight conditions
USB Serial Communication: Efficient command protocolMotor Control: Continuous or step-based motor adjustment with configurable speedAcceleration Curve: For smooth, precise movements
- Windows 10/11 (64-bit)
- Arduino drivers
- FSUIPC7
- Microsoft Flight Simulator 2020
- Honeycomb Bravo Throttle Quadrant
- Arduino Uno R3
- Nema 17 Step Motor (12V, 2A, 55NΒ·cm bipolar, 1.81)
- TB6600 Controller (24V, 4A, microstepping up to 1/32), configured at 4A, 1/1
- Power Supply (15V, 5A)
- GT2 timing belt with 20-tooth pulleys
- Download and extract
AutoTrimfrom releases - Ensure FSUIPC7 and Arduino drivers are installed
- Upload the Arduino sketch from
Arduino/AutoTrimusing Arduino IDE - Run
AutoTrim.exe
| Parameter | Description | Range | Default |
|---|---|---|---|
Kp |
Proportional constant | 0.0 - 10.0 | 1.5 |
Ki |
Integral constant | 0.0 - 5.0 | 0.3 |
Kd |
Derivative constant | 0.0 - 2.0 | 0.1 |
update_rate |
Update frequency (Hz) | 1 - 100 | 20 |
max_trim_rate |
Maximum trim change rate | 1 - 100 | 50 |
| Parameter | Description | Range | Default |
|---|---|---|---|
vs_increment |
VS step (fpm) | 50 - 500 | 100 |
vs_deadband |
VS deadband (fpm) | 0 - 50 | 10 |
vs_max |
Max allowed VS (fpm) | 1000 - 5000 | 2000 |
| Parameter | Description | Values | Default |
|---|---|---|---|
port |
Arduino COM port | COM1-COM99/AUTO | AUTO |
baudrate |
Baud rate | 9600-115200 | 9600 |
timeout |
Communication timeout (ms) | 100-5000 | 1000 |
| Parameter | Description | Format | Default |
|---|---|---|---|
toggle_key |
Enable/Disable | Ctrl+Alt+Key | Ctrl+Alt+T |
vs_up_key |
Increase VS | Ctrl+Alt+Key | Ctrl+Alt+Up |
vs_down_key |
Decrease VS | Ctrl+Alt+Key | Ctrl+Alt+Down |
hold_vs_key |
Hold current VS | Ctrl+Alt+Key | Ctrl+Alt+H |
level_key |
Level aircraft | Ctrl+Alt+Key | Ctrl+Alt+L |
Arduino Uno R3
ββ Pin 8 β Controller ENA
ββ Pin 9 β Controller DIR
ββ Pin 10 β Controller PUL
ββ GND β Controller GND
Controller (TB6600)
ββ ENA- β Controller GND
ββ ENA+ β Arduino Pin 8
ββ DIR- β Controller GND
ββ DIR+ β Arduino Pin 9
ββ PUL- β Controller GND
ββ PUL+ β Arduino Pin 10
β
ββ B- β Motor Coil B-
ββ B+ β Motor Coil B+
ββ A- β Motor Coil A-
ββ A+ β Motor Coil A+
β
ββ GND β Power Supply GND
ββ VCC β Power Supply VCC (15V)
Honeycomb Bravo
ββ Trim Wheel β Coupled via GT2 belts to the motor
The serial protocol between PC and Arduino uses ASCII commands:
| Command | Format | Description |
|---|---|---|
Trim Up Cont. |
U:[speed] |
Trim up continuously at X speed |
Trim Up Steps |
US:[steps]:[speed] |
Trim up N steps at X speed |
Trim Down Cont. |
D:[speed] |
Trim down continuously at X speed |
Trim Down Steps |
DS:[steps]:[speed] |
Trim down N steps at X speed |
Stop |
S |
Stop motor |
[steps] is a positive integer value.
[speed] is a value between 100 and 700, representing the delay between steps.
To optimize PID behavior:
-
Start with conservative values:
- Kp = 1.0, Ki = 0.0, Kd = 0.0
-
Adjust Kp (Proportional):
- Increase until the system responds quickly
- If it oscillates, reduce slightly
-
Add Ki (Integral):
- Increase to eliminate steady-state error
- Typical values: 0.1 - 0.5
-
Add Kd (Derivative):
- Increase to reduce overshoot
- Typical values: 0.05 - 0.2
# Scenario 1: Stable cruise
# - Enable AutoTrim in level flight
# - Observe stability without intervention
# Scenario 2: Speed changes
# - Gradually change power
# - Verify automatic trim adjustment
# Scenario 3: Configuration changes
# - Extend/retract flaps
# - Verify correct compensation
# Scenario 4: Vertical speeds
# - Set VS to +500 fpm
# - Verify VS hold
# - Switch to -500 fpm
# - Repeat for different VS valuesMSFS 2020
β (FSUIPC)
Data Reading (VS, Trim, etc.)
β
Error Calculation (Target VS - Current VS)
β
PID Controller
β
Trim Adjustment Calculation
β
Serial Protocol
β
Arduino
β
Motor Control
β
Physical Trim Wheel Movement
β
Honeycomb Bravo
β
MSFS 2020 (closes the loop)
Error: Unable to connect to FSUIPC
Solution:
1. Verify MSFS 2020 is running
2. Confirm FSUIPC7 is installed and running
3. Run AutoTrim as administrator
Error: Arduino not detected or not responding
Solution:
1. Check USB connection
2. Ensure the sketch is correctly uploaded
3. Verify baudrate in config.ini matches Arduino
4. Check the COM port is correct
5. Try another USB cable
Problem: Trim moves constantly up and down
Solution:
1. Reduce Kp in config.ini (e.g., from 1.5 to 1.0)
2. Reduce Kd in config.ini
3. Increase vs_deadband (deadband)
4. Verify the motor has no mechanical play
Problem: Trim takes too long to adjust
Solution:
1. Increase Kp in config.ini
2. Increase update_rate (beware of overload)
3. Increase max_trim_rate
4. Check FSUIPC connection latency
Problem: Motor vibrates but does not rotate
Solution:
1. Check motor wiring to driver
2. Check external motor power (9-12V)
3. Verify step sequence in Arduino code
4. Test with motor disconnected from trim wheel
5. Increase motor current (driver adjustment)
6. Review micro-delays in Arduino code
Q: Does it work with all MSFS 2020 aircraft?
A: Yes, it works with any aircraft that has pitch trim. Some aircraft may require PID tuning.
Q: Can I use another controller instead of Arduino?
A: Yes, any microcontroller with serial communication can be used by adapting the protocol.
Q: Does it affect manual trim on the Honeycomb Bravo?
A: No, the system detects manual movement and adapts. You can disable AutoTrim at any time.
Q: Does it work in multiplayer?
A: Yes, it works in multiplayer and shared sessions.
Q: How much latency does the system introduce?
A: Total latency is typically <100ms, imperceptible during normal flight.
Q: Do I need programming to use it?
A: Not for basic use. You only need to upload the Arduino sketch and adjust config.ini.
This project is licensed under the WTFPL β Do What the Fuck You Want to Public License.
π©οΈ Developed by Kobayashi82 π©οΈ
"Even virtual pilots deserve a break"






