Sie sind auf Seite 1von 8

3rd Generation CNC Mill

http://www.theworkshop.ca/machining/gen3/3/3.

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 so far. Although it does fall under the Gen-3 CNC mill project log, it is being posted more as a background document for assistance that I'll be posting on a couple of forums, in the hopes that 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 5804B unipolar 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 and 4 (four) steppers in sync for Y. The X steppers will drive a single lead screw from opposing ends and as such will be wired for CW (clockwise) & CCW (counter clockwise) off the same driver circuit. The Y axis is the same but with 2 leadscrews so 4 steppers (2 CW & 2CCW). I have a proven allegro 5804B design that has worked for 2 Mills already but only @ 12V and with single steppers per axis. By adding a MosFet output stage I should be able to drive multiple motors. By adding a programmable PWM circuit I should be able to limit the current to 1, 2 or 4 Amps respectively for Z, X & Y drivers.

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

This is the 3rd revision of the circuit (schematic posted below). Initially I had tried to drive the /OE (inverted Output
1 de 8

05/07/08 14

3rd Generation CNC Mill

http://www.theworkshop.ca/machining/gen3/3/3.

Enable) term of the 5804B via the Picaxe @ 23Khz, the output of the 5804 drove the gates of the MosFets. In the process of testing @ just 12V one of my 10 remaining 5804B's smoked. The DIR term is grounded, and the step term is driven by a 1Khz sqr wave from a 555 that I've used successfully for testing on the previous machines. (dark proto brd) (saved @ 150 dpi to print legibly)

2 de 8

05/07/08 14

3rd Generation CNC Mill

http://www.theworkshop.ca/machining/gen3/3/3.

After some erratic results toggling the /OE term, I opted to use a CD4081 CMOS AND gate to drive the MosFet gates. The PWM Freq from the PicAxe is set via a code defined constant, while the "Mark" is set by a 10bit variable that is read from a 10 turn pot (10K ohm) that is read via ADC. The ADC value is sent to a PC as the PicAxe is running so I can record the value. The idea being that I can 'Tune" or calibrate each axis and program the respective PWM's per the stepper count. Below are 2 views of the pot being used... The mechanical display on the front is handy as a reference to determine the approx location of the pot wiper prior to powering-up the circuit.

3 de 8

05/07/08 14

3rd Generation CNC Mill

http://www.theworkshop.ca/machining/gen3/3/3.

The appeal of the PicAxe 08M is the simplicity of the coding, below is what I wrote for the calibration of the PWM, the final code that would have run the steppers is even less, as both Freq & Mark would be hard coded with no pot or Serial Out to the PC.

;PWM stepper Chop Calibration prog ; the workshop.ca - Frank Gombik Jan 2007 high 2 pause 500 main: readadc10 4,w1 ;read pot value (Voltage divider between Vcc, wiper & Grd) symbol mark=w1 ;define variable "mark" with Reg w1 sertxd("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 as I'd planned as at 24V with a single stepper, I'm not getting any substantial torque improvement over 12V or even 5V. But I'm getting lots of heat!!! with a touchless thermometer the Mosfets read 50C + and the stepper is hitting close to 70C @ 5us "On" pulse on a 40us period. Approx 12% Duty, 24V / 2 ohm coil
4 de 8

05/07/08 14

3rd Generation CNC Mill

http://www.theworkshop.ca/machining/gen3/3/3.

= 12Amp / 0.12 duty cycle = 1Amp??? Regardless, I have to admit that I'm in over my head, as I can neither afford to smoke any more Fet's or 5804B drivers, or completely destroy the 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 the 5804B /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 I have 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 logic level, 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 or 630uF caps across the 5V supply the PicAxe was quite erratic. Even so when I scope the supply lines there are still lots of transients. As a last resort I could make a monstrous driver brd with 7 5804B drivers and limit the current 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 style power supplies. Each is loaded with 3.3ohms on the 5V line, the primary supply sources ground reference, 5V+, and 12V+. The second supply has the ground isolated from the frame. The 12V+ from the primary supply is tied to the Grnd of the secondary supply, with 24V between Pri Grnd and Sec 12V+.

5 de 8

05/07/08 14

3rd Generation CNC Mill

http://www.theworkshop.ca/machining/gen3/3/3.

To save on power cables and switches the secondary supply is fed via this custom male plug that is connected to the Primary supplies AC Out receptacle. As always my personal attorney & advisor forbids you from duplicating the image displayed to the right for fear of personal injury. (the exposed AC lines are hot-glued and covered with electrical tape for safety.)

The supplies are wired into the header block as shown to the left.

Windows Based Oscilloscope

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


6 de 8

05/07/08 14

3rd Generation CNC Mill

http://www.theworkshop.ca/machining/gen3/3/3.

thought, it was a flaky power-bar)... But I didn't know that for 2 days, in the mean time I opted to hammer together a simple amp circuit I found on the web to try and use one of the "freeware" PC-based oscilloscopes. The pattern transferred nicely.

The PCB etched out ok as well.

The assembled unit works like a champ... But I have had very poor results with the software... The laptop that I use for the PicAxe programming is an old MMX233 Mhz unit that is running Win98... Anybody have a link to a simple
7 de 8

05/07/08 14

3rd Generation CNC Mill

http://www.theworkshop.ca/machining/gen3/3/3.

Scope app that uses the "Mic" as an input @ 16 Bit that can handle 20Khz or above??? Most apps that I assessed were bloated with Spectrum Analyzers, FFT and Lissijous plotting (all I need to do is see the shape, read the amplitude and time base accurately)... Is this asking to much of such an old system, or is there a cheap ($100) USB/Par port solution that would approximate a basic scope? This isn't too high a priority, but it would be nice to capture 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.

8 de 8

05/07/08 14

Das könnte Ihnen auch gefallen