3rd Generation CNC Mill

Embed Size (px)

Citation preview

  • 7/29/2019 3rd Generation CNC Mill

    1/8

    Generation CNC Mill http://www.theworkshop.ca/machining/gen3/3/3

    8 05/07/08 1

    TWS-1850

    a 3rd Generation CNC mill (Part #3)...

    24v UniPolar Stepper Driver w/ Current Limiting

    This page is less of an update of progress, and more of an itinerary of what hasn't worked sofar. Although it does fall under the Gen-3 CNC mill project log, it is being posted more as abackground document for assistance that I'll be posting on a couple of forums, in the hopesthat a fresh perspective will be able to point me back in the right direction.

    The objective of this project is to build a 3 Axis controller based on the Allegro 5804Bunipolar stepper controller that can control 7 (seven) steppers @ 24Vdc while limiting the

    current to each motor to 1Amp.The rough image below shows 1 (one) stepper for Z, 2 (two) steppers driven in sync for X and4 (four) steppers in sync for Y. The X steppers will drive a single lead screw from opposingends and as such will be wired for CW (clockwise) & CCW (counter clockwise) off the samedriver circuit. The Y axis is the same but with 2 leadscrews so 4 steppers (2 CW & 2CCW).

    I have a proven allegro5804B design that hasworked for 2 Mills alreadybut only @ 12V and withsingle steppers per axis.

    By adding a MosFet outputstage I should be able todrive multiple motors.

    By adding a programmablePWM circuit I should beable to limit the current to1, 2 or 4 Amps respectivelyfor Z, X & Y drivers.

    The PWM I would like to use is the PicAxe 08M micro-controller, as it is geared to the morenovice user.

    This is the 3rd revision of thecircuit (schematic postedbelow).

    Initially I had tried to drivethe /OE (inverted Output

  • 7/29/2019 3rd Generation CNC Mill

    2/8

    Generation CNC Mill http://www.theworkshop.ca/machining/gen3/3/3

    8 05/07/08 1

    Enable) term of the 5804B viathe Picaxe @ 23Khz, theoutput of the 5804 drove thegates of the MosFets.

    In the process of testing @just 12V one of my 10remaining 5804B's smoked.

    The DIR term is grounded,and the step term is driven bya 1Khz sqr wave from a 555that I've used successfully fortesting on the previousmachines. (dark proto brd)

    (saved @ 150 dpi to print legibly)

  • 7/29/2019 3rd Generation CNC Mill

    3/8

    Generation CNC Mill http://www.theworkshop.ca/machining/gen3/3/3

    8 05/07/08 1

    After some erratic results toggling the /OE term, I opted to use a CD4081 CMOS AND gateto drive the MosFet gates.

    The PWM Freq from thePicAxe is set via a code definedconstant, while the "Mark" is setby a 10bit variable that is readfrom a 10 turn pot (10K ohm)that is read via ADC. The ADCvalue is sent to a PC as thePicAxe is running so I canrecord the value. The idea beingthat I can 'Tune" or calibrateeach axis and program therespective PWM's per thestepper count.

    Below are 2 views of the potbeing used... The mechanicaldisplay on the front is handy asa reference to determine theapprox location of the pot wiperprior to powering-up the circuit.

  • 7/29/2019 3rd Generation CNC Mill

    4/8

    Generation CNC Mill http://www.theworkshop.ca/machining/gen3/3/3

    8 05/07/08 1

    The appeal of the PicAxe 08M is thesimplicity of the coding, below is what I wrotefor the calibration of the PWM, the final codethat would have run the steppers is even less,as both Freq & Mark would be hard codedwith no pot or Serial Out to the PC.

    ;PWM stepper Chop Calibration prog; the workshop.ca - Frank Gombik Jan 2007

    high 2pause 500

    main:

    readadc10 4,w1 ;read pot value (Voltage divider between Vcc, wiper & Grd)symbol mark=w1 ;define variable "mark" with Reg w1sertxd("Cool!!! ",#w1,"...fg ") ;send ADC to PC (View w/terminal)pwmout 2,100,mark ;PWMOUT pin,period,duty cycles - 13khz

    goto main

    Obviously this isn't working out asI'd planned as at 24V with a singlestepper, I'm not getting anysubstantial torque improvement over12V or even 5V.

    But I'm getting lots of heat!!! with a

    touchless thermometer the Mosfetsread 50C + and the stepper is hittingclose to 70C @ 5us "On" pulse on a40us period.

    Approx 12% Duty, 24V / 2 ohm coil

  • 7/29/2019 3rd Generation CNC Mill

    5/8

    Generation CNC Mill http://www.theworkshop.ca/machining/gen3/3/3

    8 05/07/08 1

    = 12Amp / 0.12 duty cycle =1Amp???

    Regardless, I have to admit that I'min over my head, as I can neitherafford to smoke any more Fet's or5804B drivers, or completely destroythe proto-brd unit ) note the melted sockets.

    Questions I could use some help with...

    Should I abandon the "Fixed PWM" idea and implement a "Sense Resistor" ADC to cut the5804B /OE term for a period of time.

    If so what is an effective way to get an 08M to sense the current draw of the stepper (I think Ihave to monitor 2 locations as there are 4 coils with 2 center taps to 24V).

    Should the 4081 be dropped as the Gate drive? (the Fets are IRF640, not ideal or even logiclevel, but I have lots on hand) Would IRLZ44 be more appropriate.

    What else could I do to improve noise suppression? Until I added a 5.6V zener and a pair or630uF caps across the 5V supply the PicAxe was quite erratic. Even so when I scope thesupply lines there are still lots of transients.

    As a last resort I could make a monstrous driver brd with 7 5804B drivers and limit thecurrent to 24V via resistive load, but that would be such a colossal waste of energy...

    Power Supply(s)

    To get 24V I'm using 2 AT stylepower supplies.

    Each is loaded with 3.3ohms onthe 5V line, the primary supplysources ground reference, 5V+,and 12V+.

    The second supply has theground isolated from the frame.

    The 12V+ from the primarysupply is tied to the Grnd of thesecondary supply, with 24Vbetween Pri Grnd and Sec 12V+.

  • 7/29/2019 3rd Generation CNC Mill

    6/8

    Generation CNC Mill http://www.theworkshop.ca/machining/gen3/3/3

    8 05/07/08 1

    To save on power cables andswitches the secondary supply isfed via this custom male plug thatis connected to the Primarysupplies AC Out receptacle.

    As always my personal attorney &advisor forbids you fromduplicating the image displayed tothe right for fear of personalinjury.

    (the exposed AC lines arehot-glued and covered withelectrical tape for safety.)

    The supplies are wired into theheader block as shown to theleft.

    Windows BasedOscilloscope

    In the course of getting to thispoint my Scope died (or so I

  • 7/29/2019 3rd Generation CNC Mill

    7/8

    Generation CNC Mill http://www.theworkshop.ca/machining/gen3/3/3

    8 05/07/08 1

    thought, it was a flakypower-bar)...

    But I didn't know that for 2days, in the mean time I optedto hammer together a simpleamp circuit I found on the webto try and use one of the"freeware" PC-basedoscilloscopes.

    The pattern transferred nicely.

    The PCB etched out ok as well.

    The assembled unit works like achamp...

    But I have had very poor resultswith the software...

    The laptop that I use for thePicAxe programming is an oldMMX233 Mhz unit that isrunning Win98...

    Anybody have a link to a simple

  • 7/29/2019 3rd Generation CNC Mill

    8/8

    Generation CNC Mill http://www.theworkshop.ca/machining/gen3/3/3

    Scope app that uses the "Mic" asan input @ 16 Bit that canhandle 20Khz or above???

    Most apps that I assessed werebloated with SpectrumAnalyzers, FFT and Lissijousplotting (all I need to do is seethe shape, read the amplitudeand time base accurately)...

    Is this asking to much of such an old system, or is there a cheap ($100) USB/Par port solutionthat would approximate a basic scope? This isn't too high a priority, but it would be nice tocapture waveforms rather than trying to photo-graph them.

    Support theworkshop.ca

    Back to Machining

    Disclaimer (an unfortunate necessity)

    All Rights Reserved theworkshop.ca January 30, 2007.