2 questions about bipolar stepper motor drivers

Thread Starter

CVMichael

Joined Aug 3, 2007
419
There are CNC kits (I found out after I started making my own CNC), I think it was around 600$, but don't remember if absolutely everything was included... I did not save the link though... sorry...

I invested so much money to research & change/improve & remake (this is the second one, click on my user id in youtube to see my old one), with that same amount of money I could have bought a CNC kit that is much better than mine.

But I made mine with the purpose of learning also, and I DID learn a whole lot since I started. So I don't regret it...
 

coldpenguin

Joined Apr 18, 2010
165
The trouble with the kits, and most of the online instructions, is the exchange rate (extremely dire at the moment, compared to a couple of years ago, prices have doubled), and the fact that it seems very difficult to get hold of 'spares' in the UK.
There was one set of instructions which looked doable, but I couldn't find anywhere here which could sell steel tubing to individuals, which was what was used for the frame.
Any construction based material here, possibly with the exception of wood, seems to be very expensive.
 

Thread Starter

CVMichael

Joined Aug 3, 2007
419
I think this is the kit I saw before but on a different website:
http://blog.ponoko.com/2009/04/28/cnc-router-for-under-600/

It seems not everything is included, and it get expensive when you add the rest of the stuff to complete it.

I understand, I have the same problem... I had to order the linear rails and motors. Just those were around $1,500. That's why I am trying to make the electronics and software for it on my own, it gets very expensive, and you can't just give up once you already started. (At least not after you already invested in it)
 

SgtWookie

Joined Jul 17, 2007
22,230
Well, rather than buying any of the old ones (IRF MOSFETs), hang on for a bit.

Take a look at the specs of the MOSFETs that I posted, and compare them to the old IRF series. You'll see that the IRLR7807 and IRLR7821 MOSFETs have a very low gate charge, and a very low Rds(on). Both of these are far better suited to this project than the old IRF series. They're SMT, and that plays well with your CNC machine.

Perhaps we can work out a trade - I'll send you a bunch of the IRLR7807's, and maybe you'll use your CNC machine to make some boards for us. Sound like something you'd be interested in?
 

Thread Starter

CVMichael

Joined Aug 3, 2007
419
... and maybe you'll use your CNC machine to make some boards for us. Sound like something you'd be interested in?
Sure, i'm in...

But remember that I am not using an already made software, I made the software myself. This is because I made my own electronics, and the communication between the microcontroller and computer is not the "standard" one. You can get an idea of the communication in this thread. I was asking for help on programming, and after that post no one seemed interested anymore, I guess it's too complicated, and also they can't test it since they don't have a CNC also. So I'm alone on that one too...

So... Next thing I have to do (software wise) is to be able to convert a picture to my own format for the CNC. I am planning to make a program that takes a picture, and finds the edges of the copper traces, and converts to coordinates for the CNC.

I think I will be able to find the edges from picture, right now I am still thinking how to make the program "know" when a "pin hole" (what is the proper term?) is made, and what size (what drill bit to use).

Also, I don't have a propper bit, I still did not order the bit(s) we were talking about in this thread: http://forum.allaboutcircuits.com/showthread.php?t=39276&page=2

So, still a lot of things to do...
 

SgtWookie

Joined Jul 17, 2007
22,230
Well, it might be helpful if you took a look at Gerber file formats, and parsing them.

Cadsoft's Eagle can generate a variety of output formats, including Gerber and Exellon format files; the former used for interpreting trace layouts, the latter for drilling.

If you capture a schematic and then generate a board layout using Eagle, you can then export the Gerber and Excellon files using the CAM processor, and just parse them in using your program. I don't recall if the positions are absolute or relative at the moment, but it wouldn't take long to figure out.

The drill file contains a list of drill diameters, coordinates to drill the holes, and which drill to use to make the holes with.

As far as locating specific areas on the board; sometimes manufacturers use a unique shape on the board in a couple of places. A diamond (a square rotated 45°) works quite well in many instances; your system can scan the board using an optical sensor to find the two diamonds, and then calculate the absolute coordinates/offsets needed to accurately drill any spot on the board. This method is frequently used for automatic pick-and-place machines.

As far as the rotational encoder goes; I'm going to be using a couple of optointerruptors to find the limits for the X and Y axis, and a couple of limit switches just in case it runs away, and I have a couple of Hall wheels. The Hall wheels have 200 "teeth" on them. I'd prefer having more, but they're kind of heavy to begin with. Having 200 counts per rotation should be adequate to determine if steps have been skipped or not. I'll use 2 Hall sensors per wheel offset by a half-tooth to wind up with a quadrature encoder.

I'll pay a penalty in acceleration for such heavy wheels, but I'd just as soon have the accuracy. A little clever programming, and the maximum rate of change for the step rate could be easily determined dynamically. ;)

[eta]
I wish I knew where to suggest to look for something like that. I picked up just three of them for a buck each at the Skycraft Parts and Surplus store, and when I confirmed via experimentation what they were, found that the store was sold out. :( These wheels are 2" in diameter, 3/16" thick and have a 1/4" ID hub, with an Allen-head screw to lock it to the motor shaft. I picked up some 2A 3.2v NEMA 23 motors that don't have a lot of torque (82 in oz) but at $7.50/ea I couldn't resist.
 
Last edited:

retched

Joined Dec 5, 2009
5,207
Alright. ALRIGHT! Dang you guys and your fancy machines.

Count me in on the build, sarge. I would love to follow along, ill try not to let my wit get the best of me. But, this is a project I have been bouncing off the back of my brain stem for a few months. Now that is it being done by my favorite Wookie, I would like to follow and create.

-Are you starting here or making a project thread?
 

Thread Starter

CVMichael

Joined Aug 3, 2007
419
Just an update...

DipTrace can export Gerber files also. I made an export just to look in the file. I found a PDF for the Gerber file specifications. It is difficult to understand everything, it is a lot of info to go through, but I will learn eventually. So, I am pretty sure I will be able to make my CNC read Gerber files.

For the optical system to find areas on the board, do you know if there is any camera that can output in a format that a microcontroller can (easily) read ? I don't want it to go through a computer, I want everything to be integrated into the CNC.

I also want to add encoders to my CNC, the problem is that I want one that is about 1000 points per rotation, and again, I want to be able to connect it to a microcontroller.

By the way, do you know where can I order some big thick aluminum sheets to replace the wood on my CNC ? I want the thickness to be about 1/3 inch (or 1/2 inch ?). Right now even though the wood is reinforced with aluminum 1/8 think sheets ("L" shaped), it still bends too much. I want to use a more powerful spindle (right now I use a Dremel), and I want to be able to cut metal. With what I have now that will be impossible.

Other ideas for the future:

I want to be able to do 3D scanning. I want to use a laser pointer and an optical system (a CCD array), and do triangulation of where the laser "hit" the object. Now that I have a Logic Analizer, and I know more electronics than 2 years ago (when I had the idea to do this), I think (I hope) I will be able to do it...
I could also use this for finding where the object is before cutting/drilling, etc.
 

SgtWookie

Joined Jul 17, 2007
22,230
Just an update...

DipTrace can export Gerber files also. I made an export just to look in the file. I found a PDF for the Gerber file specifications. It is difficult to understand everything, it is a lot of info to go through, but I will learn eventually. So, I am pretty sure I will be able to make my CNC read Gerber files.
It'll take several reads before it starts sinking in.

For the optical system to find areas on the board, do you know if there is any camera that can output in a format that a microcontroller can (easily) read ? I don't want it to go through a computer, I want everything to be integrated into the CNC.
Why not just use an inexpensive laser pointer, and an optic sensor like a phototransistor or photodiode? The return from bright copper will be much more than from the fiberglass area, and a hole won't return any light at all.

I'm thinking the easiest way to assure alignment is to just drill a couple of locator holes to start off with (like 1/8" or so), and use locator pins so that the absolute locations of everything are already known.

I also want to add encoders to my CNC, the problem is that I want one that is about 1000 points per rotation, and again, I want to be able to connect it to a microcontroller.
I'm wondering why you want so many points? I'll be happy with 200 points, as I can use two Hall sensors on it and wind up with 400 points quadrature.

I suppose it depends upon what you're using for lead screws.

I'm going to go the Super El-Cheapo route. 1/4" threaded brass rod, and drawer slides. Yeah, it'll be a bit sloppy, but if it's within a few mils that's fine with me.

By the way, do you know where can I order some big thick aluminum sheets to replace the wood on my CNC?
I really have no clue about Canadian metal suppliers.

Will your CNC be in an area with tight environmental controls?

Aluminum has a very high thermal coefficient of expansion. If you really want for it to be stable, look at using cast iron, or possibly ceramic materials if you want something exotic.

Other ideas for the future:

I want to be able to do 3D scanning. I want to use a laser pointer and an optical system (a CCD array), and do triangulation of where the laser "hit" the object. Now that I have a Logic Analizer, and I know more electronics than 2 years ago (when I had the idea to do this), I think (I hope) I will be able to do it...
I could also use this for finding where the object is before cutting/drilling, etc.
At the moment, all I want is to get to the point where I can dump out Gerber and Excellon files from Cadsoft Eagle, and make a double-sided board.

Looking at all of the "pie in the sky" stuff is great, but trying to incorporate everything will result in nothing getting accomplished.

Build a solid foundation first, with an eye on possible expansion of functionality/utility. However, don't get lost in a sea of unlimited possibilities.
 

Thread Starter

CVMichael

Joined Aug 3, 2007
419
I don't want to use the CNC just for PCBs, I want to make other things also.

I already made an attempt to make a 3D scanning tool.

Here's what I did:
I took a 1/32 drill bit and glued it to the back of a small mirror (with the tip of the drill attached to the mirror at 90 degrees). I also glued a spring to the back of the mirror.
I put a laser pointer to reflect through the small mirror, and reflecting into a + (plus) configuration of 4 photo diodes, the light is going right in the middle of the "+". The photo diodes are connected to a PIC16F88 microcontroller.

So the idea is that when you touch the drill bit, it will move the mirror, which in turn will reflect the light into one of the photo diodes, and therefore it will detect what direction it was touching (and how much, by light intensity).

The only problem with this is that it does not detect properly when the drill bit is pushed up, it works only for side movement.

I made the microcontroller make a "beep" sound with a small piezo speaker when it's detecting movement, and it worked pretty well, quite sensitive... actually it was so sensitive it would detect the CNC shaking when the motors were moving (stepping). But that is because the spring was too soft, I can't find a good spring that would fit well for this "thing".
 

retched

Joined Dec 5, 2009
5,207
There are easier ways to get 3d input from your cnc. If you have not considered a probe, consider it.

A cnc 3d digitizing probe, is pretty easy with included software or opensource software available. You can also DIY the probes.

You simply put it into your chuck and run the software. There is a set of wires that go to an input and supply to report 3d locations of whatever you are scanning. (or probing)

http://www.youtube.com/watch?v=XJBpjddTfrA
 

SgtWookie

Joined Jul 17, 2007
22,230
OK, look...

I'm not a Moderator or anything, but I think this thread will be a whole lot more productive if we just concentrate on the basics, according to the title of the thread.

If we keep bringing up these "pie in the sky" ideas, we'll be talking for months and never actually get anything accomplished.

And that basic premise is, "What is it going to take to get a reliable and adequate stepper motor driver?"

Please, let's strive to concentrate on just that in this particular thread. Otherwise it'll turn into an incomprehensible jumble, and take forever to make any progress at all.
 

retched

Joined Dec 5, 2009
5,207
I agree, I was following the OPs tangent. However, I am ready to get this thread back on track and start building the best driver we can.

Lets do it. Focus.
 

SgtWookie

Joined Jul 17, 2007
22,230
OK, here's what I'm playing around with at the moment.

See the attached.

The optocoupler drivers make for very fast gate charge/discharge times. to keep the turn-on/turn-off times symmetrical, I've used them on both the upper and lower MOSFETs. With the tiny gate charge of 7nC and the optodrivers' 2A output, they ought to have some mighty impressive switching times, and heat dissipation will be pretty low - it's basically the Rds(on) times the current^2.

I guess I really need to explain the reasoning for each component. Look at the high side left driver.
The four drivers are pretty much clones of each other, with the high side having an extra Schottky diode (D5) used to charge the driver supply caps (C1, C3). C1 is directly across the supply pins. C3 is also across the supply pins, but a little further away. The gate driver line passes under the caps.
D7, D8 are clamping diodes to take care of any tendency of the gate to "ring" after the fast turn-on/turn-off. R1 is for snubbing. It may need to be "tweaked"; guess I need to do some testing. R5 is to keep the MOSFET off in case of failure. D1 are 8A Schottky diodes that are SMT.

Using a pair of thick-film resistors for the sense resistors will mean no inductance, but power dissipation there needs to be considered pretty heavily. Using a Hall-effect sensor to detect current would be a major improvement.

Right now, we don't have any kind of a goal established for cost per driver.

We also need to establish the maximum voltage to be used. I'm using parts rated for 30v.

If you want it cheap and easy, the performance will be dismal. That's been done already.

I'm using Cadsoft Eagle 4.16r2. If you want to play along, you can download that same version from CadsoftUSA's site.
The download area for 4.16r2 is here: ftp://ftp.cadsoft.de/eagle/program/4.16r2/

I'm not upgrading, as I don't want to spend more money.

You can read the files with a newer version of Eagle, but if you make changes, I won't be able to read any modifications you make.

As long as the PCB size is kept to 3"x4" and no more than 2 layers, you can use the freeware version. I'm sure you guys wouldn't do it, but don't even consider attempting to use a "cracked" version, as the output files will be useless.
 

Attachments

SgtWookie

Joined Jul 17, 2007
22,230
Now I'm going to jump slightly off-topic for a moment, but it directly relates to driving the motors.

Power supply - I am going to build a switching supply for my motors and logic portion.

I have several different regulators that I can use; UG2842's in SMT, SG3524's in DIP, and am expecting some SG2525's/3525's to arrive.

Do you have your power supply requirements covered, or are you going to go with off-the-shelf components, or do you want to attempt to build your own?

You will need a minimum of an O-scope to play in this game.

At any rate, the power requirements need to be defined, and the components need to be rated to exceed them. In order to establish the power budget, you need to decide what is the highest current you will want to operate your motors with, and at what input voltage. The actual power will be a bit over what your motor's current x voltage rating.

Having the motor datasheets available will be a big plus.
 

Thread Starter

CVMichael

Joined Aug 3, 2007
419
Isn't the optocoupler a little slow compared to the MOSFETs ?

The transformers that I am using are 13.7V.
I use a separate transformer for each motor.

About the o-scope, I have a Logic Analizer, and I use a AD9059 at 60 MSPS, 8 bit to convert analog to digital which is connected to the Logic Port. Hopefully that is sufficient...
 
Last edited:

SgtWookie

Joined Jul 17, 2007
22,230
Isn't the optocoupler a little slow compared to the MOSFETs?
These FOD3180's have a 200nS max propagation delay over temp, and a max switching frequency of 250kHz. That's mighty zippy for an opto driver.

The transformers that I am using are 13.7V.
I use a separate transformer for each motor.
Ahhh - OK, so your transformers are rated for 13.7v @ 4A? That's a wild guess here. You're aware that you'll need some pretty big caps on the supply, right?

Actually, I have a few 16v 5A transformer supplies sitting around here that I could use, skipping the supply building.

About the o-scope, I have a Logic Analizer, and I use a AD9059 at 60 MSPS, 8 bit to convert analog to digital which is connected to the Logic Port. Hopefully that is sufficient...
That'll work - is it dual trace?
 

Thread Starter

CVMichael

Joined Aug 3, 2007
419
Ahhh - OK, so your transformers are rated for 13.7v @ 4A? That's a wild guess here. You're aware that you'll need some pretty big caps on the supply, right?
Actually... I bought them second hand, it says on them is 13.7V, the other writing does not tell me anything, I tried to google these numbers but nothing... I attached a pic with the top of the transformer. I don't know how to check (or test) to see how many amps... can you please tell me how ?
I use a 6,800uF cap on each. Should I add more ?

That'll work - is it dual trace?
Actually right now it's on a test board, I was about to design the final PCB for it.

I attached a pic with "brains" of the CNC, as you can see everything is on a test board :D
On the left/bottom is the manual jog (I use a small stepper motor as input), to it's right is dual display, one with points (steps) and another displays in inch for X & Y & Z, then it's the logic port connected to the AD9059 (the clock comes from a programmable oscillator LTC6904).
And finally to the top left is the PIC18F4550 that is connected to the 3 motor drivers, and to the computer through a MAX232
 

Attachments

retched

Joined Dec 5, 2009
5,207
For dual trace, the sarge was wondering if you can get 2 scope signals on screen at one time to compare the two.
http://en.wikipedia.org/wiki/Oscilloscope#Dual-trace_controls

And by the way, I had no idea EAGLE stood for 'Easily Applicable Graphical Layout Editor'

Just installed 4.16r2, sarge could you supply .sch's? Im guessing you were.

As for supplies, I would like to build the switchers, but Im in for the haul, so If you want to go transformer on each motor, I can also do that.
 
Last edited:

Thread Starter

CVMichael

Joined Aug 3, 2007
419
Owwww... LOL

Well, yea, I can display 2 scope signals, I just have to connect another 8 ports from the logic port to the other side of the AD9059 chip. But the ground is common to both.

When I will make the final PCB for the AD9059, I will add a female 40 pin jack that will plug directly in the logic port, and on the other side, I will add a male 40 pin jack that will pass through the remaining digital ports.
 
Top