Monday, November 29, 2010

...and get over it!

Today's exercise (well, yesterday evening's anyhow) was mounting the L6203 MOSFET H-bridge chip onto a breadboard friendly form.


Why is the chip mounted on the copper side, at some odd angle? As w0z says, "hardware will cut you"... and of course I didn't check the chip's lead spacing - the chip's pins are not on a 0.1" spacing - so it doesn't "fit" in the veroboard. Turns out that at 45 degrees, the pins line up with the veroboard strips. Not the holes, but at least the strips. Woot!

So this board has all the components required to get the H-bridge to work. There's a 0.22 ohm resistor for sensing the motor current. This will go back to the PIC for monitoring.
The pins on the bottom are GND, Enable, In1, In2, Motor-, Motor+, Vsupply and Vsense. This will now plug straight into the breadboard for wiring up to the rest of the circuit.

And it works. Next, some programming required...

Thursday, November 25, 2010

Forward... AND reverse

Uni results are published tomorrow - looking forward to that, actually. It's going to be good news, just a question of how good. Hoping to totally ace the electronics subject. I'll be kicking myself if I don't get 100% in the exam!

On the CNC front, I think I've got it worked out in my mind how to put the aluminium frame together. I've purchased some 608 bearings ( it turned out that these are the same size as used in skateboards, so they're pretty cheap ). They have an 8mm ID, and 22mm OD - so they will fit nicely on the face of the frame (25.4mm). The 8mm threaded rod that I'm using for the leadscrew will rotate in the bearing, being driven by the motor.

On the topic of motors, I'm shying away from the stepper motor approach. There's a nice geared motor with encoder available that I think should give more torque, faster rotation and less vibration than a stepper. The question is, can a motor be controlled well enough to "step" a few encoder positions at a time? Time to experiment....

What to do with old mice...
Yes, that's an old "ball"-style mouse in the lower right, cut away with an ordinary DC motor from a printer attached to the optical encoder shaft. There's a 16F88 PIC microcontroller in the centre of the breadboard. Some logic gates on the right to decode the quadrature pulses from the mouse. Note the mouse has had it's brain punched out (ie, the chip removed) - the only electronics I'm using in there is the LED and phototransistors that make up the rotary encoder. Those are my NextGen business cards in a stack under the mouse to bring it up level with the motor shaft. I knew they would become useful eventually.

With this setup, I did some basic PWM experiments in controlling the motor. Reasonably successful. There's no full H-bridge here, just a single BD682 bipolar transistor driving the motor.... so it's forward only.

Convinced that this is the way to go, I ordered some parts from Futurlec.com.au. A PIC development board with a 16F628A, a L6203 mosfet H bridge, and a few other sundries. It's effectively the setup described in Microchip's servo application note AN696. Oooh, just found another - AN532. Both useful info on concrete implementations of a PID control loop. The gear finally arrived today (ordered 1st Nov). Futurlec are cheap, but you gotta have some patience. Probably better that they didn't arrive until after the semester was over anyway.
PIC16F628A development board and L6203 H-bridge