3 - Axis Foam Cutting Mill - Part 4
Debugging Controller & Pre-PC Testing

To this point, I've just been going through the motions, copy paste, etch, solder... now we enter the belly of the snake. This is the last chance to step back from the edge and go watch a sitcom...
There are 2 controllers, 6 motors totaling 36 leads to solder to the controller... I thought I'd randomly solder wires and hope for the best... Actually I measured one motor out as;
Green - Yellow (CT) - Black and Blue - White (CT) - Red.
Where CT is the Center Tap... This is a 2 Phase 6 Lead Stepper, and the Allegro can handle it @ 5VDC and 1 Amp.
As much as I want to just tie the controller to the PC and start running it, I made a crucial decision that will save me days of grief. I dig out 1 SPST (Single Pole Single Throw) and 2 Momentary Contact NO (Normally Open), a small 2 Amp 5 & 12VDC Supply and look the board over.
First I found at least 3 dead shorts... Even with the fancy Macro Cam, until the Flux was scrapped with a sharp knife and removed with acetone they just weren't visible. I used the Dremel and a thin pointed router bit to cut down to the Fiber Glass between the shorts... The Diagram below shows where these occurred on both boards. This Flaw is from a) not etching quite long enough (you can always remove after, but it's harder to put back when its gone) and b) from heavy handed soldering.
The Limit/Pause switch(s) and the Home switches didn't really matter as they feed back to the PC or are NO type connections. I did solder one NO switch between the step line and Grd as its a normally High term. For what it matters I did try the high side before I really looked at the schematic closely...
I
hit the power, nothing... shut off, feel all the IC's no heat... power-up
nothing, start measuring 5VDC in OK... 5VDC on motor CT, OK... Shut down and
look closer at schematic... Eventually after looking at a 7805 Regulator data
sheet, I realized that the Controller is good to 24VDC, but the 5804 controllers
only run on 5VDC logic... It takes 8VDC to turn the 7805 on, and I'm using 5VDC
on the stepper & logic side... So the 7805 is yanked and a solid jumper goes
into place.
Things are looking much better, I click the switch and the motor steps. I start to use the scope and loose my self in watching the waves pulse around as I press the switch, one step at a time, 1.8 degrees of a revolution. Eventually it occurs to me that the motor is not turning in a consistent manner. Obviously the wiring needs to be adjusted. so I flip one coil end for end... the positioning is still erratic, I mean absolutely random.
I'm up for a challenge, and figure, how hard can this be, the CT's are fixed so that leaves 4 wires through 16 possible combinations if I'm truly unlucky It'll be the last one. So I lay out a chart of every possible wiring combo, solder lead extensions from the PCB to a proto brd and start pushing wire combos through the paces. When I hit # 16 I was so dumb founded I did them all again incase I had gapped out and missed it... no, consistently random.
There are 2 Jumpers on the board to select half step/2 Phase torque/speed settings there's another 4 possibilities times 16 is 64 combos now... No sweat, so I crank off another 16 in the next available jumper mode. Well at 64 Combos up and then down I'm thinking CNC workers and machinists are gods, I may simply not be worthy... Generally I can muddle through most things and this has to make sense.
While I'm scoping the board, I notice a flick on the Main power line on each step. I set both the Voltage and Frequency (pulse width) settings on the scope to see a clear spike & ripple coming off the motors. Random noise would make perfect sense, and I did remove the regulator to open a path right to the controllers... So I cut the main power line as indicated above and return the 7805 with 12VDC in and leave the 5 VDC on the motor side.
I did one pattern of 16 and said fuck-it, I'm going to bed... so in abject disgust I shut down the shop without even one motor turning properly, a quick search on the Net yields a 3 page version of the Allegro Data Sheet (I'd only ever seen single or double sheet PDF's). The 3rd sheet deals with step pulse settle times, I won't pretend to understand it all, but it was enough to point me in the right direction.
So
tonight, I knock together a 2KHz square wave Oscillator from a 555 timer, slave
it's power right off the controller and solder the output directly to the
controller step term. The manual switch was too noisy
The motor spins perfectly, I can stall the shaft with a pair of pliers, but not easily by hand. The pulse generator is pictured with the controller and the circuit is running during this picture.
Actually it ran for half an hour without incident, the driver is warm, but definitely not hot. If I ever pop a controller I should be able to place some current limiting resistors on the CT lines.

Now I can tie into the PC, all three motors spin off the 555 and the wiring is settled and consistent.
I've even thought of some ideas for a manual Electronic jog system to reposition the milling head.
If I had tied the unit into the PC I'm positive I'd still be second guessing the software and wasting time on theories that missed the problem that is still down stream.
This has been a blast and I still haven't started the portion that I want to do the most, the actual mill...
.
Disclaimer
(an unfortunate necessity)
All
Rights Reserved theworkshop.ca © November 05, 2004.