Showing posts with label PWM with ADC. Show all posts
Showing posts with label PWM with ADC. Show all posts

Monday, December 22, 2008

Re-remake

After confirming that the pic servo device worked properly I uploaded the design to Batchpcb.com and had circuit boards printed. However, on the board there were no traces. The board was pretty much garbage; they were useless.

Recently I relearned how to design circuit boards from schematics and redid the whole thing. Here is the new layout for the board.


A good tutorial for designing board layouts from circuit schematics can be found on Sparkfun.com which can also be accessed through Batchpcb.comHopefully this version of the circuit board will turn out much better than the previous one.

If it comes out successfully I may make this into a kit which will be available to anyone who is interested in learning about PWM (pulse width modulation) and ADC (analog to digital conversion) in pic microcontrollers.

Saturday, June 28, 2008

More Success on the pic pwm!

I finally figured out how to decrease the amount of jitter in the servo produced by the flickering of values coming from the Analog to Digital Converter!

The pic microcontroller I use has a 10bit ADC resolution. Until now I thought this was the most annoying thing ever, since most of the instructions are byte (8bit) operations. They gave you the option of having the output of the ADC Left Justified or Right Justified, so there was always this pair of bits that was lost.
I just realized recently that if I ignore the two lower most bits, and I force the ADC output to be 8bits, I can get the flickering of the ADC values to not affect the pwm signals. This way I can clean up the movement of the servos, and not have to add resistors as I previously did.

Thursday, June 26, 2008

Remake

With the help of a fellow hobbyist in Europe, I was able to remake a better servo board that actually works. Visit his website at http://max8888.orconhosting.net.nz/projects.htm.

Saturday, June 21, 2008

Failure




This is the circuit board I printed to operate the robotic arm. I don't know what happened, but it failed miserably.

Friday, June 20, 2008

Timer1

With the help of my mentor, I was finally able to figure out how to use the Timer1 module in the microcontroller.

Now that I know how to use it, I will be able to operate multiple servos easily.

Here is the code: tmr1.asm

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.