Thursday, June 12, 2008

pic pwm

Recently I helped a high school sophomore work on a school project. His project was to make a glove that can control a robotic arm. We figured that using a potentiometer and a pic microcontroller would do the trick. However, at that point I didn't know how to use pwm nor the analog to digital converter.

After a few weekends and all-nighters I was finally able to figure out how to put everything together, but unfortunately, in the end, all I got to work was the wrist and the gripper.

One problem that I ran into was the ADC. The microcontroller I used has one byte registers, but the ADC had a 10-bit resolution. I overcame this problem by making sure that the voltage drop on the potentiometer never exceeded a fourth of the reference voltage. I did this by putting a resistor with resistance triple that of the maximum of the potentiometer in series with it.

The other problem that I ran into was the programming. Since I am not so advanced in programming in assembly, I had to use brute force to make the pwm to work. This was the reason why I couldn't operate more than two servos. However, now I know that I can use interrupts to make it work much easier.

Although the deadline has already passed, I will continue to work on this.

Videos of various tests: servo test, gripper test, wrist test.