/var/www/restricted/ssh/stm32/www/stm32circle/ STM CircleOS forum / MEMS noise

Username:     
Password:     
             

Forum

# 1   2009-01-07 15:22:46 MEMS noise

w0utje
New member
Registered: 2008-07-09
Posts: 6

MEMS noise

I just get on with my primer1, and I see that the data is very noisy... I send the MEMS data via USB @ Hyperterminal..
what can I do about it?

regards w0utje

Offline

 

# 2   2009-01-07 15:54:25 MEMS noise

w0utje
New member
Registered: 2008-07-09
Posts: 6

Re: MEMS noise

Oh I just fixed the problem already.
Just looking at the CircleOS code with the datasheet of the MEMS sensor.
Why setting the data rate at 2560 Hz?  40 Hz will be just fine.
so just change the setting in mems.c to 40 Hz and voila..

find the next lines in Mems.c of circleOS

   /* SET P0:P1 to '11' */
   /* 0xC0 to wake up and 0x30 for full speed frequency (640 Hz). */  <-- this is 2560 Hz btw
   reg_val = reg_val | 0xC0 | 0x30;
 
  change it to:
  reg_val = 0xC7;   /* data rate 40 Hz X,Y,Z Enabled */

Make your application with the new build fat.elf and circle.elf
...now you have got very stable data wink

you can add MEMS_SetNeutral(); to that code to perfectly set your offset.
then you'll have at normal position 0,0,0 as data.

At the startup of CircleOS, after poweroff your neutral position will be set.


Regards w0utje

Offline

 

# 3   2009-01-08 09:14:58 MEMS noise

w0utje
New member
Registered: 2008-07-09
Posts: 6

Re: MEMS noise

I'm sorry, SetNeutral will not work because it modifies the returning data of the function getposition().
I thought it was setting the offset in the registry of the MEMS sensor.

Offline

 

Board footer