enqz Posted February 6, 2017 Report Share Posted February 6, 2017 Hi all, I'm trying to use the mpu6050 as a shock sensor (ie if a shock is > 2g's log the force and timestamp it). Here's the twist, I managed to get the MOT_INT working, but I eventhough i see changes in force required ro triggger an interrupt ( setting MOT_THR byte) I can't map it reliably to an actual G value. Each accelerometer output is on 16bits (signed) but the threshold is set on 8bits (signed) (which means you can only set the interrupt as 1/128th of the actual resolution ?). Also, once the interrupt is triggered, how am I supposed to find the "triggering value" in the fifo stack ? If you have any idea, please share Quote Link to comment Share on other sites More sharing options...
dylanetaft Posted February 24, 2017 Report Share Posted February 24, 2017 initialize() sets the accelerometer range to +-2g In that case, you're looking at +-16384 for 2g. You might need to use setFullScaleAccelRange to raise the sensitivity to +-4g I'm not aware of any force-sensitive interrupt, are you? There's a few things that can trigger an interrupt, FIFO overflow, i2c interrupt, data ready. That said, you might just want to analyze values over time. The DMP outputs at 100hz if enabled. Otherwise the device is adjustible via a divider setting and lowpass filter setting. The DMP is kind of nice. You'll get 10ms between samples. So if you find one sample has a high g force, and the LSB difference between that and the next is >=2g, that's a shock, I think. Quote Link to comment Share on other sites More sharing options...
dylanetaft Posted February 24, 2017 Report Share Posted February 24, 2017 Argh, it's a register not in the register map documentation, but it's in I2Cdevlib. Quote Link to comment Share on other sites More sharing options...
dylanetaft Posted February 24, 2017 Report Share Posted February 24, 2017 https://www.invensense.com/wp-content/uploads/2015/02/MPU-6500-Register-Map2.pdf There we go, buried elsewhere on their site. Register 31. Not sure what mg is. mass * gravity maybe? 4 = m*1gforce I guess. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.