Sunday, October 23, 2005

LABS for week 5 and 6

DC motor control

After searching in vain for the Texas Instruments h bridge, I decided to just use a single transistor (TIP 120) and forgo the reversible motor control. With a single transistor, it should be possible to control the speed of the DC motor through pulse width modulation. This is something that I found was easier said than done.

It’s a little tricky building the circuit for the DC motor control. The circuit includes a TIP 120, a diode and the DC motor. The difficulty comes from the fact that the DC motor requires more power (12v) than the logic level power (5v) we normally use on our breadboards.

I hope to control my DC motor speed with the potentiometer delivering analog data to the PIC. The PIC would then convert it to digital data outputting it to the TIP 120 as a pulse width. I managed to do this however I was unable to adjust the range of the pulse width so I never had the motor speed fine-tuned.

Serial Out

This was an especially satisfying lab as it finally dawned on me how we are going to combine what we are learning in Physical Computing with what we are learning in ICM. Having no programming background, both classes have been extremely daunting and I have struggled mightily to grasp the minutiae of how code is written. It’s like a whole new language!

After struggling for an entire weekend over how to get my serial data out to PC and into Processing, I finally took the advice of my fellow students late Sunday night and simply copied and pasted from one of the examples. Seems rather pathetic, but I did celebrate being able to successfully copy and paste, at that point being so completely frazzled I was ready to throw my laptop out the window.

Once the example was up and running, it was easy for me to combine my processing code with the example’s serial IN portion. On the PIC side, I had to change a few little things and adjust the range of the variables that were output and I was good to go. It was very exciting to be able to control the actions in Processing by turning a potentiometer or by covering up a photocell.