Humanoid Robot servo control.


I have been trying for a while to build a humanoid robot. Since I bought a 3D printer I have been slowly making more progress. Currently it has 18 servos and I managed to control 16 of them using a Tlc5940.
tlc5940 pdf.

The TLC5940 uses 4 of the PWM pins on the Nano that I use as the controller (picked it for the small size). This means that I have the PWM pins 5 and 6 (Timer 0 i think ) still available to control the last two servos.

I know that I cannot use the library for the TLC5940 and the Servo one together. So basically I need to set the Timer for these pins myself and drive the servo from there. I have so little knowledge regarding Timers.

Do anybody have code to point me on the right direction ?

See Figure 12. You can cascade another Tlc5940 to add another 16 outputs.

I thought about doing a cascaded TLC5940, but it seems such a waste as I only need two more servos to be controlled. Space and weight is a bit of an issue too.

I am looking at some clever code to control servos using the timer interrupts. I understand that the millis() function needs this timer to work, but i will find another way to keep track of time passed.

Upper body video