Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copter: run rate loop at full filter rate in its own thread #27029

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Commits on Sep 26, 2024

  1. Copter: run copter attitude control with separate rate thread

    run motors output at rate thread loop rate
    allow rate thread to be enabled/disabled at runtime for in-flight impact testing
    setup the right PID notch sample rate when using the rate thread the PID notches
     run at a very different sample rate
    call update_dynamic_notch_at_specified_rate() in rate thread
    log RTDT messages to track rate loop performance
    set dt each cycle of the rate loop thread
    run rate controller on samples as soon as they are ready
    detect overload conditions in both the rate loop and main loop
    decimate the rate thread if the CPU appears overloaded
    decimate the gyro window inside the IMU
    add in gyro drift to attitude rate thread
    add fixed-rate thread option
    configure rate loop based on AP_INERTIALSENSOR_FAST_SAMPLE_WINDOW_ENABLED
    better rate loop thread decimation management
    ensure fix rate attitude is enabled on arming
    add rate loop timing debug
    update backend filters rather than all the backends
    provide more options around attitude rates
    only log attitude and IMU from main loop
    force trigger_groups() and reduce attitude thread priority
    migrate fast rate enablement to FSTRATE_ENABLE
    remove rate thread logging configuration and choose sensible logging rates
    conditionally compile rate thread pieces
    allow fast rate decimation to be user throttled
    if target rate changes immediately jump to target rate
    recover quickly from rate changes
    ensure fixed rate always prints the rate on arming and is always up to date
    add support for fixed rate attitude that does not change when disarmed
    only push to subsystems at main loop rate
    add logging and motor timing debug
    correctly round gyro decimation rates
    set dshot rate when changing attitude rate
    fallback to higher dshot rates at lower loop rates
    re-factor rate loop rate updates
    log rates in systemid mode
    reset target modifiers at loop rate
    don't compile in support on tradheli
    move rate thread into its own compilation unit
    add rate loop config abstraction that allows code to be elided on non-copter builds
    dynamically enable/disable rate thread correctly
    add design comment for the rate thread
    
    Co-authored-by: Andrew Tridgell <andrew@tridgell.net>
    andyp1per and tridge committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    a48c49f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ca90b8f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    621d017 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    82eee36 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    bec42eb View commit details
    Browse the repository at this point in the history
  6. AP_HAL: set HAL_INS_RATE_LOOP in boards

    restrict rate loop to H7 and F7
    andyp1per committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    d8a3d16 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    04f18ef View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    252256e View commit details
    Browse the repository at this point in the history
  9. AP_HAL_ChibiOS: ensure dshot rate can be set dynamically

    honour the requested dshot rate as near as possible
    andyp1per committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    20d9f5b View commit details
    Browse the repository at this point in the history
  10. scripts: add AP_INERTIALSENSOR_FAST_SAMPLE_WINDOW_ENABLED to build_op…

    …tions.py and extract_features.py
    andyp1per committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    d68b1bf View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    e7e6819 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    c97d76a View commit details
    Browse the repository at this point in the history
  13. AP_InertialSensor: keep a queue of gyro samples for use by the rate t…

    …hread
    
    decimate the gyro window locally
    configure rate loop buffer based on AP_INERTIALSENSOR_FAST_SAMPLE_WINDOW_ENABLED
    allow backends to be updated from rate thread
    output debug error if rate loop buffer overruns
    add support for updating filter parameters independently of propagating samples
    add rate loop config abstraction that allows code to be elided on non-copter builds
    must be using harmonic notch to use rate thread
    mediate fast rate loop buffer using mutex and binary semaphore
    ensure gyro samples are used when the rate loop buffer isn't
    
    Co-Authored-By: Andrew Tridgell <andrew@tridgell.net>
    andyp1per and tridge committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    f59b5c9 View commit details
    Browse the repository at this point in the history

Commits on Oct 5, 2024

  1. Configuration menu
    Copy the full SHA
    25e2a6b View commit details
    Browse the repository at this point in the history