Making A Quad Rotor Drone With WiCard

Discussion in 'The Projects Forum' started by MA321, Aug 9, 2018.

  1. MA321

    Thread Starter New Member

    Feb 2, 2018
    14
    7
    Hello,

    I'm going to make a quad rotor drone. I'm going to use the WiFi module that I designed (WiCard) as its ESC.

    [​IMG]

    The first step is "gyroscope". I have an MPU-6050 module which I can get the acceleration and angular rate via I2C.

    The question is How can I keep my drone at its place in the air??
     
    Last edited: Sep 6, 2018
  2. Reloadron

    Distinguished Member

    Jan 15, 2015
    3,456
    1,536
    I would think incorporating an auto pilot scheme which uses GPS would hold a drone in a pretty tight little box in the sky. This video was pretty cool.

    Ron
     
    MA321 likes this.
  3. MA321

    Thread Starter New Member

    Feb 2, 2018
    14
    7
    Yes, that's so cool, but I want to make a basic drone with my own designed "WiCard" (I have written an article about WiCard and published it on my website, please take a look at this link: https://wicard.net/wicard-programmable-wifi-module/ ).

    In fact I'm going to upgrade my module features by using it as a drone's ESC.

    I want to know how can I balance the quad-rotor in the air with angular rate, because my gyroscope doesn't give me the angle, only gives the angular rate and acceleration.
     
    Last edited: Sep 6, 2018
  4. Reloadron

    Distinguished Member

    Jan 15, 2015
    3,456
    1,536
    Wow, that is really cool. While I really don't know how you can balance the quad rotor there has got to be a way to go about this. Thanks for sharing the link to your card, again, really a neat card.

    Ron
     
    MA321 likes this.
  5. MA321

    Thread Starter New Member

    Feb 2, 2018
    14
    7
    You're welcome and whenever I could do it, I will post here how I could balance the drone in the air.
     
  6. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    8,634
    1,970
    If it's a 3-axis gyro, then when the drone is level (if that's what you mean by the quad-rotor being 'balanced') you should have only a z-axis acceleration measurement. The other measurements shhould be zero.
     
    -live wire- and MA321 like this.
  7. ericgibbs

    Moderator

    Jan 29, 2010
    5,499
    1,026
    hi,
    If I follow the TS's requirement, the problem would be 'alec' that the drone could be tilted at say 45deg and as its a rate accelerometer output would still be zero
    E
     
    MA321 likes this.
  8. MA321

    Thread Starter New Member

    Feb 2, 2018
    14
    7
    Yes, It's a 3-axis gyro and I meant the drone spins and flips.
     
  9. MA321

    Thread Starter New Member

    Feb 2, 2018
    14
    7
    Yes, I think so.
     
  10. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    8,634
    1,970
    Perhaps I'm misinterpreting the way that module works (I've never used one). It combines a gyro and a 3-axis accelerometer. As I understand it, when the accelerometer is tilted, but stationary, Earth's gravity (1g acceleration) will have a resolved non-zero component along the x-axis and/or the y-axis and so would give non-zero outputs in the x and y channels. These raw outputs should enable the tilt angle to be calculated, if the module itself is not accelerating relative to Earth.
     
    MA321 likes this.
  11. ericgibbs

    Moderator

    Jan 29, 2010
    5,499
    1,026
    hi alec,
    This is the version I have on the bench. ADXL335
    E
    Ref page #10.
     
    MA321 likes this.
  12. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    8,634
    1,970
    Hi Eric,
    Yours can clearly measure tilt, so presumably the TS's one can too.
     
    MA321 likes this.
  13. ericgibbs

    Moderator

    Jan 29, 2010
    5,499
    1,026
    hi alec,
    Last time I played with it, I only got a meaningful signal out when its was moving.
    I will reconnect it up tomorrow and have another try, let you know what I find.
    Eric
     
    MA321 likes this.
  14. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    8,634
    1,970
    I'd be interested to know the result, Eric. Page 1 of the datasheet in your link says "It can measure the static acceleration of gravity in tilt-sensing applications, as well as dynamic acceleration resulting from motion, shock, or vibration."
    Chips similar to this must be used in the numerous bubble-level apps for phones and tablets.
     
    MA321 likes this.
  15. Reloadron

    Distinguished Member

    Jan 15, 2015
    3,456
    1,536
    A few years ago I did some experimenting with an ADXL 326 which is a +/- 16G accelerometer as compared to the ADXL 335 which is the +/- 3G flavor. I used it with an Arduino and found a good calibration routine here. The problem with the ADXL 326 was that being a 16G unit the sensitivity was only 57 mV/G but the ADXL 335 being a 3G unit has a sensitivity of 300 mV/G. The ADXL 335 is likely much better suited for detecting level. When tilted it does output the gravitational pull of 1.0G. The link worked well for me and should work much better with the ADXL 335. It did not have to be moving to maintain an output.

    Each channel outputs approximately right about 1.5 Volts for 0 G. Each axis is about ±3.6G. Using the basic calibration method in the link and tilting 90 degrees should yield about a 300 mV shift in the outputs. Just about 1.2 volts to 1.8 volts. Using reasonably close rotation calibration curves can be done for all 3 axis.I look forward to what Eric finds.

    Ron
     
    MA321 and ericgibbs like this.
  16. ericgibbs

    Moderator

    Jan 29, 2010
    5,499
    1,026
    hi Ron,
    Downloaded your link, will give it a run with my ADXL335.

    Many thanks.
    Eric

    @Alec_t
    This is the d/s for the TS's Acc module, will check if ' g static' output option is a feature.

    EDIT:
    Using a magnifier to read the print on the IC mounted on the PCB, its a 6050 not a ADXL .!!
    I bought them online in the belief that they were ADXL, should have known better and checked the type number, duh. Explains why I did not get the results I expected..... 'expletive'
     
    Last edited: Aug 12, 2018
    MA321 likes this.
  17. Reloadron

    Distinguished Member

    Jan 15, 2015
    3,456
    1,536
    Two of my new best friends are a magnifying glass which always lays on the bench along with supplemental lighting.

    I did find the ADXL 326 I had squirreled away which is the +/- 16G version or actually between 16G to 19G. The output should be about 51mV to 63mV per G. This is why it is wise to calibrate these things so the user has a good idea of what they have since chip to chip they can vary quite a bit.

    Laying pretty flat on my very uncalibrated table my Z Axis read 1.725 V. Rotating the chip (inverting it) I got 1.601 V and at the 90 degree point 1.665 Volts. Just about right or what I expected. My Y Axis was 1.647 laying flat and with 90 degree rotation either way went from 1.503 V to 1.601 V again pretty close to the expected values and X Axis laying flat and with 90 degree rotation either way went from 1.582 V to 1.705 V. again what would be expected.

    When rotated the voltages were a stable constant so unlike a piezo accelerometer which outputs a bang and returns to zero these little guys output a stable level while moving or not. I believe the ADXL 326, ADXL 335 and the ADXL 377 will all behave the same. I believe the ADXL 335 would be my choice for sensitivity since it is a +/- 3 G chip with an output of about 300 mV/G which should give much better resolution for measuring tilt.

    Ron
     
    MA321 and ericgibbs like this.
  18. ericgibbs

    Moderator

    Jan 29, 2010
    5,499
    1,026
    MA321 likes this.
  19. Reloadron

    Distinguished Member

    Jan 15, 2015
    3,456
    1,536
    That is pretty slick with serial communication. The Amazon page calls out ADXL 335 but the card says ADXL 345 which has the serial out. Additionally the ADXL 345 gets down to a +/- 2 G range. My wife lives by Amazon. Matter of fact even the dog food arrives Amazon around here. I may have to have her add one of those to the next Amazon order. I snooped and found plenty of code for using one with an Arduino including a library.

    They keep coming out with cool new stuff and since I retired I am really not where I once was following the tech curve. :)

    Ron
     
    MA321 likes this.
  20. MA321

    Thread Starter New Member

    Feb 2, 2018
    14
    7
    Hello!

    Sorry for my late replay, I was working on adding I2C feature to my module.

    So we have the same Gyroscope which its data transaction line is I2C.


    Anyway, I connected my MPU-6050 Gyroscope to my module and here's the result:

    [​IMG]

    These are signed values in unsigned variables, that means 65535 is equal with -1
    The X acceleration is 1032 while the module is static and I placed it on a breadboard.
    The Y acceleration is equal with -376. I think every value between 1200 and -1200 should be considered as zero. Also it depends on MPU6050 configuration.
    The Z acceleration is 16372. I believe in it is equal with 1g and it is the Earth's gravity acceleration.

    The X angular speed is -81,
    The X angular speed is 90,
    The X angular speed is -52 and all of the angular rates between 100 and -100 should be considered zero.

    Then I rotated my breadboard 90 degree around of the Y axis and here's the result:

    [​IMG]

    Now, X Acceleration is 16568, Y is almost zero and Z is 2228 (because the bread board angle is not exactly 90 degree).

    So I can use MPU-6050 as a real gyroscope for my drone. The next step is programming the motors of my quad-rotor :)
     
Loading...