2012-11-02 09:05 AM
Didn't find a better location to post, so excuse the perhaps slightly off topic question.
I am using a LSM303 (accelerometer/magnetometer) for detection of pitch/roll/attitude angles which then go through a PID controller to set the pulse width of a PWM controller to set the speed of a brushless motor. The software side seems to work quite well and I am getting good data (over I2C) when I disconnect the motors (3.7V, 1A each). When I connect them, I get very noisy data on the lines. I initially thought that spikes from the motors are causing this and implemented schottky diodes across the MOSFETs as well as capacitors to adequately dampen the response (the spikes measured at the motor leads now come in at about 4.5V peak). I checked all lines and there is very little noise (0.1Vpp on the battery, <10mV on digital lines). All digital components have bypass capacitors and the line is regulated with a LDO regulator (after going through a LC filter). I also checked the data on the I2C bus and everything looks good (using 1k pullups). I tired different update rates, both 100 & 400k bus speeds, high/low resolution, polling only one axis at a time and different ranges, but I still get this strange data:2012-11-12 07:18 AM
Maybe you cantry posting your request into the iNEMO/MEMS post.
https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32F%20MEMS%20%20iNEMO/AllItems.aspx
Best REgards, Billino