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

Propeller test not reporting motorPass #1430

Open
ttolbol opened this issue Oct 30, 2024 · 7 comments
Open

Propeller test not reporting motorPass #1430

ttolbol opened this issue Oct 30, 2024 · 7 comments
Assignees
Labels
Milestone

Comments

@ttolbol
Copy link

ttolbol commented Oct 30, 2024

I am trying to get the automatic propeller test to work. I am using python cflib and doing the following:

cflib.crtp.init_drivers()
scf = SyncCrazyflie(uri, cf=Crazyflie(rw_cache="./cache"))
scf.open_link()
log_config = LogConfig(name="Motor Health", period_in_ms=100)
log_config.add_variable("health.motorPass", "uint8_t")
with SyncLogger(scf, log_config) as logger:
    scf.cf.param.set_value("health.startPropTest", "1")
    for log_entry in logger:
        print(log_entry[1])

I am getting {'health.motorPass': 0} despite all 4 propellers being on.
When doing the test, two of the propellers spin, then I get 4 beeps (like when powering on the CF), followed by a repeating pattern of 4 quick red blinks and a pause.

  • How do I know when the test has concluded?
  • Why am I not seeing anything in health.motorPass after running the test?
  • How do I get the drone back in a state where it can fly after the test?
@tobbeanton
Copy link
Member

Perhaps there is something not working when running it from a script. Do you get the same behaviour if you launch the test from the cfclient->console tab?

@ttolbol
Copy link
Author

ttolbol commented Nov 1, 2024

Same behavior. This is what I'm getting:

SYS: ----------------------------
SYS: Crazyflie 2.1 is up and running!
SYS: Build 0:80ee72ad480a (2024.10) CLEAN
SYS: I am 0x203035545131500700400018 and I have 1024KB of flash!
CFGBLK: v1, verification [OK]
DECK_CORE: 1 deck(s) found
DECK_CORE: Calling INIT on driver bcLighthouse4 for deck 0
IMU: BMI088: Using I2C interface.
IMU: BMI088 Gyro connection [OK].
IMU: BMI088 Accel connection [OK]
IMU: BMP388 I2C connection [OK]
ESTIMATOR: Using Kalman (2) estimator
CONTROLLER: Using PID (1) controller
MTR-DRV: Using brushed motor driver
SYS: About to run tests in system.c.
SYS: NRF51 version: 2024.10 (CF21)
EEPROM: I2C connection [OK].
STORAGE: Storage check [OK].
IMU: BMI088 gyro self-test [OK]
SYS: Self test passed!
STAB: Wait for sensor calibration...
SYS: Free heap: 16624 bytes
LHFL: Lighthouse bootloader version: 2
STAB: Starting stabilizer loop
ESTKALMAN: State out of bounds, resetting
SUP: Can not fly
SUP: Ready to fly
LHFL: Bitstream CRC32: 112BC794 [PASS]
LHFL: Firmware version 6 verified, booting deck!
HEALTH: Acc noise floor variance X+Y:0.004323, (Z:0.038787)
HEALTH: Motor M1 variance X+Y: 5.26 (Z:4.70), voltage sag:0.33
HEALTH: Motor M2 variance X+Y: 0.49 (Z:0.57), voltage sag:0.37
SYS: ----------------------------
SYS: Crazyflie 2.1 is up and running!
SYS: Build 0:80ee72ad480a (2024.10) CLEAN
ash!
CFGBLK: v1, verification [OK]
DECK_INFO: Reading deck nr:0 [FAILED]. No driver will be initialized!
DECK_CORE: 0 deck(s) found
IMU: BMI088: Using I2C interface.
IMU: BMI088 Gyro connection [OK].
IMU: BMI088 Accel connection [OK]
IMU: BMP388 I2C connection [OK]
ESTIMATOR: Using Complementary (1) estimator
CONTROLLER: Using PID (1) controller
MTR-DRV: Using brushed motor driver
SYS: About to run tests in system.c.
SYS: NRF51 version: 2024.10 (CF21)
EEPROM: I2C connection [OK].
STORAGE: Storage check [OK].
IMU: BMI088 gyro self-test [OK]
SYS: The system resumed after a failed assert [WARNING]
SYS: Assert failed at ../src/modules/src/stabilizer.c:274
SYS: cfAssertNormalStart [FAIL]

It only does M1 and M2, then restarts and gets stuck at assert fail.

@ttolbol
Copy link
Author

ttolbol commented Nov 1, 2024

Interestingly it does not find the lighthouse deck after restarting.

@ttolbol
Copy link
Author

ttolbol commented Nov 1, 2024

The assertion is here:

void rateSupervisorTask(void *pvParameters) {
  while (1) {
    // Wait for the semaphore to be given by the stabilizerTask
    if (xSemaphoreTake(xRateSupervisorSemaphore, M2T(2000)) == pdTRUE) {
      // Validate the rate
      if (!rateSupervisorValidate(&rateSupervisorContext, xTaskGetTickCount())) {
        if (!rateWarningDisplayed) {
          DEBUG_PRINT("WARNING: stabilizer loop rate is off (%lu)\n", rateSupervisorLatestCount(&rateSupervisorContext));
          rateWarningDisplayed = true;
        }
      }
    } else {
      // Handle the case where the semaphore was not given within the timeout
      DEBUG_PRINT("ERROR: stabilizerTask is blocking\n");
      ASSERT(false); // For safety, assert if the stabilizer task is blocking to ensure motor shutdown
    }
  }
}

Any insight on how to fix it is greatly appreciated.

@tobbeanton
Copy link
Member

Ahhh, this has been fixed in this PR. If you flash the latest release 2024.10.2 it should work again.

@tobbeanton
Copy link
Member

Fixed in #1432

@tobbeanton tobbeanton reopened this Nov 8, 2024
@tobbeanton
Copy link
Member

I was way to fast. The PR does not fix this issue.

@tobbeanton tobbeanton self-assigned this Nov 8, 2024
@tobbeanton tobbeanton added the bug label Nov 8, 2024
@tobbeanton tobbeanton added this to the next-release milestone Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants