CNCzone.com-The Largest Machinist Community on the net!


Welcome to the CNCzone.com-The Largest Machinist Community on the net! forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > Machine Controllers Software and Solutions > EMC/Linux (Enhanced Machine Control)

Notices

EMC/Linux (Enhanced Machine Control) Discuss Enhanced Machine Controlers here!


Reply
 
Thread Tools Display Modes
  #1   Ban this user!
Old 10-17-2006, 10:08 AM
samco samco is offline
 
Join Date: Jul 2003
Location: Holmen, WI
Posts: 867
samco is on a distinguished road
Large Brushed servo setup on the cheap (WIP)

Hi - my name is sam.. I am a cheap bastard.

That being said..

I have fallen in love with emc2. Yes that is a strong word but I have. You may have seen me praise the virtues of emc2 in other threads. I try not to be too annoying.

Now back to the subject at hand. Emc2 works with servos as well as steppers. Normally you would buy a servo amp for each axis + an interface card that does hardware encoder counting and servo control out (+/- 10V or maybe pwm). Well servo drives are expensive as well as the interface cards. Emc2 does the pid loop plus it has feed forward 0-2.

One of the gurus on the emc irc channel had mentioned that he had used a h-bridge to run a servo. Emc2 has a Hal module (hardware abstraction layer) that is called freqgen (now there is an even better hal module called pwmgen). This module can be set up to output 2 pwm signals - one for forward and one for reverse - in proportion to velocity. So he had an h bridge hooked up to the pwm out - one pin for forward - one for reverse and read the encoder back in for position (another 2 pins). (parrallel port).

This got a lot of people thinking. This guy made a servo etch-o-sketch using the same principle. http://emergent.unpy.net/projects/01142347802. He used a L298 as the h-bridge and also read the encoders back into the printer port.

Another emc developer converted one of his lathes to servos using the same L298 Bridge. He has had great luck with it so far. Very small following error. (he has not made a page on it yet but is going to)
Here is a picture of his servo mount
http://timeguy.com/cradek-files/emc/DSCN6290.JPG

so what you have is..

Emc2 > h-bridge > servo > Encoder
^_____<______<______<____<___V

Simple servo loop with minimal parts With emc doing the pid

I was thinking - I wonder if this would work with larger servos. That is where I am at at this point. I have created a simple h-bridge using some 44a mosfets and ir2111 bridge driver. (they are 44a 500v but I will be lucky to get 20a out of them because of the power dissipation (rds is .12 ohms)). I got lots of help from one guy who does power circuits for work.

I am at the point right now where I am just testing to make sure the h-bridge is working. I have it hooked up as a spindle in emc2 (outputting s words changes the pwm duty cycle testing the circuit)

Couple of things - issues with the circuit. There isn't any current limiting (that’s what fuses are for right ). I am planning on just winging it like I normally do and see what happens. I am hoping that I can set limits within emc that will keep the current in check. If not then version 2 of the circuit will probably have some simple current limit in it.

This is the ultimate plan for the conversion
http://www.electronicsam.com/images/...DSCCurrent.JPG

Here is the h-bridge circuit as is.
http://www.electronicsam.com/images/...art/almost.JPG

Here is a picture of emc2+axis. (work of art)
http://www.electronicsam.com/images/KandT/Dapper.png

I will post the circuit once I get more farmiliar with eagle. I was just picking componants by the physical size I wanted not the correct package.

I will keep updating this thread with successes and failures

sam
Reply With Quote

  #2   Ban this user!
Old 10-17-2006, 12:26 PM
samco samco is offline
 
Join Date: Jul 2003
Location: Holmen, WI
Posts: 867
samco is on a distinguished road
To explain the K&T
http://www.electronicsam.com/images/...DSCCurrent.JPG
http://www.electronicsam.com/images/KandT/oldkandt.JPG

This is a kerney & trecker horizontal machining center. It is named the Milwaukee matic IIIb. We had gotten it for the price of scrap maybe 15 years ago. Thought we could make it work and did. It has a GE controller on it that is all discrete components. Yes discrete components: ). It worked quite well for the past 15 years but finally died. It had linear and circular inturp up to 9.9999 inches (which wasn't that great but worked)

It has a 60-tool chain. 38"X36"X24" travel. Table that indexes at 5 degree increments. It has Ball screws through-out and tikko(sp) ways (think re-circulating roller bearings for way bearings)

Emc2 will be a nice match - it has ladder logic built in to do some of the tedious things like pallet and tool changes.

Right now it has hydraulic servos but the plan is to replace them with these or similar
http://www.electronicsam.com/images/KandT/DSC_0242.JPG

The emc group has done something similar to a mazak
http://wiki.linuxcnc.org/cgi-bin/emc....pl?MazakRetro
also
http://webpages.charter.net/bengvall...onversion.html

sam
Reply With Quote

  #3   Ban this user!
Old 10-17-2006, 08:57 PM
pastera pastera is offline
 
Join Date: Jul 2005
Location: USA
Age: 41
Posts: 442
pastera is on a distinguished road
I built a version of the etch-a-sketch circuit with some L293b (1 amp). EMC performs very well but cannot keep up with high pulse rates on the encoders.

Aaron
Reply With Quote

  #4   Ban this user!
Old 10-18-2006, 08:55 AM
NC Cams NC Cams is offline
 
Join Date: Dec 2005
Location: USA
Posts: 3,320
NC Cams is on a distinguished road
International Rectifier has created some real neat driver IC's which make it very easy anymore to make H bridge drivers using inexpensive N channel mosfets.

NOTE: with care, you CAN parallel fets to really up the drive capability PROVIDING you can turn them on equally fast and hard so that current sharing is fairly even. We were running 6 in parallel on our RC car speed controls and pulling nearly 100 amps and they ran fine (only at 3khz not 20khz as a servo drives them).

For a single chip servo IC and discrete drive bridge, see if you can find any info on the UC3637 IC. It is supplied by Unitrode/TI.

http://focus.ti.com/docs/prod/folders/print/uc3637.html (samples)
http://focus.ti.com/lit/an/slua137/slua137.pdf (U102 app note, thanks Aaron!!!)

This is a programable +/-10volt servo amplifier IC although with a bit of resistor changes, you could make it run at +/-5 or almost whatever you want.

This neat IC and the hard to find U102 application note provides all the info you need/want in easy to follow format to build a servo amp including speed, direction and pulse by pulse current sensing/limiting. THe current data sheet sucks in that it is in electro-speak making it hard for then non-EE to understand.

Although the power amp for the UC3637 in the U102 app note uses N and P-Fets, it would not be that hard to replace them with N-fets via the use of the current fets and fet driver technology that IR has released (IR2184 or something like that).

The U102 application note from the 1988 Unitrode catalog is hard to find (Aaron found it an it is linked above) and I have no way to scan the copy I have. THis is sad as the U102 shows how to make a much higher current driver than the L298 listed in the current application note (again, thanx to Aaron).

Last edited by NC Cams; 10-18-2006 at 08:53 PM. Reason: add links and fix U102 references - thanx Aaron
Reply With Quote

  #5   Ban this user!
Old 10-18-2006, 08:01 PM
pastera pastera is offline
 
Join Date: Jul 2005
Location: USA
Age: 41
Posts: 442
pastera is on a distinguished road
http://www.ti.com/sc/docs/psheets/ab...ps/slua137.htm

Aaron
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 10-18-2006, 09:30 PM
unterhaus unterhaus is offline
 
Join Date: Jun 2003
Location: Boalsburg PA
Posts: 840
unterhaus is on a distinguished road
I hope you wear a lab coat when you operate that machine!

One of the issues you may have to deal with is braking: the machine is going to backdrive your motor drive circuit when you slow down.
Reply With Quote

  #7   Ban this user!
Old 10-18-2006, 09:58 PM
NC Cams NC Cams is offline
 
Join Date: Dec 2005
Location: USA
Posts: 3,320
NC Cams is on a distinguished road
Fanuc dealt with that problem by shunting an NO/NC relay across and in series with the output of the drive. Bridgeport did it that way too on their V2XT's with servo motor drives.

The NC terminals are shunted across the motor terminals between the motor and drive when the drive is OFF. The NO is in series with one drive leg and is mounted between the drive and the NC terminals during OFF as well.

You can dead short the NC or shunt it thru a resistor to bleed off the backdriven EMF.

During slowdown as opposed to "no drive at all" situations, the amplifier drive has to be robust enough to absorb the back EMF or you have to find a way to shunt the voltage around the controller via a EMF overvoltage sense circuit.

Last edited by NC Cams; 10-18-2006 at 10:01 PM. Reason: added Bridgeport note
Reply With Quote

  #8   Ban this user!
Old 10-18-2006, 10:12 PM
samco samco is offline
 
Join Date: Jul 2003
Location: Holmen, WI
Posts: 867
samco is on a distinguished road
Thanks for all your ideas.

I am planning on getting or making some 250 line encoders or there abouts. That gives me 1000 edges. If I do connect the servos direct drive - that gives me a resolution of .000333" minimum.

emc can count an edge per base period. That mean the maximum I can count at 3000 lines per inch (3 lead ball screw) is

1/.00005(base period) = 20khz

20khz/3000lines-per-inch = 6.66 inches per sec = 400ipm (twice as fast as the machine was originally and the maximum these servos will do 1200rpm).

A 50us period is slow. A decent ghz class computer should do 20us or better.

So it seems very do-able.

NC Cams - The ir2111 is a half bridge driver that uses a boot strap circuit to run the high side n-channel mosfets. Pretty cool if you ask me. The only issue is you can't send it a 100% duty cycle as the boot strap circuit needs the off time to charge the cap. The reason I am doing it this way is that emc can output a pwm signal to directly drive the h-bridge.
Reply With Quote

  #9   Ban this user!
Old 10-19-2006, 09:09 AM
NC Cams NC Cams is offline
 
Join Date: Dec 2005
Location: USA
Posts: 3,320
NC Cams is on a distinguished road
The charm behind the use of the UC3637 is that it also does current limiting - good protection for motors and drivers, especially if you hit a limit stop.

Although you can do lots of stuff with computers, sometimes the use of chips that have a lot of built in protection schemes is much more efficient than to try to have the computer do everything.

Essentially, that is what Bridgeport and other machine integrators did when they used outsourced servo amp. Current monitoring, over/under voltage and other stuff was easier to do remotely and then merely send an error signal to the PC to tell that a fault had occured.

Look carefully at the use of the UC3637. It was designed to do EXACTLY what you want and requires a minimum amount of input to do so. Yes, it requires a pure analog voltage to run but there are surely step/direction to analog voltage converters that one could readily use/create to affect the interface.

In any event, the U102 application note will provide a lot of useful information to you whether you use the UC3637 to build a servo driver or not.
Reply With Quote

  #10   Ban this user!
Old 10-19-2006, 09:04 PM
pastera pastera is offline
 
Join Date: Jul 2005
Location: USA
Age: 41
Posts: 442
pastera is on a distinguished road
My test system falls apart at around 32000 pulses per second, this is on a 1.4GHz AMD.
Bumping up the processor speed will give diminishing returns - the issue is that I/O operations are extremely slow on x86 derivatives. You can have the fastest processor in the world but it won't go any faster than the I/O.

As far as 100% duty cycle on the IR bridge drivers, it's easy to add a secondary charge pump to allow for 100% duty cycle. Check their application notes for a circiut using a 555 timer.

Aaron
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 10-19-2006, 09:17 PM
NC Cams NC Cams is offline
 
Join Date: Dec 2005
Location: USA
Posts: 3,320
NC Cams is on a distinguished road
When we PWM's hobby motors, we often did not run 100% duty cycle and did so intentionally. Unless you knew what was going on, you couldn't even tell.

We ran the buss a bit over voltage and then PWM limited the voltage to 90% or 95% so as to not over speed the motors. The higher voltage gave us a bit more low speed torque due to a higher current potential.

Then again, we were using true servo circuits with current limit which is where the charm of the previously mentionded servo IC really shines. The pulse by pulse current limiting helped prevent demagnitization from the overvoltage we threw at them.
Reply With Quote

  #12   Ban this user!
Old 10-23-2006, 08:04 AM
samco samco is offline
 
Join Date: Jul 2003
Location: Holmen, WI
Posts: 867
samco is on a distinguished road
Didn't play with it much this weekend. I have some cheap encoders coming from usdigital.

I did hack apart a mouse to play a bit..
http://www.electronicsam.com/images/...astermouse.png

You can see I am getting edges atleast every 50uS. So it looks like I sould get my 20k counting rate I was shooting for.

My base period right now is set at 20uS.

sam
Reply With Quote

Reply

Bookmarks




Currently Active Users Viewing This Thread: 2 (0 members and 2 guests)
 
Thread Tools
Display Modes

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 On

Forum Jump




All times are GMT -5. The time now is 02:32 PM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.