The integration happens inside Arduino.I preferred not to do hardware integration because I hoped that software could give me more flexibility.

I chose the fastest sampling time I could, which is 4 ms (--> 250 Hz).I first used the rectangle method for integration but now I've preferred the trapezoid method to minimize the error: what I've found out is that most of the error comes from (1) the sensor and (2) ADC approximation.

Anyone going to replicate this robot should use an angle sensor (maybe I2C based) instead of a gyroscope; integration is bringing avoidable error.

Hi,great job. I'm new to Arduino and I've got to this from Lego NXT. I think Arduino is much more powerful and flexible than NXT, but I love Lego technich to build, and I already have a good assortment of parts. So I was looking for the way to use Lego elements (motors, sensors...) with Arduino. Your work looks great. I'll try it.By the way, do you have the schematics of the Power Funcitions motors? Have you connected them to Arduino?Thanks.