ArmFox V4 : GPS and Altitude Hold Work very Well.

Dear Friends,

after my last fly in stable mode i update the i2c libs for compass and barometer , now is better of older versions so i can upgrade main core loop to 800 hz instead of standard 200 hz .

Above the resutls of my first automatic flight , i'm very happy of this first result .. i start to use the performances of our Multipilo32 Arm Cortex M4 processors.

More Performances = More stability.

Best

Roberto

E-mail me when people leave their comments –

You need to be a member of FOXTEAM UAV CLAN to add comments!

Join FOXTEAM UAV CLAN

Comments

  • Exactly 2.0001 i add a command in CLI 'R' when you push it you can see the speed of mainloop so i found the problem on i2c lib i forget a 50 milli debug delay :( So when i activated the i2c sensor the main loop worked very slow .. then when i found the problem i try to fly with 1 ms .. and read on debug around 800 hz.
  • 500Hz is right (2ms is 500Hz, the error you get with this > is exactly 0.1% 1microsecond)

    what kind of artifacts do you mean?

    the gyro doesn't care how fast you measure it's analog output

  • but what kinda artefacts do you create when reading the idg500 too fast?

    the sensivitiy is 2 milli volt per degree and second.

    would be intersting just to test an idg500 breakout board ;-)

    but 300 hz is right when reading christian dobler maester thesis. he is the createor of the last pixhawk hw.

    robert

    i like the the 333 hz refresh rate :)

  • nonono, greater than 2ms doesn't mean 3ms ;)

    but you are right, it should be >=

  • excusi:

    // Main loop at 800Hz (IMU + control)
       if ((currentTime-mainLoop) > 2)    // about 800Hz (every 2ms)

    hmmm,

    the if is satisfied when the differenz is 3 ms.

    3 ms means a refreshrate of 333 hz.

    that sounds reasonable to me.

    robert

  • as far as I know roberto uses I2C, so his output can be at somewhere around 4KHz

    his input are the gyros, which can be about 2KHz, so he could go up to these 2KHz

     

    radio side is not imported for flight stability (GPS only gives 10Hz, but main loop is running much faster)

  • what is the error rate at the higher frequence?

    i have no idea when the chip reaches it's limit when reading to fast over the spi bus.

    but when looking at the output side: aka esc's then i think the whole thing is overengineered.

    the system system has to match: input and output.

    robert

  • This is the new code with adc.Update()

     

    // Main loop
    void loop()
    {
     
      currentTimeMicros = micros();
      currentTime = currentTimeMicros / 1000;

      // Main loop at 800Hz (IMU + control)
      if ((currentTime-mainLoop) > 2)    // about 800Hz (every 2ms)
      {
        G_Dt = (currentTimeMicros-previousTimeMicros) * 0.000001;   // Microseconds!!!
        mainLoop = currentTime;
        previousTimeMicros = currentTimeMicros;

        //IMU DCM Algorithm
        adc.Update();  // THIS is new metod present in ADC class for Multipilot32.
        Read_adc_raw();       // Read sensors raw data
        Matrix_update();
        Normalize();         
        Drift_correction();
        Euler_angles();
  • @Sebastian,

    in my revision of code I change all the library because is totally different of 8bit revision. I change the AP_ADC and add a new function that i call Update , so in the main code i put his function where i need freesh gyro and acc data . So also the gyro is update at 800 hz.

    The quality of fligh is better at this rate , in the next revision i would try to goin up until the limit of adc converter and check what happen.

    At the moment i cannoct activate the i2c sensor if i going up until i don't activate dma for read i2c.

    Best

    Roberto

  • @robert: oilpan gyros can deliver data much faster, but you need to configure the ADC to do so
This reply was deleted.

Blog Topics by Tags

Monthly Archives