IMG_0628.JPG (1801090Bytes)
IMG_0636.JPG (2577634Bytes)
IMG_0636.JPG (2577634Bytes)
IMG_0632.JPG (2337558Bytes)
Hi everyone!
For the past few days I have been working on a "smart" servo. Basically, I want the precision of a standard servo combined with continuous rotation and low costs.
The plan is: Put two brightness sensors on one of the inner gears and use them as a quadrature encoder to calculate the angle. This value is then sent to an arduino or directly used to reach a set position.
What I have done so far:
I decided to use a HK15138 Servo from Hobbyking because they are about the cheapest servos you can find at this size.
Converting it to continuous rotation was easy, after that I drilled a hole in the servo case and glued two QTR-1RC line sensors (http://www.pololu.com/product/2459) in it.
Programming was a bit more difficult, I ended up using an arduino Nano as a prototype but the goal is to have the sketch running on an Attiny85 inside the servo.
I have two questions:
How can I use pin change interrupts on the attiny? Interrupts are necessary to check the encoder and I honestly have no idea how to do that on a non-Arduino.
What is the most efficient and simple way to send data from the Attiny to another microcontroller? The servo should be able to send the angle (about 11 bits).
Somehow I cannot embed a video so here is the link:
https://www.youtube.com/watch?v=z9YZjmV9NNE