MechMate CNC Router Forum

Go Back   MechMate CNC Router Forum > Computing, Software & Programming > 80. Computer Hardware & Software
Register Options Profile Last 1 | 3 | 7 Days Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old Wed 25 July 2007, 06:16
Aubrey
Just call me: Aubrey
 
Jhb
South Africa
Lower Cost Electronics Part 2

Hi everyone,
Now that the basic interface to the pc has been sorted out (see Lower Cost Electronics), the next task is to take the step/dir signals and send them to the motors.
I've been lurking around the forums (both at Mechmate and elsewhere) to try and learn more but have only succeeded in becoming more confused. Terms such as PWM, Chopping and a whole bunch more are as clear as mud to me at this time.
The motors that I am using have 6 wires.
1a....1b....1c
|.....|......|
()()()()()()

()()()()()()
|.....|......|
2a....2b....2c
Assuming for the meantime that the "b" connections are permanently connected to earth.
a) Applying voltage to 1a will place the motor at a specific rotational point.
b) Disconnecting 1a and applying voltage to 1c will take it one step further. (call clockwise for arguement sake)
c) Disconnecting 1c and applying voltage to 1a will then take it back one step (counter clockwise).

Assuming that I use a PIC or other type of microprocessor to do the logical work (I feel that it would be far easier to re-program a chip than to change componentry on a board) then is the following correct?

If there are no mistakes in my understanding so far, then using an array of 4 bits will allow me to control the magnets in my stepper.
That way I can let the 1st bit control the voltage on 1a, the second bit controls 1c, and so on.
Lets call the array "posn()".
posn(1) = "1000" which energises 1a.
posn(2) = "0100" which energises 1c.
posn(3) = "0010" which energises 2a.
posn(4) = "0001" which energises 2c.

In addition, by adding more array elements, you could get a "finer" control of the motor.
ie
posn(1) = "1000" energises 1a - rotor centralised on 1a-1b coil.
posn(2) = "1100" energises 1a and 1c - rotor centralised on 1b connection.
posn(3) = "0100" energises 1c - rotor centralises on 1c coil.
posn(4) = "0110" energises 1c and 2c - rotor centralises between 1c and 2c.
And so on.

We have now effectively doubled the number of steps to be taken to do a sequence with greater control over the actual positioning of the rotor.

The physical connections to the PIC are as follows:
pin a: connected to "step" signal.
pin b: connected to "direction" signal.
pin c: connected to motor 1a via power control circuitry (FET or whatever)
pin d: connected to motor 1c via power control circuitry (FET or whatever)
pin e: connected to motor 2a via power control circuitry (FET or whatever)
pin f: connected to motor 2c via power control circuitry (FET or whatever)

What happens inside the PIC:
Need to declare an integer variable "cnt" and initialise to "1"
When the "step" is received,
If "dir" is +ve then add 1 to cnt else subreact 1 from cnt
if "cnt" = 5 then "cnt" = 1
if "cnt" = 0 then "cnt" = 4
Place value of posn(cnt) onto pins c,d,e and f.
end when.
wait for next "step"

Assuming that I have not made a mistake yet, this "should" move the motor in the required direction.

However, here is what is getting me confused:
Assume the instruction "step" = 5v, "dir" = 5v.
The motor will step 1 step clockwise.
The next instruction is ALSO "step" = 5v, "dir" = 5v.
The voltage on the "step" and "dir" pins HAS NOT CHANGED!
How does the program in the PIC know that it is supposed to step again???

Best Wishes to all
Aubrey
Reply With Quote
  #2  
Old Wed 25 July 2007, 08:41
Richards
Just call me: Mike
 
South Jordan, UT
United States of America
Aubrey,
You've done a lot of work and research to get an understanding of how stepper motors work. But, if your experience is like mine, you've made the first step on a thousand mile journey. Designing your own stepper motor driver is not for the timid. By the time that you're finished, you'll be able to compete with any electrical engineer anywhere in the world.

Mariss has an excellent white paper on stepper motors called 'Step Motor Basics' in the support area on the www.geckodrive.com website. You'll find some very valuable information there.

You'll need a thorough understanding of chopper circuits. That subject by itself may take several months to master or much longer depending on how solid your understanding of electronics is.

Computer control of the stepper driver is a field of science that you'll need to learn in addition to electrical engineering. Little fundamentals like SINKING or SOURCING and ACTIVE HIGH compared to ACTIVE LOW signals will be easy but they will need to be mastered before you'll be able to see the step signals marching across the oscilloscope. (Believe me, it was a relief when I finally got my first TTL circuit to work back in the 1970's.)

Somewhere along the way, you'll learn about timing sequences and interrupts so that you can send a step signal at a predetermined point of time. You'll also learn the formulae governing acceleration (ramping) so that you can get a stepper motor to speed without having it lose steps.

It is a fascinating journey, but not a short journey. I spent most of my free time for several years reading and experimenting before some of the concepts started to make sense - and that was with George Baulding as my personal tutor. (He had been a senior electrical engineer at Keiser, a company that designed some very complicated electronics for the military.)

For those of us who don't have the time or the patience to build it all from scratch, the Gecko G20x stepper drivers are excellent options and the PMDX or other breakout boards are easily connected to handle the 'glue' that connects the various electronics together. I know that being outside the United States can make 'standard' parts difficult to obtain, but sometimes the time and effort to do your own isn't worth the learning curve and expense.

Every once-in-awhile I have to step back from some of my 'projects' and ask myself what business am I really in. Am I a user of CNC equipment or am I a supplier of CNC equipment? Using Gerald's excellent plans makes building the mechanical parts of a CNC router possible - even for people like me. Using Gerald's recommendations for the electronic control greatly reduces the frustration of controlling the CNC router. Letting Gerold and others do the design work will relieve you from mastering every aspect of new and complex fields without adding substantially to the cost of owning the finished CNC router.
Reply With Quote
  #3  
Old Fri 17 August 2007, 12:25
domino11
Just call me: Heath
 
Cornwall, Ontario
Canada
Hi
For anyone thinking of building their own drivers and interface boards, I highly suggest looking at www.pminmo.com. He has a variety of proven driver and interface board designs as well as a myriad of information you can use to design your own. He even sells printed circuit boards for his designs for a modest cost. Check it out.

Gerald, hope its alright to post links here. I have no affiliation iwth this site but have found it most usefull.
Reply With Quote
  #4  
Old Thu 23 August 2007, 14:05
Aubrey
Just call me: Aubrey
 
Jhb
South Africa
Found Something

Hi Guys
Sorry for the disappearing act - work pressure and all that.
Been having a look around - found the "PicStep" board (see Alan the developers site) and it looks promising - looks like a nice, simple design electronically as all the logic work is handled by the PIC.
Very basically, the program inside the PIC has an array of binary values and a counter. When the "step" is received, it has a look at the "direction" value and then moves up (or down) the array and sends the binary to the outputs which drives the stepper (via tha LMD). The array index is then stored in the counter variable and it waits for the next step pulse to arrive.
Only problem is the LMD18245T (a dual full-bridge power amplifier rated at 3amps 55 volts) which costs US$ 13.90 or ZAR 100.00 plus postage/import tax etc.
And we need 2 per axis.
As was the case in the Original Low Cost Thread, is there not a way that we can get away with using a minimum number of discrete components (ie power transistors/FETs or whatever) to replicate what the LMD18245T is doing?
I realise that the circuitry inside the LMD is complicated but my common sense tells me that we only need a part of whats there, the rest is just extra bagage and unnecessary.
As the stepper has 4 wires, each of which can be +ve or -ve, we need 1 discrete component for the +ve signal and 1 for the -ve per wire.
This is a total of 8 components to drive the high power side.
I was thinking of a common, cheap power transistor as used in a hi-fi power amplifier or something to that effect.
There will also probably have to be a switching transistor or something between the PIC output pin and the power transistor to slam the transistor "full on" as quickly as possible.
I heard somewhere that the majority of heat generated inside a semi-conductor happens in the area between full off and full on. In the full on stage the heat generated is low because the semi-conductor is at that stage operating like an open tap and is not trying to "control" the power being sent through it. Is anyone able to verify this?
So if what I heard is correct, the ideal would be to have the semi-conductor switched on or off as quickly as possible to reduce heat generation. This would also mean that the stepper would have maximum voltage for as long as possible which means that the torque would be at its peak and able to accellerate the gantry quickly or move the tool through the material being cut efficiently. I think that these are all desirable traits.
Basically we need "power switches" (on or off) as opposed to a "power amplifier" which is what the LMD is.

Any suggestions?
Best
Aubrey
Reply With Quote
  #5  
Old Thu 23 August 2007, 23:36
Les Filip
Just call me: Les
 
Austin, Texas
United States of America
In all seriousness, what possible advantage could there be to spending literally hundreds upon hundreds (if not thousands) of hours reinventing a Gecko? It is already the minimum number of components needed to get the job done with the most reliability and control. If it wasn't, then Mariss would simplify the circuit. The things are very cheap for what they accomplish, are well-understood, and are supported by a first-class company. If your goal is to try to create a "low cost" replacement for a Gecko, please think about what it will take in time and resources. Your development costs are going to far exceed any savings you might eventually realize over buying Geckos, assuming you come up with a design that works at all. Then you will need to have your design manufactured, which will take materials, tools, labor, and other overhead. You will then need to sell thousands of units before you break even.

If you still want to go forward with your project, I would suggest joining forums that are devoted to electronics and see what the experts have to say. Sorry if I sounded rude, I've had a long day.
Reply With Quote
  #6  
Old Fri 24 August 2007, 03:12
Gerald D
Just call me: Gerald (retired)
 
Cape Town
South Africa
Les, why bother to build your own CNC router if you can buy a ready-made one? No, don't answer that!

The famous Gecko support is meaningless out here in South Africa - to us it is just a little box that is very expensive to get here, and not worth the shipping costs to send back for repair.
Reply With Quote
  #7  
Old Fri 24 August 2007, 06:41
Richards
Just call me: Mike
 
South Jordan, UT
United States of America
Aubrey,

You're basically correct about heat buildup in transistors. Most designers use F.E.T.s (Field Effect Transistors) when designing stepper drivers. You can find some basic information about FETs on Wikipedia.
Reply With Quote
  #8  
Old Fri 24 August 2007, 08:40
Aubrey
Just call me: Aubrey
 
Jhb
South Africa
And the costs get bigger

Made a few phone calls to price the LMD18245T locally......
With VAT about ZAR 310.00 EACH!
Need 6 ---- ZAR 1860.00 Totally out of the ballpark!
On the way home I stuck my head in at the local hi-fi repair shop - the "low heat generated at full throttle" theory was confirmed.
He also had a quick look at 55v 3a npn and pnp power transistors as used "everywhere" (according to him) as being freely available from almost any hi-fi repair shop at a cost of about ZAR 10.00 each. Says a 2N2222 transistor should be OK to drive the transistor from the PIC at less than ZAR 1.00 each.

Economics:
8 power transistors @ ZAR 10.00 = ZAR 80.00
8 2N2222 @ ZAR 1.00 = ZAR 8.00
8 fuses @ ZAR 1.00 = ZAR 8.00 (you dont think I'm not going to provide "oops" protection do you )
Total Cost = ZAR 96.00 ( or just over 5% of the LMD18245T option)

I dare say that there is going to be a bit more involved than already stated but if the cost triples we are still going to be way below the LMD18245T cost.

Comments please - even if it is just that I am wasting your time.

Thanks
Aubrey
Reply With Quote
  #9  
Old Fri 24 August 2007, 08:45
domino11
Just call me: Heath
 
Cornwall, Ontario
Canada
Gerald,
Have you ever thought of building some drivers for your Mechmate? If you were to get a printed circuit boards from pminmo, then assembling them is not all that hard. Could be quite a bit cheaper than a gecko! And you could easily repair them yourself as you would have the schematics and know what the replacement parts are.
Reply With Quote
  #10  
Old Fri 24 August 2007, 09:35
Gerald D
Just call me: Gerald (retired)
 
Cape Town
South Africa
Heath, everybody is not the same. I personally am happy around cutting steel, machining steel, welding, bearings, wiring, volts & amps. I am not comfortable around millivolts, milliamps, oscilloscopes and pc board soldering. I happily buy electric/electronic modules and wire them together, but I try to avoid building the modules themselves. Somebody else (like Aubrey) would want to build the modules themselves. There is room for everybody - that's what makes the world an interesting place.
Reply With Quote
  #11  
Old Fri 24 August 2007, 09:48
Aubrey
Just call me: Aubrey
 
Jhb
South Africa
Comments

Hi Les,
I see you are from the USA. You guys are LUCKY in that you earn US$, are able to source the good stuff LOCALLY, and the pricing is reasonable considering the average pay packet earned in the USA.
Its not that I dont want to use Gecko drives, I (like many people who dont live in the USA ) simply cant afford them!
As far as "re-inventing the wheel" goes, this thread was headed that way in the beginning before I had done MANY hours of Googling but then I found the PICStep design (via pminmo's site - thanks for the heads-up Heath) which, judging by the feedback, performs remarkably well.
The parts (9 resistors = ZAR9.00, 13 caps = ZAR30.00, PIC16F628A = ZAR20.00, and maybe ZAR10.00 of other stuff and of course the PCB at ZAR50.00 ) can be guestimated at approximately ZAR120.00 per motor driver board.
Add approx ZAR 100.00 for the power transistors etc makes it ZAR 220.00
Compare this to the Gecko at US$ 399.00, postage/packaging, VAT, import tax etc makes it about US$450.00 (may not be entirely accurate - has anyone in SA imported Gecko's? maybe you can give a more accurate figure.)
Now you take the exchange rate (ZAR 7.24 per US$ as at 5pm local 24th Aug 2007) and you get ZAR 3258.00 PER BOARD!
To put it in perspective, this is more than my monthly bond repayment and I for one simply cannot afford it!

Gerald:
naughty naughty!
I think that the problem is that the guys in the USA dont realize how fortunate they are to be able to buy equipment at a reasonable price locally and pay for it in local currency.
Maybe if they could build a driver board for 20% of the Gecko's price that gave 80% of the performance, they would see the advantages. After all, how many cutters could you get for US$300.00?

Mike:
Thanks for the confirmation
From your help in the first thread, I gather that you know your way around a transistor.
May I respectfully request that you keep an eye on this thread and if you see something that is going to be dangerous (like the charge pump issue) please give us a "heads up" so that we dont blow ourselves up. (BTW Is UT Utah?)

To all the "Lurkers" if there are any.
Please say hi - it would be nice to know if there are others who are not able to get thier mill project going due to the cost of the electronics.

All the best
Aubrey
Reply With Quote
  #12  
Old Fri 24 August 2007, 10:10
Gerald D
Just call me: Gerald (retired)
 
Cape Town
South Africa
Quote:
Originally Posted by Aubrey View Post
Made a few phone calls to price the LMD18245T locally......
With VAT about ZAR 310.00 EACH!
National gives a budget price of $9.61 for that chip - the ZAR 310.00 that Aubrey was quoted locally is $40. And to put that $40 in perspective, that is about the daily wage of an engineer fresh out of college (less than half our population earns that much per day)
Reply With Quote
  #13  
Old Fri 24 August 2007, 10:53
Richards
Just call me: Mike
 
South Jordan, UT
United States of America
Aubrey,

I'm always happy to give advice - just ask my kids! UT is Utah, a great place to live and an even better place to raise a family.

Good luck with your project. Building a stepper driver was one of the most challenging things that I ever tried. After frying transistor after transitor, I finally decided to just buy pre-packaged steppers and stepper drivers from Oriental Motor. First, I used the Vexta series that cost about $900 each and then went to the CSK series that cost about $300 each - for the much smaller PK268 size motors. The Vexta motors and drivers gave me about 900 RPM - max. The CSK would only go half that fast, but it was fast enough for the project where it was used. Gerald wrote about the Gecko drivers several years ago. At first glance, I couldn't see why anyone would use something that micro-stepped and that only had four connections available to hook-up a motor. Well, Gerald knew what he was talking about and I soon realized that the Gecko stepper driver was thee best stepper driver available - bar none.

In theory, a chopper drive for a stepper motor uses two voltage levels - a high level that is 10 - 20 times the motor's rated voltage and a low/normal level that is the same as or a little less than the motor's rated voltage. Every time a step pulse is sent to the motor, the high voltage forces current through the motor. Because of inductance - or resistance to change - it takes a certain amount of time before the voltage actually starts to rise in the motor's coils. A sensor circuit monitor's the motor's coils. When the sensor detects that the voltage in the coil is almost at the motor's rated voltage, a circuit 'chops' off the high voltage and uses only the low voltage. In very simple terms, that's basically what needs to happen. But, like they say, the devil is in the details. Getting circuits to sense fast enough and getting switching transistors to switch fast enough and still getting sufficient performance out of the motor is very difficult. It will definitely an adventure for you.
Reply With Quote
  #14  
Old Fri 24 August 2007, 11:10
domino11
Just call me: Heath
 
Cornwall, Ontario
Canada
Gerald,
Yes I understand the differences in peoples abilities/intersts but was just curious as to yours. You seem like a real hands on person and just thought you might have done some dabbling in the driver area. I have experience in electronics (hardware designer) so maybe I am a little biased. I also dabble in things that arent my forte, but thats where the cutting and welding is my sideline hobby.
Reply With Quote
  #15  
Old Fri 24 August 2007, 11:37
Gerald D
Just call me: Gerald (retired)
 
Cape Town
South Africa
Quote:
Originally Posted by Richards View Post
Gerald wrote about the Gecko drivers several years ago. . . . . . . . . Gerald knew what he was talking about
*blush*

I am surprised that I am being credited with introducing Gecko's to Mike

It must have been about 2-3 years ago that I was hunting down alternatives to the IMS481H (not the "Plus") that was briefly used by ShopBot at the end of 2000, beginning of 2001. We went through a batch of frying a couple and spares were priced ex-SB at $150 each (?). Visited many forums and discovered the talk around the Gecko and did lots of digging around it. Mike probably uncovered some of my diggings and took it from there.

(SB discontinued their problematic association with IMS, who couldn't deliver fast enough, and then built their own driver boards with Allegro chips. In the changeover they added 3.6:1 gearboxes because their Allegro driver was only half-stepping while the IMS481 was set up 1/8 stepping)
Reply With Quote
  #16  
Old Fri 24 August 2007, 12:34
Aubrey
Just call me: Aubrey
 
Jhb
South Africa
Hi all
To start, first we have to see how it all fits together.
What I've done is taken the schematic, copied the necessary pieces and "wired" them together using gaudy colors.

The original is on Alan the designers's sight
Now all that needs to be done is to figure out what is needed to replace the LMD while maintaining the functionality (or at least the most important parts of it!).
Speaking of Alan, I dropped him a mail telling him that someone (me ) is busy hacking his good design. I did this so that there can not be any "you stole his concept" type accusations by his fans at a later date. Cant be too carefull.
One thing that is confusing me at the moment is the "Direction" pin (pin 11) on the LMD which is connected (the green lines) to pins 12/13 on the PIC. May have to really study the PIC source code to see what's happening here.

Mike:
At Last!!! A little light went on in the old brain when I read your "chopper drive" contribution. Starting to make sense - SLOOOWLY! I hope that the LMD hasnt got that sort of stuff going on. If it has, I think I have a problem!

Oh well, lets go download the spec sheet and print a few copys.
Have a good weekend all.
Aubrey
Attached Images
File Type: jpg ripped_schematic.jpg (158.3 KB, 1053 views)
Reply With Quote
  #17  
Old Fri 24 August 2007, 13:34
domino11
Just call me: Heath
 
Cornwall, Ontario
Canada
Aubry,
Actually, Im not sure what type of driver chip Mike was referencing, but I do know that the LMD18245 used in the pic step uses a constant current chopper drive. Essentially they use a higher than rated supply voltage so that when you switch on the winding in the motor, you can reach full rated current very quickly. The chopper action ensures that you dont over current the motor winding and fry your motor. Maybe Mike was thinking of a timeout holding power reduction. The picstep firmware has the option for this as well. However some people dont like this as the stepper might not have as much holding power in the reduced power mode. I am not sure how this works out in real life as I have not tried a timeout power reduction driver. I myself would use the non timeout version for the extra holding power when the motor is not moving. National has a good ap note called Increasing high speed torque for bipolar stepper motors AN828 if you are interested
Attached Files
File Type: pdf AN-828.pdf (808.2 KB, 64 views)
Reply With Quote
  #18  
Old Fri 24 August 2007, 15:01
Richards
Just call me: Mike
 
South Jordan, UT
United States of America
You guys are way past me. I was describing the theory behind building a circuit from the ground up, without any "pre-packaged intelligent chip(s)" being part of the circuit. Using something like the LMD18245T chip and the PIC processor would eliminate about 90% of the design time. I don't have any experience with either product, so I'll have to study the data sheets. I do know that the various PIC processors are popular in a lot of projects, but, since I have the tools and programmers to work with the ATMEL 8051 type micro-controller, I've not taken the time to look at the PIC.
Reply With Quote
  #19  
Old Fri 24 August 2007, 15:35
Aubrey
Just call me: Aubrey
 
Jhb
South Africa
Almost beaten into submission!

Aaaaaaaagh!!!
Never mind frying the board! I've just fried my mind
This LMD gizmo is WAY above where I am as far as electronics is concerned!

To everyone who read this thread and thought "This idiot does not know what he's getting into", you were right! But that is cool! All it means is that it is going to take a little longer to reach the destination.

OK. If your goal is out of reach, set yourself a goal that IS attainable and will get you nearer to the original goal. I often said this to people I was teaching PHP and MySQL. - Time to take my own advice!!!

Original Goal: Replace the LMD with cheaper components and retain most of the functionality. The problem is that at this stage of my electronic experience, I dont understand what half the functionality is, never mind how to do it!

So.........

Attainable Goal: Forget about mega-voltages, chopper circuits and all the rest for the meantime, just use the voltage that is specified on the motor. In my case that is 10 volts, 5.0 VA or .5 amps. Forget about supersonic speeds and torques! Must crawl before walking before running may be a good motto in this case. At this point in time, I dont care if it moves slowly, it must just move! I get enough supersonic G00's at work - gives me heart attacks every time!

I still maintain that the PICStep is a great starting point up to the high power driver section so that is what we will use. Instead of taking the outputs of the PIC to the LMD chips, take them to 2 sets of 4 terminal blocks via opto-isolators. That way we can replace the power driver section without having to re-do the whole board. By taking the LMD chips out of the picture, it may be possible to make the board single sided without too many jumper wires - will have to fire up Eagle sometime and do some work on that aspect. Will have to get my PIC-Kit working again, Windows seems to have forgotten how to communicate with it but thats normal for Bills Revenge.

So to start:
Transistors can switch switch voltage on/off or ground on/off, not both.
Therefore we will need 1 transistor to switch the voltage and another to switch the ground. Both these transistors need to be connected to the same trigger pin so how do we do that?

Questions:
1) Will the attachment circuit work (in theory)?
2) If there is a possibility that the transistor that is NOT switched in do some "leaking" and cause a partial or total short and if so, how can it be prevented? Maybe use OR gates or some other logic to prevent shorting or if the circuit wont work in the first place, to get it to work.
3) Do I have the transistors in the correct places and are the diodes correctly orientated?
4) Do I need to add switching transistors to drive those in already the circuit or will the output from the PICStep be enough? I think the transistor in the opto should do the trick.

Thanks for reading this and if you could spare the time, answers and suggestions would be greatly apprecicated.

Best
Aubrey
Attached Images
File Type: jpg pushpull.jpg (23.8 KB, 991 views)
Reply With Quote
  #20  
Old Fri 24 August 2007, 18:23
Les Filip
Just call me: Les
 
Austin, Texas
United States of America
To All,

Like I said before, I did not mean to be rude when questioning the need to re-invent a Gecko. But I still don't quite understand how it could be worth recreating one, even if exchange rates and shipping costs are as unfavorable as I'm seeing. Maybe I need to brush up on my math lessons.
Reply With Quote
  #21  
Old Fri 24 August 2007, 21:32
Greg J
Just call me: Greg #13
 
Hagerman, New Mexico
United States of America
Aubrey,

I'm just a "lurker" and just wanted you to know your an inspiration. I tried the "PIC" programing route about 8 years ago when I needed some timing circuits for an irrigation gate I was working on (its a long story). I couldn't do it because it was over my head.

Anyways, thanks for the insight on building something in SA. The problem really sounds like an import/export issue. Just thinking out loud, I'll keep reading this thread and if I can help I'll add my two cents (USD).

Oh, when having a hard time with a problem, I step away from it for 24 hours (put it out of your mind) and then re-visit it. It's very en-lighting when you re-focus on the problem.

Greg
Reply With Quote
  #22  
Old Sat 25 August 2007, 10:44
Aubrey
Just call me: Aubrey
 
Jhb
South Africa
Hi Les:
Dont worry about being "rude", I'm of Irish extraction and can take it!
I've found that often the "top of the range" stuff is way better than what I need and more often than not, way out of my budget.
Its also a case that the USA is an affluent country with easy access to almost any resources. After all, Gecko is made right there, no export or import taxes, duties and all the rest. Remember that within 10 miles of where I live there are thousands of people who survive on less than a Dollar(US) a day. Its just the way it is.

Maybe we should call this the "80/20" controler - 80% of the functionality, 20% of the cost. I dont care if it is not as fast as another design of driver, it must fit in my budget and it must work - even slowly, I'm not too fussy. After ll, it is a hobby!

All I need at this stage is to get a mill to move under its own steam. I finished the X and Y axis on a very small mill (to cut PCB's) about 18 months ago but "the electronics!!!"

I made up my mind (with a "little" help from the wife ) that I am not going to start on my MechMate untill I am able to make the driver boards PCB Mill. She hasnt found out yet that I have already collected most of the raw materials for it.

Even if the 80/20 is not a world beating winner, if its affordable then who cares that it can only do half the speed as the top of the range unit. At least my mill will have life.

Time to get off the soap box!

All the best
Aubrey
Reply With Quote
  #23  
Old Sat 25 August 2007, 13:23
Aubrey
Just call me: Aubrey
 
Jhb
South Africa
To Greg:
Welcome! Sorry to tell you that I'm no "inspiration". I'm just an idiot who wont accept "cant" or "because I say so" for an answer. But thanks anyway

Re: Circuit.
Spent the day at an "Artist in the Park" exhibition (wifes oils and watercolours) so I had a lot of time to think. (NOT always a good thing!)
The circuit as it stands MAY work but if an opto isolator were placed between the PIC and the circuit as shown, when the PIC went high, the appropriate transistor would trigger. However, when the PIC went low, the opto would switch off. In effect that means that the part of the circuit that is supposed to connect the 0 volt line to the motor lead would never fire.

To get around this, we could put a "pull down" resistor just behind the base to get the voltage to 0 volts should there not be a 5 volts present.
Unfortunately, the time that it takes the line to get to 0 volts via the resistor may be important.

The next question is "Would the transistor connected to the 0 volt line fire if 0 volts were presented at the base?". Probably not I suspect.

So what do we do about it?
The most likely solution would probably be to put some sort of logic gate in there to supply a voltage to the base when 0 volts is required.
I see a visit to a number of logic tutorials in my immediate future

But hang about! What if we had 2 logic gates, both having a pin connected to the opto-isolator and the other "criteria" pins (I'll get the correct terminology and gate type when I check out the tutorial) connected to 5 volt and 0 volts respectively.
When the PIC pin (and therefore the opto-isolator outpt) is 5 volts (assuming an AND gate) then the gate with the 5 volt connection should go high and fire the transistor.
The other gate (being connected to the 0 volt line) should fire when the voltage on the PIC (and therefore the opto-isolator) is NOT 5 volts. (A NOT AND gate or maybe more correctly a NAND gate?)
This should put 5 volts on the other transistor which should fire it reliably.
But we should still have a "pull down" resistor in there somewhere which may (or may not) cause some delay in switching on the transistor supplying 0 volts.
Looks like whichever way we go, the 0 volt line is going to have some sort of delay! Question is "Is it something to worry about or is it so short that it can be disreguarded in this application?"

And that (with a bit of lateral thinking) raises the next point:
"Fancy" driver boards use 50 volts or more to accellerate the voltage rise from 0 volts as a 50 volt signal will rise to 10 volts faster than 10 volts will rise to the same 10 volts, simply because there is 5 times more "punch" in a 50 volt feed as compared to a 10 volt feed.
The "chopper" part then takes over and reduces the supply from 50 volts to 10 volts as soon as the effective voltage has reached the 10 volt mark and thus gets everything at its peak as quickly as possible and the motor is saved having to deal with an effective 5 times overvoltage situation.
The 0 volt transistor will always fire "later" than the 10 volt transistor connected to the other end of the motor winding due to the time it takes for the "pull down" resistor to get the line below the point where the effective voltage on the resistor leg away from the 0 volt rail is below the point where a logic device will register it as 0 volts.
If the 0 volt transistor fires before the 10 volt transistor has fully reached 10 volts, maybe we can increase the firing delay on the 0 volt transistors (ALL of them!) to allow the 10 volt transistors to get to 10 volts BEFORE the 0 volt transistor fires. This way, we wont need the 50 volt supply and the chopper circuit to control things and limit the actual voltage to 10 volts as we are already there due to the CONSTANT delay between the 10 volt transistor firing and the 0 volt transistor firing!


Or maybe I've been looking at the voltage rise in the wrong component!
If the "resistance to voltage rise" is not an issue in the transistor, but in the coil of the motor, the above rambling (highlighted in Red) is nonsense due to my not understanding the problem and functionality correctly.

HELP! Rip it apart if its wrong. Call me names! I dont care! As long as at the end of it, I UNDERSTAND the issues involved, I dont mind.

As I have another "Artist in the Park" day tomorrow, I'm now going to bed. It was a long, sunburned day.

To the guys who know what they are talking about, I think that somewhere I am not understanding something. PLEASE help me out.

All the best
Aubrey
Reply With Quote
  #24  
Old Sat 25 August 2007, 13:42
Aubrey
Just call me: Aubrey
 
Jhb
South Africa
The original question

Originally I wanted to ask whether this circuit would work or blow up. If it is going to "bang", is there a low cost way of "un-banging" it?

The idea is to switch on both transistors at the same time and then switch off the one carrying the 50 volts after X nanoseconds where X is the time that it takes for the voltage in the motor coil to build up to 10 volts.
My gut tells me that something will melt but I have to make sure.
If it is going to melt then we will have to switch on the 50 volt transistor and after X nanoseconds, switch it off and switch the 10 volt transistor on to get the chopper effect. If the timing isnt right, there will either be a bang (both transistors on at the same time) or the motor will loose power due to a "no voltage" condition being present after the 50 volt transistor is off and before the 10 volt transistor is on.
Why didnt I try tackling something easy - say time travel?
All the best
Aubrey
Attached Images
File Type: jpg dualvoltagefeeds.jpg (9.3 KB, 1007 views)

Last edited by Aubrey; Sat 25 August 2007 at 13:46..
Reply With Quote
  #25  
Old Sat 25 August 2007, 23:15
Richards
Just call me: Mike
 
South Jordan, UT
United States of America
Aubrey,

It's time to dig out some information on "bi-level" DC circuits and Emitter Followers (a way of connecting NPN transistors) and Steering Diodes to control the way that DC electricity flows through a circuit.

In essense, you need to turn on two transistors to allow bi-level voltage to flow through a coil. After a period of time, or when a sensor detects that the coil voltage has risen to a certain set-point, the transistor carrying the higher level voltage is shut off. The steering diodes keep the high-level voltage from leaking into the low-level voltage. It's just basic electronics, but in order for that kind of circuit to work, you'll need to master a lot of the basics. Learning those basics takes time - lots of time. By the time that you really understand it all, you'll have probably built hundreds of circuits and spent thousands of dollars on parts. (Sorry, learning about electronics is not simple for most people. I was probably slower than most. The only thing that made it all bearable was that every experiment taught a valuable lesson - especially the ones that didn't work.) To be able to build a stepper driver that really works would take the ability and experience of an electrical engineer with an advanced degree. In my part of the world, that means at least five years to get the bachelors degree and another two or three years to get the masters degree. Formal training at a university is not required, but you'll surely find yourself studying the same material in much the same manner as the university students before it all becomes clear. Sometimes someone posts a schematic that shows how a circuit works, but until you understand what every component in that schematic does and why it is necessary, you most likely won't be able to design circuits of your own.

This isn't meant to discourage you. Electronics is (are) fun! Seeing mechanical things function with the help of electricity is fascinating. And for those of us who want to build our own machines, knowing how things work is a necessity - unless we're willing to call in an expert every time something stops working.

But, learning electronics is no harder than learning math or another language. In fact, because of a terrible experience I had with math in 9th grade, I really struggled with math clear through 12th grade. In college, I opted out of math and science by studying a foreign language. All that did was postpone learning math. For the last thirty+ years, I've had to use math every day as a computer programmer and as a designer of process control computers. However, I still stumble around the math. I have to check and re-check each equation because I've learned how to use formulas to solve each problem, but I still don't have a good understanding of math priciples.

So, if you have a friend or neighbor or relative who is really good at electronics, become his best friend. That's almost what I did. Years and years ago, I owned and operated a photo finishing business that only served professional photographers. My customers demanded top quality. Giving them top quality meant that I needed a Video Color Negative Analyser (a close circuit television that cost $40,000 back in 1977). I didn't have even $1,000, so I asked around to see if there was an alternative. It just happened that a great electrical engineer had been asking if there was a need for a low priced video color negative analyser. I looked him up that same day. Before long he was personally tutoring me about electronics and I was personally tutoring him about the photo industry. He drew hundreds of basic schematics for me until I finally understood how a resistor worked, how a capacitor worked, how a TTL gate worked. He taught me how to work systematically through a problem and most of all, he encouraged me to stick with it. It really took years and thousands of dollars for parts before I was able to design reliable process control circuits of my own. Thanks to George, it was an enjoyable journey.

Stick with it Aubrey and don't be too disappointed if there are a few problems along the way.

Edited:
Now that I've probably ruined your weekend, I should probably tell you two more important points. A stepper motor that only runs at its rated voltage will take 1 to 3 mS per step. So, a 1.8-degree stepper (most steppers used in CNC routers are 1.8-degree motors) will take 200 steps per revolution. That means that it will take between 200 and 600 milliseconds for the shaft to turn one time. That's not too bad, except for the fact that the per-step resolution on a 200 step motor is going to be really bad - ten times worse than a Gecko micro-stepping driver gives. If you were able to design a 10X micro-stepping circuit for your stepper driver, and if you had to live with the same 1 - 3 mS per step, each revolution would take 10X longer.

Sorry for the additional bad news.

Last edited by Richards; Sat 25 August 2007 at 23:29..
Reply With Quote
  #26  
Old Sun 26 August 2007, 14:06
Richards
Just call me: Mike
 
South Jordan, UT
United States of America
Aubrey,

I've been mulling this over since you first posted. My suggestion would be to talk to your potential customers. Explain to them what you will be able to do once you have the machine built. Ask them to help front the costs to get the machine going.

Building your own driver controllers can certainly be done, but when you figure in the cost of missed business, its just too expensive to delay a project because of a few hundred dollars.

That's basically what I ended up doing in my photolab business. Even though George (in the post above) made a wonderful closed circuit television and even though he was a wonderful tutor and even though I traveled all over the United States installing his machine and teaching people how to use it (every week-end for a year in 1977), I ended up buying the VCNA from Kodak because the $40,000 machine did the job and George's machine didn't do the job as well. It just took a few minutes on a spreadsheet to see that even though the $40,000 machine from Kodak was almost 7X more expensive than George's machine, that within a year, the amount of waste generated by George's machine would end up costing me more than the Kodak VCNA. I met with several customers and asked them to commit to continue sending me their work so that I could qualify for direct financing through Kodak. They were happy to help and Kodak was willing to sell a machine to a guy working in a rented apartment in far off Utah. Within a year of getting that VCNA, Kodak was sending top people from their company to visit my lab to see how someone working from his basement could print 1,500 negatives an hour while their own labs, using the same equipment were printing 250 negatives an hour.

Everything is possible. Re-inventing the wheel is not always the best way to solve a small problem. Instead of thinking that the Gecko stepper drivers are too expensive, be creative and think of products that you can make once you have the machine built. Form some type of co-op, if necessary, where you guarantee to cut parts for members of the co-op at a reduced price if they're willing to help you get the machine and other tools needed to cut those parts. You'll all benefit - if you work together a little and help each other out.
Reply With Quote
  #27  
Old Mon 27 August 2007, 07:48
domino11
Just call me: Heath
 
Cornwall, Ontario
Canada
Aubrey,
I am still wondering why you want to DESIGN your own controller. With the multitude of great driver chips available these days, and board layouts and schematics available at www.pminmo.com and www.fromorbit.com of circuits using the most popular chips out there. These are the same chips used in boards from places like hobbycnc and the like. The other thing is that these designs work. Check out post over at www.cnczone.com and you will hear of the people using these designs. A driver board with the allegro 3977 or the national lmd18245 will more than adequately drive the steppers used on the mechmate. You can use the 1 amp or 2 amp version of Geralds recommended motors. (Hint the 2 amp version has a much better torque curve). I am an electronics designer in my day job and I fully understand the interest in designing something yourself, but just ask Phil at pminmo.com or Alan at fromorbit.com how long they have worked to get their designs working as well as they do. Both guys are great and will drop you a line if you email them a question. Sometimes its better to use a proven design and just do the building of the boards yourself!

Doing your own design is possible but just very time consuming and expensive, as mistakes corst you time and parts.

If you need parts for a board give me a pm or email, I might be able to help you out.
Reply With Quote
  #28  
Old Mon 27 August 2007, 14:56
Aubrey
Just call me: Aubrey
 
Jhb
South Africa
Hi Mike
No you didnt ruin my weekend - sitting in the park freezing in the wind did a good job of that! But on the plus side I did a lot of figuring things out with regard microstepping - got a question ot two with regards this but will get to that in a later post.
I'll google "bi-level dc circuit" and see what comes up - thanks.
After reading your posts I think you have probably read me better than I read myself. Apart from making circuit boards and fancy frames for Nelly's art (Nellie is the better half!) I have come to the realization that this thing that I have about building a cheaper moustrap has its roots in the fact that in the late 60's and early 70's I started to get into electronics. Built a number of basic (by todays standards) lighting controlers, power amplifiers and effects boxes for guitars for a number of discos, bands and suchlike.
Unfortunately, life got in the way and I stopped playing with transistors.
At this stage of my life, the interest has re-surfaced so its time to re-learn what I knew (and have forgotten ) and catch up on everythiing that has come along since then.
Fortunately, I have the ability to think things through (as opposed to simply taking what is said as fact) and usually pi$$ people off with so called "stupid questions" which normally arise because I dont understand what has been said. The "charge pump" issue in the "Lower Cost Electronics" was an example of me not understanding what the actual issue was. I didnt understand why one was needed. Once the light went on it became abundantly clear that in order to have a "safe" breakout board, the charge pump was critical.
One of the "gifts" that I have is that I pick things up quickly. I learned ASP programming from scratch in a week, had an inventory package up withing 2 weeks, became proficient in PHP in about 6 weeks (a rather complex insurance call center system was the immediate result) but I think this electronics thing may just take a little longer.
What will make the process a lot easier is the internet and the volume of information available, not to mention people like yourself who take the time to help stumbling idiots like me.
And I will stick to it! The first thing I did to make some order out of the chaos was to write a little browser based inventory program to keep track of the bits in my newly aquires parts drawers. If anyone wants a copy, PM me and I'll email you the code and setup instructions - it works well on WAMP (Windows Apache Mysql Php).

My only concern is tht Gerald will not like me taking up server space and time on a subject that may (or may not) be what he had in mind for this site.

Regarding the "additional bad news", the PCB mill has a 16mm x 2mm pitch lead screw, the motor is a 200 step/rev unit which gives me 2mm travel per rev or one onehundreth of a millimeter per step. That should be accurate enough for the job or have I got that one wrong too? At work we very seldom (only for medical devices so far) go to the micron level. As to the future MechMate, you will not be able to measure much better than a quarter millimeter anyway and a little bit of fine sandpapering would surely blend in any lumps and bumps.

As to the speed, 600 ms per rev = 300 ms per millimeter = 3.33 mm per second = 200mm (or about 8 inches) per minute which doesnt seem such a bad speed for cutting a PCB. At least the mill is alive and the job is getting done.I used to be into oval track racing and rallying and suchlike and I must admit that as I have gotten older, my need for speed has reduced.

As an aside: I often read with a smile, both here and on other cnc sites, guys wanting to get tollerances approaching the micron range with thier machines. In most cases they are cutting wood!!!! Even if they get the size correct to the 5 micron level, tomorrow when the humidity has changed, so has the size. I wonder why that level of accuracy on an unstable (at the micron level) medium is an issue. I'm not flaming anyone, go for it if you are able to, all I'm saying is that it simply does not compute in my grey matter.

The "Co-Op" idea is a good one. I may be able to set something up. Will have to do some thinking on that one.

Hi Heath,
I think the above explains my "somewhat futile" mission. However, for a number of us price is a dealbreaker.
I have been all over both Alan and Phils sites, I even emailed Alan to give him a heads-up about what I intend to do to his excelent PICStep creation just so that no-one can tell him that I am ripping off his good work for private gain.
I dont know whether either Alan or Phil are members of this forum as the member list has been disabled.
I agree with you that a proven design would be a better option but if I can get it done using bits from old hifi amps and such, my mill will be up and running sooner than eventually when I win the lotto.
I also admit that it wont be too long untill 8 inches/minute will start to agravate me but I can assure you that 0 ipm is agravating me a whole bunch more at this time.
By using "power" transistors that cost less than $0.50 each (need 8 per axis) to get the mill moving (however slowly) makes things a whole lot more affordable to some of us not lin the USA or Europe. If I manage to find (and more importantly, understand) the "bi-level" lead given by Mike and impliment this concept (probably as a version 2 option) then we have a chopper driver. At this stage I shudder to think of the troubleshooting that will probably have to be done but anyway....

As to the offer, you will definitely hear from me at some stage - thanks

Anyway, bed time. See you guys tomorrow.
Best
Aubrey
Reply With Quote
  #29  
Old Tue 28 August 2007, 02:17
Gerald D
Just call me: Gerald (retired)
 
Cape Town
South Africa
No problem with the server space. As I've said before, this MechMate project is all about people wanting the DIY route. When are you winding your own steppers?
Reply With Quote
  #30  
Old Tue 28 August 2007, 07:39
domino11
Just call me: Heath
 
Cornwall, Ontario
Canada
Gerald,
I just noticed your post 4:17 am? I hope that doesnt take into account the time difference! Or do you stay up that late?
Reply With Quote
Reply

Register Options Profile Last 1 | 3 | 7 Days Search Today's Posts Mark Forums Read

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 12:19.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.