You wait ages for a bus and then 3 come along at once.
The context is drift control / motion detection where integrated accelerometer readings simply don’t seem to be having anything but a negative effect – they drift too far after a few seconds even with the trend-line calibration allowing for 3 axis gains / offset across temperature.
- Use different frequency feeds for the PID updates: 25Hz for the motion / drift PIDs and 76Hz for the inner attitude related PIDs (absolute angles and stability). This will give the motion PID more cycles to integrate out noise before feeding to the inner PIDs as a new target meaning potential increased accuracy and hence stability in the drift protection – cheers Phil for showing me the research project details
- Off the shelf optical tracking solution using optical mouse technology as mentioned before. See here and here
- A pure Raspberry Pi solution using a ground facing RaspiCam plus RPi / RaspiCam solution using the Coarse Motion Estimation which comes out of the GPU H.264 encoder – thanks dmichel76 and jamesh from the RPi forums.
All looking very interesting, especially the first as a short term solution while I push to develop option 3 (2 is expensive, and goes against my ethos of keeping as much as possible RaspberryPi hardware and software)
On a different note actually releated to busses, I actually have increased the I2C bus frequency from 100kbps (the default for a Raspberry Pi) to 400kbps the maximum the MPU6050 supports) as part of investigating whether faster updates from the MPU6050 results in higher quality integrations for vertical and horizontal PID feedback. The jury is out at the moment – no chance to fly because of the weather – but here’s how it’s done.
Open you favourite editor to create a new file named i2c_bcm2708 in /etc/modprobe.d/. Add the following single line to it, save, and reboot:
options i2c_bcm2708 baudrate=400000
You can change it without a reboot, but it is lost post reboot without the above change:
modprobe -r i2c_bcm2708
modprobe i2c_bcm2708 baudrate=400000