MPU6050 w/PSOC4 - Implementing a Filter

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

I have used two references on this site to get my MPU6050 up and running. 

   

samselectronicsprojects.blogspot.com/search/label/PSoC

   

and here:

   

www.cypress.com/

   

Because I need data at approx. 500Hz (the DMP of the MPU6050 is limited to 200Hz) I am attempting to implement a quaternion filter (Madgwick) - found here.

   

www.x-io.co.uk/open-source-imu-and-ahrs-algorithms/

   

The unfiltered data is coming through fine; however, my implementation of the filter is not working correctly as I'm getting 0s even after moving the MPU6050.  Any help on this is greatly appreciated.

   

(Note: The attached project was created w/ the PSOC4-Pioneer Kit - BLE version - easily changed by selecting a different device)

0 Likes
15 Replies
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Project not attached, try again or use dropbox and post a link.

   

 

   

Regards, Dana.

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable
        Thank you. Trying again....   
0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable
        I was able to get everything running w/ a Madgwick filter and just wanted to post the working code for others who may be interested. It is for the PSoC4 BLE version.   
0 Likes
ToVa_285016
Level 5
Level 5
100 replies posted 50 replies posted 50 questions asked

 Interesting project, thank you for the link.  Can I ask what it is for?  I would like to try something like this out on a quad copter.  Perhaps this summer...

   

Tom

0 Likes
lock attach
Attachments are accessible only for community members.
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Just another copter project

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Hi Bob,

   

Did you use the MPU6050 in this case?

0 Likes

No, Michael,

   

I used this breakout board connected via I2C.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Without going into too much detail, it's actually something in the wearable arena.  However, my son & I are looking for a project this summer and may look at a copter project.

0 Likes
Anonymous
Not applicable

Hi

   

 

   

I have downloaded MPU6050 DKW PSOC RevisedV2.cywrk.Archive01  and working on it , the problem is that

   

without changing the or rotating the sensor I am getting values that are keep changes even at standstill

   

regards

   

Habib

0 Likes
Anonymous
Not applicable

I'm getting very minor fluctuatons - less than .1 degree on roll and pitch. Yaw drift comes with the territory. See here for more... github.com/kriswiner/MPU-6050. Be sure to hit reset when the MPU is flat and stable.

   

My MPU 6050 board is "home-wired" and I just followed the datasheet on the circuitry. If you are getting more fluctuation than the above, I would think it would be a hardware issue.

   

Thanks

   

D.K.

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hi thank for replying

   

one thing i wanted to know about DMP ,how to enble it?  to get  good values from the sensor

   

i am using  mpu6050 sensor modue which is available in market ,you can see the images attached

   

what are the other things i need to check at my end

   

 

   

regards

   

Habib

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

There is a lib here you could port -

   

 

   

    

   

          http://www.geekmomprojects.com/mpu-6050-dmp-data-from-i2cdevlib/

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

Hi Dana

   

 

   

That lib for aurdino board , not for PSOC  right ?

   

regards

   

Habib

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Yes, you would have to port it.

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

Habib -

   

I can't think of why you are getting different results from me other than hardware. I think there are several other examples from others on Github and elsewhere using the MPU board you referenced. It could be a bad board or something in the conversion if you are not using a Pioneer 4 BLE Kit. Really at a loss on the reason. Sorry I can't be of more help.

   

On the DMP, I'm only aware of the Arduino code, and code provided by InvenSense - but it is only for the MSP430. InvenSense has announced a product that will solve these issues www.invensense.com/products/icm-30630-2/ but not sure of the timing.

   

Thanks

   

D.K.

0 Likes