Page 1 of 1

Meaning of Motor Speed and Gyro Values

Posted: Mon Oct 26, 2015 1:23 pm
by mcheli
Hi All,

I just have a quick question about some of the data that I am obtaining from my Quadcopter. I am retrieving Motor Speed and Gyroscope data...

Code: Select all

{

  "logconfig": {

    "logblock":

    {"name": "Stabilizer", "period":50,

     "variables": [

          {"name":"gyro.x", "type":"TOC", "stored_as":"float", "fetch_as":"float"},

          {"name":"gyro.y", "type":"TOC", "stored_as":"float", "fetch_as":"float"},

          {"name":"gyro.z", "type":"TOC", "stored_as":"float", "fetch_as":"float"},

          {"name":"motor.m1", "type":"TOC", "stored_as":"float", "fetch_as":"int16_t"},

          {"name":"motor.m2", "type":"TOC", "stored_as":"float", "fetch_as":"int16_t"},

          {"name":"motor.m3", "type":"TOC", "stored_as":"float", "fetch_as":"int16_t"},

          {"name":"motor.m4", "type":"TOC", "stored_as":"float", "fetch_as":"int16_t"},

     ]}

  }

}
But the values that I am getting from the quad make little sense to me and I haven't been able to find documentation. Motor speed has a range of about -20,000 to 50,000 (I think?). Gyro has a range of about -400, to 400.

The end result of what I am doing is streaming the data values to a web server and visualizing / analyzing the data to show the correlation between motor output and quad copter angle.

Any idea what this data actually means so I can analyze it?

Re: Meaning of Motor Speed and Gyro Values

Posted: Mon Oct 26, 2015 1:49 pm
by arnaud
The motors should be between 0 and 65536, it is a 16 bit values where 0 means 0% and 65536 means 100%. For more details there has been some investigation of what that means in actual thrust: https://wiki.bitcraze.io/misc:investigations:thrust

The gyro is in degrees per seconds. It needs to be accumulated to get the angle.

Accumulating directly the gyro will eventually drift so in the Crazyflie we merge gyro and accelerometer to get the pitch/roll angles. Those might be easier to use and analyse.

Re: Meaning of Motor Speed and Gyro Values

Posted: Mon Oct 26, 2015 2:18 pm
by mcheli
That makes perfect sense to me now :). I'll see what I can do for analysis on the server side to make those d/sec make sense, but since my objective is to show corrections to change in pitch / roll I think it shouldn't be too bad.

This project has been a dream to work on so far, you guys do a really great job of setting it up for easy development and providing excellent support. Thanks!

Re: Meaning of Motor Speed and Gyro Values

Posted: Fri Jan 22, 2016 5:09 am
by molatokarlo
Hi Sir,

How do you print the gyro values to the console of the CF Client?

Thank you!

Re: Meaning of Motor Speed and Gyro Values

Posted: Sat Jan 23, 2016 1:45 am
by chad
molatokarlo wrote:Hi Sir,

How do you print the gyro values to the console of the CF Client?

Thank you!
In the client's "Log blocks" tab, make sure the "Start" checkbox in the "Gyro" row is checked, then in the "Plotter" tab, choose the Gyro from the pull-down menu and see the values. You can also log these values to a file by checking the "Write to file" checkbox in the "Gyro" row on the "Log blocks" tab. AFAIK, they do not print to the console.

Re: Meaning of Motor Speed and Gyro Values

Posted: Mon Jan 25, 2016 12:27 am
by molatokarlo
chad wrote:
molatokarlo wrote:Hi Sir,

How do you print the gyro values to the console of the CF Client?

Thank you!
In the client's "Log blocks" tab, make sure the "Start" checkbox in the "Gyro" row is checked, then in the "Plotter" tab, choose the Gyro from the pull-down menu and see the values. You can also log these values to a file by checking the "Write to file" checkbox in the "Gyro" row on the "Log blocks" tab. AFAIK, they do not print to the console.
Thanks! I did not know that there was a setting like that. I'm using the Bitcraze VM 0.6v and I'm trying to understand the code since I want to obtain the gyro values to use them and/or possibly set values to them. So far the only thing I've been able to do is add new log values.