This is my first post here and I'd like to start by saying BIG thanks to @Rongzhong Li for all the work he has done and his readiness to share the source code.
I 3d-printed OpenCat Nybble published on Thingiverse and assembled it. It works as expected with IR remote when MPU6050 is disabled. As soon as I enable it, cat starts doing a lot of extra moves that appear to be random.
I purchased MPU6050 in local electronics store and initially had some issues with it. I2C scanner finds it at correct address but getDeviceID reads incorrect code. I also had problems with calibration. Numbers 123456 would never appear. Then I tried all different things and after adding some random code into getDeviceID, like writeByte into readonly register, it started to work by some reason. So I have big suspicion that MPU6050 is partially faulty, but before replacing it I'd like to know what should be the difference in cat behavior with and without accelerometer. Right now it is turned off and I'd like to understand whether I even need it or not.
I defined the Y to be parallel to the spine and z in the vertical direction. You can change the directions by flipping the sign of readings in the code.
Ah, that's my problem. I have X along the spine. Thanks a lot!!!
I have an update and 2 followup questions. I replaced MPU6050 and now getDeviceID reads correct value, however I am still observing random moves.
I suspect my MPU is installed in wrong orientation. I just found this image of the chip and wonder which axis - X or Y should be parallel to the spine? And also, should positive direction point towards the head or towards the tail?
Thanks for quick reply! I've ordered new MPU6050 and will give it a try.
I started from this version https://www.thingiverse.com/thing:4015171 but made number of changes to it. See description of my make here https://www.thingiverse.com/make:870867
The MPU detects the body orientation for calculating the adaptive offsets on each joints. When it's turned off, the cat will run faster.
Previously I've bought some faulty units. You may test its functionality by running some test codes, like the testMPU in my muduleTest folder, or other generic codes on GitHub. It should read close to zero in angles and accelerations except for the yaw and z direction. It should also change values with any movements.
BTW, do you have the link to that Thingiverse version? Occasionally people ask questions about it but it was not maintained by us.