Meaning of Motor Speed and Gyro Values

Firmware/software/electronics/mechanics
Post Reply
mcheli
Beginner
Posts: 14
Joined: Fri Oct 02, 2015 7:48 pm

Meaning of Motor Speed and Gyro Values

Post 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?
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Meaning of Motor Speed and Gyro Values

Post 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.
mcheli
Beginner
Posts: 14
Joined: Fri Oct 02, 2015 7:48 pm

Re: Meaning of Motor Speed and Gyro Values

Post 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!
molatokarlo
Beginner
Posts: 6
Joined: Fri Jan 22, 2016 4:49 am

Re: Meaning of Motor Speed and Gyro Values

Post by molatokarlo »

Hi Sir,

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

Thank you!
chad
Expert
Posts: 555
Joined: Sun Sep 28, 2014 12:54 am
Location: New York, USA
Contact:

Re: Meaning of Motor Speed and Gyro Values

Post 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.
Crazyflier - my CF journal...
4x Crazyflie Nano (1.0) 10-DOF + NeoPixel Ring mod.
3x Crazyflie 2.0 + Qi Charger and LED Decks.
Raspberry Pi Ground Control.
Mac OS X Dev Environment.
Walkera Devo7e, ESky ET6I, PS3 and iOS Controllers.
molatokarlo
Beginner
Posts: 6
Joined: Fri Jan 22, 2016 4:49 am

Re: Meaning of Motor Speed and Gyro Values

Post 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.
Post Reply