Skip to content

Implement Realistic Yaw Calculation and Control Loop #12

@yufurkan

Description

@yufurkan

Objective

Calculate the Yaw angle realistically using the onboard MPU6050 sensor rather than relying on perfect simulator data, and implement the Yaw PID controller to complete the 6-DOF flight dynamics.

ATTNETİON:
Since the MPU6050 lacks a magnetometer, absolute heading cannot be determined. The Yaw angle must be estimated by mathematically integrating the Gyroscope's Z-axis rate over time (Yaw += GyroZ * dt), acknowledging and accepting the inherent sensor drift.

  • Update ImuSensor.cpp to calculate and store the Yaw angle via Gyro Z integration.
  • Instantiate pid_yaw in AppMain.cpp with appropriate tuning limits.
  • Map receiver CH4 (Rudder) to the Yaw setpoint.
  • Calculate the Yaw PID output and feed it into the ActuatorMixer to generate the correct PWM signal for the Rudder.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions