Team Bohemian Raspbian:
Sprint 1 Test
The video above shows a short test of the first sprint. Not much is different than the demonstration that was shown at the end of the sprint. There is considerable less jitter with the system. On the demo day the power supply and the RPi did not share a common ground which contributed to the violent jitter that was seen. However fixing that issue there was still movement that was not meant to be there. Holding steady did not stop the servos for very long.
To understand this issue we observed what was being sent on the data line through an oscilloscope. We found that despite the camera being covered and no new position being sent to to the servos, the scope showed a change of pulse width every now and then. This it seems is the issue of the jitter. we also noted that the current being drawn by the servo motors was much greater than we thought it would be (which could explain why the initial test of the servos drained the power from the RPi). This could indicate a fault with the servo itself. however working under the assumption that this issue is not to do with the servo's, as other teams have found this jitter also, the following are a few suggestions as to how to combat this issue:
Servo Code Redesign:
The most unlikely candidate at this point is the code. This is based on an observation that we made while testing. Embedded in the thread coding is a debug state that allows us to view what is being sent. If new positions are sent to the servo motors then a condition is set that turns on the sound thread. while the camera is covered this condition remains in its default state of false meaning no new position is set. With that being said, all options are open and redesigning the code could reduce the workload on the Pi.
Relieving Stress on RPi Method 1
Our main issue at the moment is that despite the RPi 2 having a quad core processor it is being taxed to upwards of 60% of its available usage and a lot of its ram as well. This over usage of the Pi could lead to a delay in it's protocols, leading to a pulse not being sent at the right time or being stuck on for a longer period than it should be. Both of these scenarios would alter which position the servo is at as it needs a constant pulse width for its position to be held. From listing to Michaels conversation on the Adafruit Servo Hat we would be inclined to agree that this addition would improve the performance of the servos. The reason for this is that the servo controller has its own dedicated power supply and takes in values that it then converts to a PWM signal for the various servo motors. This board is specifically designed to work with servo motors and would not require processor time to output a specific pulse width and can maintain a constant output provided the values are not reset.
Relieving Stress on RPi Method 2
The second method brings another RPi into the equation. By networking RPi's together, either through Ethernet or SPI the biggest drain on the processor, the OpenCV application, can be run separately to the servos. This would prevent a system halt or bottleneck that contributes to the jitter seen in the demonstrations.
Although both method 1 & 2 are viable options to combat the issue of delayed or rouge signals being sent, the real solution could be held in the combination of both these options. Two RPi's working together with the servo hat is still a slim design that can be embedded in the base of a Lamp. This brings portability as well as reliability of the Lampbotics system and reduces its need for a laptop to run the OpenCV application allowing it to track a face. It also mean that should we require more than two motors, which seems likly, all we need do is add it to one of 16 ports of the servo hat. The added advantage of having the RPi is that it can control LED's that can be used within the face which alleviates the need for external circuitry. Having two boards could potentially mean that greater control of these LED's could be had as more can be added across both boards.
Team Bohemian Raspbian. 2nd Blog Entry