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
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 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.
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.
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 09:53 PM.
Reason: add links and fix U102 references - thanx Aaron
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 11:01 PM.
Reason: added Bridgeport note
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.
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.
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.
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.