The next step was to start writing the software.
For that I studied tons of similar projects and had to refresh my coding competence.
I had also to update all the software used to write, compile, simulate, etc., and practically had to learn again to use embedded microprocessors.
The result was a long piece of software, coded in C for a 16F877 microprocesor from the PIC family (they are obsolete, but I had a couple in an old drawer...).
I disregarded the Kalman Filter in favor of Complementary Filters to fusion the accelerators and gyroscopes data, to get the actual tilting angles, free from noise (kind of).
Then a PID (Proportional, Integral, Derivative) algorithm produce the PWM (Pulse Width Modulation) signals to be sent to the motor drivers.
When the software was ready enough I bought a 5 degree of freedom (3 accelerometers + 2 gyros) IMU (Inertial Measurement unit) and mounted it together with the microprocessor on a crappy brown perf board, as can be seen in the videos:
Yes, it is true that in the last video it shows a delayed response, but that is due to the lack of adjustment of the software's constants and is already fixed.
No comments:
Post a Comment