angelx

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #7394
    ad van der ende
    Participant

    A observation on GRYX/Y/Z angle numbers is that they accumulate over time. They never gave me a different number when moving the raspberry with the BerryIMU on the pins.

    The ACCX and ACCY do give other readings when moving the pi.

    Also the CFangleX and CFangleY give different readings when moving.

    Using the gyro readings on my Iphone I do  get different readings on X,Y,Z when moving the iphone.

    What is wrong with my assumption that I expect change in readings on x,y,z with BerryIMU?

     

    Attached my berryIMUsimple.py

     

     

    ACCX Angle 179.75 ACCY Angle -175.49     GRYX Angle -668.20  GYRY Angle 743.21  GYRZ Angle -471.04     CFangleX Angle 179.37   CFangleY Angle -175.10  HEADING  105.00  tiltCompensatedHeading 100.25

    #7395
    ad van der ende
    Participant

    attached py as txt

    Attachments:
    #7397
    Mark Williams
    Keymaster

    can you please attached the first 200 lines of the program output.  From this output i will be able to get more information

    Please have the IMU laying flat and not moving.

    Mark --OzzMaker.com --

    #7410
    ad van der ende
    Participant

    the first 200 lines of output

    Attachments:
    #7414
    PeterP
    Participant

    They gyro readings look good.

    The accelerometer readings don’t look good.

    Are you running this on a Raspberry Pi? Has the code been modified in anyway?
    Is it up the correct way? this is when the skull logo is facing down.

    We need to have a look at the raw values for the accelerometer;
    Just after this section of code;

     ACCx = IMU.readACCx()
    ACCy = IMU.readACCy()
    ACCz = IMU.readACCz()
    GYRx = IMU.readGYRx()
    GYRy = IMU.readGYRy()
    GYRz = IMU.readGYRz()
    MAGx = IMU.readMAGx()
    MAGy = IMU.readMAGy()
    MAGz = IMU.readMAGz()

    can you add an extra line as shown below;`
    ACCx = IMU.readACCx()
    ACCy = IMU.readACCy()
    ACCz = IMU.readACCz()
    GYRx = IMU.readGYRx()
    GYRy = IMU.readGYRy()
    GYRz = IMU.readGYRz()
    MAGx = IMU.readMAGx()
    MAGy = IMU.readMAGy()
    MAGz = IMU.readMAGz()
    print (“accXYZ %i %i %i “) % (ACCx,ACCy,ACCz),`

    Peter --OzzMaker.com --

    #7415
    ad van der ende
    Participant

    the requested additional print

     

    Attachments:
    #7417
    ad van der ende
    Participant

    skull is not upside down.

    Attachments:
    #7419
    PeterP
    Participant

    You need to make some modifications to the code. Have a look at berryimu.py in the same folder, it has comments within on what needs to be done.

    Peter --OzzMaker.com --

    #7420
    ad van der ende
    Participant

    Peter,

    “some modifications” is a bit too fage.

    Do I need to make all the suggested modifications bcz of the skull upside down issue?

    “what is meant by upside down? : skull is not visible at all or it is not facing the same as on your assembly pages/instructions?

    Bcz the latter is the case with mine BerryIMU.

    Kind regards

    ad

     

     

    #7421
    PeterP
    Participant

    yes.  make all of the changes.

    When the skull logo is underneath and the chips on top, this is the correct orientation.

    When the skull logo is on top and the chips are underneath, this is upside down.

    Peter --OzzMaker.com --

    #7422
    ad van der ende
    Participant

    hi,

    I have made the neccessary changes in the code for upside down.

    Funny that a gyro , which is upside down or not influences the readings?

    So the gyro should not go head over heels?

     

    anyway:

    gyroXangle+=rate_gyr_x*LP
    gyroYangle+=rate_gyr_y*LP
    gyroZangle+=rate_gyr_z*LP

    the “+=” is the reason why the gyroXangle is accumulating!

    is this correct?

    kind regrdas

    adriaan

     

    #7428
    Mark Williams
    Keymaster

    no need to change gyro calcs.

    Regarding the accumulating of the gyro readings.  This is normal, this is due to the noise  from the gyro sensor.  This is why the gyro and accel readings are fused to get a accurate result.

    The values you need to use are CFangleX and CFangleY. CF = complementary filter.

    You can see that the complementary filter doesn’t use the accumulated gyro value, it only uses the rate of rotation since since the last loop.
    rate_gyr_x*LP This is rate of gyro x rotation (degrees per second) since the last reading. multiple this by the loop time.

     #Complementary filter used to combine the accelerometer and gyro values.
    CFangleX=AA*(CFangleX+rate_gyr_x*LP) +(1 - AA) * AccXangle
    CFangleY=AA*(CFangleY+rate_gyr_y*LP) +(1 - AA) * AccYangle

     

    more info here

    https://ozzmaker.com/berryimu/

    Mark --OzzMaker.com --

    #7430
    ad van der ende
    Participant

    Hi Mark,

    The usage for the GYRO readings is to monitor the swing of my caravan/trailer.

    I want the PI in my caravan and send readings via websocket server on the pi ( via wifi)  to my iPhone app ( a websocket client)  in my car.

    The iPhone app will then render the readings into graphs or warning signals when the x or y is too large, meaning the caravan is swinging to much, please break.

    For this I can use the X and Y readings only, right?

     

    Kind regards

    ad

     

     

     

    #7431
    PeterP
    Participant

    yep, use these values

    CFangleX

    CFangleY

    Peter --OzzMaker.com --

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.

Blip, blop, bloop…