View Full Version : Large Brushed servo setup on the cheap (WIP)


samco
10-17-2006, 10:08 AM
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/KandT/DSCCurrent.JPG

Here is the h-bridge circuit as is.
http://www.electronicsam.com/images/KandT/servostart/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

samco
10-17-2006, 12:26 PM
To explain the K&T
http://www.electronicsam.com/images/KandT/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/emcinfo.pl/emcinfo.pl?MazakRetro
also
http://webpages.charter.net/bengvall/emc/emcconversion.html

sam

pastera
10-17-2006, 08:57 PM
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

NC Cams
10-18-2006, 08:55 AM
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).

pastera
10-18-2006, 08:01 PM
http://www.ti.com/sc/docs/psheets/abstract/apps/slua137.htm

Aaron

unterhaus
10-18-2006, 09:30 PM
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.

NC Cams
10-18-2006, 09:58 PM
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.

samco
10-18-2006, 10:12 PM
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.

NC Cams
10-19-2006, 09:09 AM
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.

pastera
10-19-2006, 09:04 PM
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

NC Cams
10-19-2006, 09:17 PM
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.

samco
10-23-2006, 08:04 AM
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/KandT/servostart/Fastermouse.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

samco
11-07-2006, 04:13 PM
well I have gotten my 400 line encoders from usdigital. (bought the hub and sensor to mount on the servo).

we found this servo to play with. (just sitting on a shelf ;))
http://www.electronicsam.com/images/KandT/servostart/permotor.JPG
It is a smaller than the monster servos we have and will be a bit saner to test ;). I pulled the tach off the back and the shaft coming out is .375 - exactly the size that we bought the encoder hubs. Score!

I hooked it up to the h-bridge (still set up as a spindle in emc) and found out what low inertia servos are like.. I could switch from 2500rpm to -2500 rpm and the thing wouldn't even twitch. Pretty cool.

Hoping tonight to mount the encoder and close the servo loop.. (change it to an axis)

sam

DennisCNC
11-07-2006, 09:08 PM
You are all over this project! Keep up the good work!!

samco
11-07-2006, 09:41 PM
Cool - just cool.

I closed the loop tonight - mounted the encoder and hooked it into emc.. I hacked the etch-o-sketch hal and ini files to work with my setup.

It is cool trying to rotate the shaft and have it fight back ;) - also it is cool being able to turn the shaft in estop and have the position update. (first time I have hooked an encoder into emc2)

The pid loop needs to be tuned - but it worked well enough to see the concept. Again - very cool. The emc2 developers are awesome.

http://www.electronicsam.com/images/KandT/servostart/mess.JPG
(don't have the heat sinks mounted yet :o)
http://www.electronicsam.com/images/KandT/servostart/Endoder1.JPG
http://www.electronicsam.com/images/KandT/servostart/Endoder.JPG

sam

samco
11-15-2006, 08:11 AM
mounted one of the 'smaller' servos on the z axis of the gantry. I still have to learn how to tune pid loops. It works though. like I said before pretty damn cool if you ask me. Very little hardware and poof - servo control through pc.

This servo isn't the most powerful... but we where running z at 150ipm - the drive was taking 5 amps. we could get it to use 20amps by trying to move the shaft.

http://www.electronicsam.com/images/KandT/servostart/servoz.JPG
http://www.electronicsam.com/images/KandT/servostart/sinks.JPG

sam

Willbird
11-22-2006, 10:20 PM
That machine looks roughly the size of what eventually became a KT-200 ?? I have run 800 and 200. The ones we had were straight shank at first then we changed them over to Cat taper. If your machine is like a 200 there is more Y travel avail than the machine thinks it has, we got darn near another 1" travel out of them for a certian job. The 800's especially wehn you look at them close and see the mles and miles of weld used to build one your mouth will drop open.

Fine fine machines :-)...the like of which will never be made again. 10 years ago K&T was buying all they could get their hands on to put new controls on them. Takes some getting used to to use F0 for rapid :-)....With the new controls it is kind of nice to have the tool change also turn on the H and D offset for that tool...and you can set it up so the work offsets automatically kick in for a given B position....our 800's with the new controls would do 4 axis G01 at once too. The new controls also brought the function of having each axis only rapid as fast as it had to to arrive at the XYZB location at the same time as the axis with the furthest distance to travel.

That Z axis sure has some mass to it, it is something to see when a guy gets a TLO off by several inches on a taper shank drill over 1" dia and all that mass breaks it to toothpicks :-).

As old as our oldest 800 was it had METRIC hydraulic lines on it.

Before they retro the new controls on the machines used the old pin reader to discern the tool numper from feeling the rings on the toolholder, they would get chips in them and do some funky crap :-)....and the rings were such a PITA to change that a toolholder once it was Tool #1 pretty much stayed Tool #1 forever :-)....there was a special part that screwed into the back end of the toolholder so that the tool was PULLED into the spindle, we only used them on endmills...if you didnt use one a large endmill would get sucked out of the straight collet spindle by the helix on the cutter.


Bill

Willbird
11-22-2006, 10:26 PM
Another thing I remember about those machines, now and then you will have some issues with part geometry, get to checking the machine with a test bar and an indicator, the pallet will indicate 0..0..0..0..0..0 all alog the front....but go back in Z and she falls away, means the shoulder is breaking off the cups the pallet sets on, pretty common, they will all maybe eventually break given heavy enough parts and enough cycles. We ran 800lb parts on both pallets of an KT 800 pallet changer.


Bill

samco
11-23-2006, 10:07 AM
That machine looks roughly the size of what eventually became a KT-200 ?? I have run 800 and 200. The ones we had were straight shank at first then we changed them over to Cat taper. If your machine is like a 200 there is more Y travel avail than the machine thinks it has, we got darn near another 1" travel out of them for a certian job. The 800's especially wehn you look at them close and see the mles and miles of weld used to build one your mouth will drop open.


I am not very informed about the k&t models. But yes - The amount of welding that was used to create these things is unreal. The plate steel is around 1"+ thick and it is welded up into a box frame. We have never tried to get any more movement out of the machine as we have been using the orginal controller which we where just happy it worked :). (which now doesn't).. Also the tiko(sp) ways - Think roller bearings for way bearings.


Fine fine machines :-)...the like of which will never be made again. 10 years ago K&T was buying all they could get their hands on to put new controls on them. Takes some getting used to to use F0 for rapid :-)....With the new controls it is kind of nice to have the tool change also turn on the H and D offset for that tool...and you can set it up so the work offsets automatically kick in for a given B position....our 800's with the new controls would do 4 axis G01 at once too. The new controls also brought the function of having each axis only rapid as fast as it had to to arrive at the XYZB location at the same time as the axis with the furthest distance to travel.


With the old controller - f99 was rapid - 150ipm :) (f98 was 98ipm). I don't see us making B a full axis. It has a cirvix(sp) coupling that gives us 5 degree indexes. Maybe in the future.


That Z axis sure has some mass to it, it is something to see when a guy gets a TLO off by several inches on a taper shank drill over 1" dia and all that mass breaks it to toothpicks :-).


I have formed metal by accident when inverting x and z by accident.


As old as our oldest 800 was it had METRIC hydraulic lines on it.


hydraulic english here :)


Before they retro the new controls on the machines used the old pin reader to discern the tool numper from feeling the rings on the toolholder, they would get chips in them and do some funky crap :-)....and the rings were such a PITA to change that a toolholder once it was Tool #1 pretty much stayed Tool #1 forever :-)....there was a special part that screwed into the back end of the toolholder so that the tool was PULLED into the spindle, we only used them on endmills...if you didnt use one a large endmill would get sucked out of the straight collet spindle by the helix on the cutter.



We where trying to decide if we wanted to use the rings on the tool holders or use the tool position in the chain. With emc2 I think either would be possible.

It is cool finding someone that is farmiliar with the k&t line. Granted this one is very old. Still it must have been cutting edge in its day as the options on it are touted as 'new' on new machines.

thanks for the heads up on the pallet line-up pins. It has had a pretty easy life since we have had it.

Willbird
11-23-2006, 03:52 PM
I only ran the machines we had a very few times on the old controllers. The guy from K&T that came in and worked on them, I think his name was "Gary Star"....we all called him "Starman"...this was before they became Giddings and Lewis....the two 200's they had rebuilt to machine Ford new Holland housings were they ones they got the extra 1" of Y travel out of, there were two holes in the part at 6 o'clock and 12 o'clock that needed that extra bit of travel to drill them.

I have to guess our 800's were mechanically ready to go for the 4 axis.....I guess some machines are mechanically true 4 axis, and some are 3-1/2 (not KT but cnc's in general) some the pallat drops down into what look like gear teeth when it clamps up......others it just rotates and the motor holds it in position ?? Some machines even 3 axis at once was a software option, and full fourth might be the same way ??

Really I consider myself fortunate, and you should as well to get to pilot one of those old girls ?? Hope you get her singing again.....not many CNC machines out there that will bury a man in chips when he works them hard hehe :-)

Bill

samco
11-27-2006, 01:29 PM
Had all last week off and didn't play with it once. :(

anyways - these are the servos that I have hooked up to the h-bridge now.
I get apox 500rpm at 80v. so around 200v should give me the speed I need.
http://www.electronicsam.com/images/KandT/DSC_0242.JPG
http://www.electronicsam.com/images/KandT/servotag.JPG

they max out at 1200 rpm. They where direct coupled to a 2tpi ball screw - they will now be direct coupled to a 3tpi ball screw. (on the K&T)

Should give me around 400ipm if I max it out.

These things are monsters. they are 8 brush servos. I almost flipped one off the table playing with it. :) (made for low rpm - high torque)

On another note... I may be testing a new fpga that would make it so I would not be using the computer to count the encoder or generate the pwm.

one of the emc developers has come across this little beauty.
http://fpga4fun.com/board_pluto-P.html 28 i/o
He has it working as a 4 axis servo controller 4 encoder inputs - 4 pwm outputs. You can read about it here.
http://emergent.unpy.net/01164408418

sam

Willbird
11-30-2006, 09:52 PM
Does that machine use KT 200 holders ?? I was looking in the Parlec catalog today and darned if they don't STILL make KT 200 toolholders.

Bill

samco
12-01-2006, 07:30 AM
the shank is like 2" in diameter (don't remember exactly)

sam

samco
12-01-2006, 08:02 AM
Well I looked over some of the part explosions of the kerney and trecker... Its going to require a bit of engineering. (remember this used the same servo to run the x and z axis) On the x axis they spin the lead screw - on the z axis they spin the nut. :(

It will just require getting in there and figuring out how to get the servo hooked to the nut - or changing it so that the lead screw spins.

Time will tell.

sam

Willbird
12-01-2006, 05:37 PM
I was remembering today that when Z would do a rapid move you would hear a contacter go "clunk"...then off she would go...so maybe that was what was going on there ??


They really never gutted our machines so I didnt get to see how the bits worked

Bill

samco
12-28-2006, 04:33 PM
Still working on it when I can.. I have the pluto and now a mesa board which will probably be what actually runs the k&t. I got a great deal on one. 72 i/o with lots of configureablity.
http://www.mesanet.com/motioncardinfo.html

anyways - I have a 6kva 3 phase transformer that I will be using for the power supply.. Need to make a bridge and such.

should be playing with the pluto the next few day.

sam

samco
03-03-2007, 10:22 PM
been too busy to breath ;)

Started to pull panels off of the K&T and finding more parts.
Here are some pictures
The controller we are removing ;)
http://www.electronicsam.com/images/KandT/conversion/frntcontroller.JPG
http://www.electronicsam.com/images/KandT/conversion/rearcontrller.JPG
Sample of the old germanium cards
http://www.electronicsam.com/images/KandT/conversion/card1.JPG
http://www.electronicsam.com/images/KandT/conversion/card2.JPG
http://www.electronicsam.com/images/KandT/conversion/card3.JPG
sadle pictures
http://www.electronicsam.com/images/KandT/conversion/rtsadle.JPG
http://www.electronicsam.com/images/KandT/conversion/rtsadle1.JPG
and a mouse nest - eww
http://www.electronicsam.com/images/KandT/conversion/leftsadle.JPG
http://www.electronicsam.com/images/KandT/conversion/mainelectricalbox.JPG
view of toolchanger and spindle
http://www.electronicsam.com/images/KandT/conversion/toolchangerspindle.JPG
hydaulic servos we are replacing
http://www.electronicsam.com/images/KandT/conversion/hyservo.JPG
cheat sheet ;)
http://www.electronicsam.com/images/KandT/conversion/cheatsheet.JPG
the scales it uses for position
http://www.electronicsam.com/images/KandT/conversion/accupins.JPG

We found this diode bridge for the power supply we are making to run the dc servos.
http://www.electronicsam.com/images/KandT/conversion/diodes.JPG
They are 80a 800v - should be enough :)

sam

samco
03-13-2007, 11:44 AM
I hooked a 1024 line encoder to the pluto and spun it in the drill press at 6500rpm.. Kept position perfectly. I didn't go any faster as it was a bit scary at that. ;) (I will probably only max out at 1500rpm at the most)

that is 443733 edges per second.. Cool.

sam

svenakela
03-14-2007, 04:03 AM
I must say, this is hardcore!

Did you notify the EMC-guys about your conversion? I know people running EMC on production machines but in "silence to the public". And when people put a lot of spare time to EMC they should be credited at least with an e-mail.
Keep up with the good work, this is really a nice project! :)

Regards,
Sven

samco
04-19-2007, 08:37 AM
I consider the emc2 developer group 'friends' - At least they put up with my stupid questions. ;)

I have met most of them at the http://www.cnc-workshop.com/ last year. Nice bunch and very very smart.

I have not had time to work on anything with the move.. But as things die down here I hope to jump back into it. I need to mill a bunch more circuit boards - at least 3 more. (have to build a garage this summer also..)

sam

kiwichris
04-22-2007, 08:36 PM
Here are some pictures
The controller we are removing ;)
http://www.electronicsam.com/images/KandT/conversion/frntcontroller.JPG


Even if nothing else, please tell me you are keeping the tape reader... Stick it in a cabinet and run it off a couple of steppers to randomly move fwd and back every now and then... :rainfro:

OK, I'm a geek, sorry...

samco
04-24-2007, 09:17 AM
Ah - No. :)

sam

kiwichris
04-26-2007, 05:48 AM
Ah - No. :)

sam

Now that's just disapointing... Flashing lights maybe? (Right, I'll shut up now...)

epineh
05-25-2007, 07:19 AM
Hey Sam great thread, I am going down the same path as you, I was wondering if you had played around with the pluto and the mesa card ?

I am trying to work out which will suit my needs better, I was thinking of using the pluto on my first router (650mm by 600mm by 100mm xyz) and the mesa for my next build which will be much larger, simply for the extra IO.

I have read the docs and understand there are HAL drivers already for both but am not able to do any real world testing yet.

I am going to use L298's to drive my small router servo's, should make for simple testing, might look around and see if there are any generic board layout's around.

Cheers.

Russell.

samco
05-25-2007, 07:41 AM
All I have done so far is test the plutos encoder counting abillity. Which seems really good. The mesa I have not even taken out of the static bag :)

One of the developers just got his Sherline lathe setup with the pluto using the pluto and l298's. He has threading working and everything.
http://timeguy.com/cradek/cnc/lathe

there isn't enough time in the day.. I did setup a microswitch on our gantry to set tool lengths. Now I can mill circuit boards a lot easier. Change the tool - runs over to the switch and touches off. A little math and I offset the coordinate system so z0 is the top of the board. Cradek actually uses the same thing but changes the tool length offset. (his way is better)

sam

epineh
05-26-2007, 04:49 AM
I might just have to buy one of each and try for myself then... I know what you mean about not enough time.

Russell.

samco
06-19-2007, 09:29 AM
Slooowly but surely..

http://www.electronicsam.com/images/KandT/servostart/mounting.JPG

http://www.electronicsam.com/images/KandT/servostart/ampmess.JPG

Finally closed the loop with the pluto last night. (small servo to play with that I mounted a 2540 line encoder on the back). Did the Ziegler-Nichols method here http://en.wikipedia.org/wiki/PID_controller#Ziegler-Nichols_method
That seemed to work pretty good (good start anyways). I got a sustained oscolation period of .036ms at a P of 460. So
P= .6*460 = 276
I= 2*276/.036ms = 15333
D= 276*.036ms/8 = 1.242

sam

unterhaus
06-19-2007, 12:32 PM
Did you make that h-bridge board on a T-Tech Quickcircuit?

Really looks good so far.

samco
06-19-2007, 12:39 PM
Heh - no. I made it on our limp-noodle gantry.. I ended up having to slow it down to 7ipm so that it wouldn't oscillate too much. With emc2 and a microswitch to set tool lengths - that was really slick. Program pauses - swap out to the next mill/drill - machine runs over and touches the microswitch and away it goes.

http://www.electronicsam.com/images/KandT/servostart/top.JPG

Did you make that h-bridge board on a T-Tech Quickcircuit?

Really looks good so far.

acondit
06-19-2007, 08:35 PM
Sam,

I am really interested in the HBridge board you are building. I downloaded the Eagle files, but the component values for most of the resistors and capacitors are missing. Can you either provide the values or give some guidance as to how you decided what values to use? I am thinking of using much smaller servos so the values may need to change?

Thanks,
Alan

samco
06-19-2007, 09:19 PM
Sorry - I am not good at actually dressing up circuits. The gate resisters are 10ohm the resisters feeding the optos are aprox 270ohm. The pull up resisters on the back side of the optos are 10Kohm. The mosfet looking thing on the lower left is a 3 pin 15volt regulator. All the caps are .1uf except the one in parrellel with the boot strap cap which is 10uf.

FDH44N50 N - MOSFET transistors 500V / 44A for the power mosfets.
RURG5060 Ultra Fast Diodes 600V 50A for the free wheeling diodes
IR2111 for the half bridge driver.
MUR120RLGOSCT-ND DIODE ULTRA FAST 1A 200V AXIAL for the boot strap.
LM340T-15-ND 15volt regulator
TLP2530-ND PHOTOCOUPLER DUAL 6N135 8-DIP
.1uf caps and
iirc 10uf electrolytics.
The big cap is 1900uf I think at 350volts (I think)

Couple things
- when there isnt any pwm signal applied to the bridge - both lower mosfets are on. (braking)
- I had a lot of help from a emc developer that does high power circuits for his real job.
- there is no current limiting yet.
- you should find lower Rds mosfets.
- if your going to run higher than 200v you need higer voltage boot strap diodes.
- this cannot have 100% duty cycle pwm signal other wise the boots strap doesn't get charged.
- use at your own risk (of cource)
- great care was made to have a short power circuit loop - to help get rid of stray inductance.

samco
07-11-2007, 09:00 AM
This is the little servo I have been playing with to teach myself a bit more tuning.
http://www.electronicsam.com/images/KandT/servostart/ampmess.JPG

Here is a picture of the following error just goofing around.
http://www.electronicsam.com/images/KandT/servostart/ferror.png
This would work great for a mini/micro mill - Tempted to buy one for home.

Now I finally got a decent read on the large servos votage/rpm=.125
So at 150v = 1200rpm <- which is its maximum rating. That would give us a max speed of 200ipm with 2:1 and 3tpi.. (we where going to direct drive it but for ease of retro we are going to belt drive it.) Plus the 150v falls right into the operating range of the diy h-bridge.

sam

acondit
08-16-2007, 03:16 PM
Sam,

I am thinking about trying out some servos. I have some 63v 15amp peak servos. Do you think that your boards would be a reasonable match?
I also have some smaller 100 watt servos 30 to 36v (I think). Would these work with your board design?

Are you working on the design more (ie, current limiting)?

Alan

samco
08-17-2007, 11:56 AM
The drive 'should' be able to handle 20a continuous at around 150v and close to 40a peak.. But I have only tested it so far at 10a at around 60v.

Remember - no current limiting yet. I was planning on using some fast blow fuses to try to save the mosfets in case of an oops.. I don't know how well in practice this will be.

sam

JBV
08-17-2007, 12:21 PM
You could perhaps add something like this (http://www.cnczone.com/forums/showpost.php?p=121370&postcount=95) + a comparator and a little logic to shut down the output when it draws to much current!?

samco
08-17-2007, 12:29 PM
I am a bit leary about adding current limit yet as the guy who helped be design the low inductance current loop of the h-bridge said there are right ways and wrong ways to add current limit. He suggested a aprox $30 magic chip that you would hook in series with the motor that would be used as the current sense circuit. Not messing up the h-bridge by adding a series resister high wattage resister.

But I have not had much time to look into that.

sam

epineh
08-17-2007, 06:31 PM
Hey Sam, have you looked into/heard of high side current sensing as opposed to using sense resistors in series with the motor (Low side)? I cannot say I really know what is involved, but I wonder if it involves measuring the Vce Sat voltage of the output FET's.

EDIT :

I did a quick Google and found this :

http://www.national.com/nationaledge/

Don't know if something like this would work, not enough hours in the day to find out right now (chair).

Russell.

bigeye3107
08-18-2007, 06:54 PM
hello,
I am a new user of emc.
I bought a pluto-p card.
Do you have a schematic of the mosfet board ?
I learn electronics for this project !

PS : Excuse my poor english, but i'm french guy...

acondit
08-18-2007, 08:50 PM
Russell, Sam,

Is there a reason why all of the FETs and Diodes that require heat sinks can't be on one side of the board so that you could use a common heat sink?

Alan

samco
08-19-2007, 01:08 AM
like this?

http://www.electronicsam.com/images/KandT/servostart/mounting.JPG

that is how I have it setup right now.

acondit
09-01-2007, 11:54 PM
Sam,

What exactly is the "bootstrap"?

Alan

acondit
09-12-2007, 05:04 PM
Sam,

I posted this on Epineh's thread and got no response. So since you worked with JMK on this design I hope you can answer the question.

What is the purpose of the large capacitor (1900uf 350V) across the high voltage supply? Is it just a smoothing filter? Or is it required for charge storage because of the rapid PWM pulse rate? Or both?

Is the capacitor required for a lower voltage and amperage?

How would one size the capacitor (if required) for say 60 volts and 20 amp peak?

Thanks,
Alan

samco
09-13-2007, 07:24 AM
The size was picked - because I have a bunch of them ;)

It is for getting rid of stray inducatance and making the inductance of the h-bridge very low.

I don't know how you would calculate what it should be though - my electronics is a bit rusty. I think you want to use one as big as you can get away with - which will be easyer for you as your running a lower voltage.

sam

acondit
09-15-2007, 11:45 AM
Sam,

I was looking at the UHU servo board designs. It has a simple current limiting scheme that seems like it could be easily adapted to your basic design. My problem is that I may be missing lots of details.

Do you have any objection to my posting a modified schematic for comment on the general electronics forum?

Alan

samco
09-15-2007, 11:49 AM
Anything that can be done to improve the circuit - I am all for.. :)

Go for it. I have been too busy to do anything right now.

thanks
sam

samco
02-20-2008, 07:48 AM
no turning back now..

http://www.electronicsam.com/images/control.jpg

unterhaus
02-20-2008, 08:58 AM
that's going to be a lot of space for electronics

samco
02-20-2008, 09:26 AM
That control cabinate is going. Most everything is going in here. A lot of the 'stuff' in the box will not be needed.

sam

http://www.electronicsam.com/images/KandT/conversion/mainelectricalbox.JPG

that's going to be a lot of space for electronics

kestreltom
03-05-2008, 01:31 AM
Samco,

I've been following your progress - way to go.
I am converting a Kasuga knee mill (http://www.foxpointdesign.com/cnc%20stuff/IMG_1149.jpg) from Bandit to EMC2. I have the Mesa 5I20 that I am just getting set up to play with using smaller test servos and the 7I40 servo amps. I was wondering how you connect the pwm signals to your H bridge. Do you connect a CW pulse stream on one side of the bridge and a CCW pulse stream on the other? Is that all there is to it??? Just wondering how this works...
Thanks!
Tom

samco
03-05-2008, 08:20 AM
Yes - The servo amps I have been playing with require a PWM signal for CW and a pwm signal for CCW (I call it PWM+PWM). (very simple H-bridge.) Now IIRC - the mesa card only supports PWM+DIR at the moment. Well - unless you buy the servo interface card which gives you +/-10v out. (7i33). SO if you want to do PWM+PWM - you will need a little bit of logic.

most industrial amps use +/- 10v or pwm+dir.

sam

kestreltom
03-05-2008, 12:54 PM
Samco,

I need to recap what I understand about your setup, so you can correct me here:

You are using the raw parallel port (or Pluto-P card for higher data rates) to output a pwm up-count and down-count on 2 separate pins which are piped through a 2 channel high-speed optocoupler to two IR2111s, which then feed the high and low gate signals to each side of your massive H-bridge. No current limit scheme is in place yet, inductive currents are handled by the massive capacitor, and back emf is handled by the high speed super-diodes working in parallel with the mosfet's internal body diodes. No shunt ballast resistor - so some heating might occur in the motor if high speeds and high loads are combined.
Feedback is provided by a square wave encoder which is read into the pport pins provided by EMC2's pwmgen hal module, or the Pluto-P. The PID loop is handled internally in EMC2.

Sorry for the long-winded description. Please correct me here. Feel free to expand on or replace anything...

I do have the Mesa 7I33 for +/- 10V, which I was planning to use with the existing servo amps on the Kasuga.

Since I already have most of the components that you are using on your H-bridge design, I would like to try one out on my mill (my mosfets are rated 300V,40A, RdsOn=.08 ohm). With your permission, I would like to implement a pwm+pwm H-bridge scheme like yours. If you have any circuit board artwork to share, I would like to use it to make a chemical etched version (hand drilled) to try out and report back on.

I'd be happy to document my results here in this thread.

Thanks for your help,
Tom

samco
03-05-2008, 12:56 PM
Exactly :)

Go for it! Keep us updated.

sam

samco
03-05-2008, 01:13 PM
oh - and http://www.electronicsam.com/images/KandT/servostart/schem/
are the eagle files.. The parts are not correct (I was strictly looking for physical sizes) - here is the parts list.


FDH44N50 N - MOSFET transistors 500V / 44A for the power mosfets.
RURG5060 Ultra Fast Diodes 600V 50A for the free wheeling diodes
IR2111 for the half bridge driver.
MUR120RLGOSCT-ND DIODE ULTRA FAST 1A 200V AXIAL for the boot strap.
LM340T-15-ND 15volt regulator
TLP2530-ND PHOTOCOUPLER DUAL 6N135 8-DIP
.1uf caps and
iirc 10uf electrolytics.
The big cap is 1900uf I think at 350volts (I think)

Couple things
- when there isnt any pwm signal applied to the bridge - both lower mosfets are on. (braking)
- I had a lot of help from a emc developer that does high power circuits for his real job.
- there is no current limiting yet.
- you should find lower Rds mosfets.
- if your going to run higher than 200v you need higer voltage boot strap diodes.
- this cannot have 100% duty cycle pwm signal other wise the boots strap doesn't get charged.
- use at your own risk (of cource)
- great care was made to have a short power circuit loop - to help get rid of stray inductance.

kestreltom
03-06-2008, 02:42 AM
OK!
I got your .brd and .sch files opened in Eagle Light - I'm all set.
There may be a way to implement a chopper based current limit scheme on the low side logic level gate signals. We'll see...
Thanks.
Tom

digits
03-11-2008, 06:44 AM
Hi guys, I really like the idea of a simple opto-isolated PWM amp, but I think I'd need current limiting in my system.

I am currently considering using a high-side monitoring IC - would you guys be interested if I get something working?

Also, what sort of current requirement do you have on your 12v power line? I am wondering whether it is feasible to generate the 12v supply on board from the motor power line with a linear regulator.

Cheers, and good luck!

kestreltom
03-12-2008, 04:14 PM
Samco & Digits,

I have a few questions for you Samco:

What are the values for the R/C noise filters on the logic input lines?

Why is it that the Pluto-P can achieve higher data rates that the P-port to which it is attached??

Re. current limit:

Simple current limit could be: pipe a small analog signal (0- 20mv - from a sense resistor calculated from expected motor power into an opamp w/gain x 100, then to a comparator with an adjustable V ref on one of the inputs (current adjust) and a logic 0-5V pulse output, then to nand gate which cancels the low side gate pulse when a positive pulse from the sense comparator is on one of the inputs.

Another scheme could be to use the current sense comparator output to drive a small signal transistor to clamp the low side gate signals to ground.

Please, anyone is welcome to comment on this idea :boxing:, really!

Tom

samco
03-12-2008, 05:13 PM
the resister is 220ohm and the parallel cap is 100pf.

The pulse train from the printer port is limited by the os/realtime kernel. You can only go so fast and still have the computer responsive. That seems to be 20Khz to 100khz (if your lucky). the pluto can ouput much faster pulses because that is all it mainly does. Emc sends it velocity and the pluto ouputs the pulses and sends emc back a position. (I may be a bit vauge.)

sam

kestreltom
03-12-2008, 11:48 PM
Samco,

Ok. Thanks!

digits
04-02-2008, 06:57 AM
Samco & Digits,

I have a few questions for you Samco:

What are the values for the R/C noise filters on the logic input lines?

Why is it that the Pluto-P can achieve higher data rates that the P-port to which it is attached??

Re. current limit:

Simple current limit could be: pipe a small analog signal (0- 20mv - from a sense resistor calculated from expected motor power into an opamp w/gain x 100, then to a comparator with an adjustable V ref on one of the inputs (current adjust) and a logic 0-5V pulse output, then to nand gate which cancels the low side gate pulse when a positive pulse from the sense comparator is on one of the inputs.

Another scheme could be to use the current sense comparator output to drive a small signal transistor to clamp the low side gate signals to ground.

Please, anyone is welcome to comment on this idea :boxing:, really!

Tom


Looking at other open-source designs such as UHU-servo, I think you actually need to latch the output of the comparitor so that it disables the gate pulse for the entire cycle. Otherwise you might get nasty oscillations as the current limit trips, the current drops, the circuit un-trips and the current rises again - all with a few us round trip.

I am also worried about current limiting during regenerative-braking - if the motor is generating power, and raising the voltage of the +ve supply rail, I would have thought that the voltage across the sense resistor would become -ve and so not trip the comparitor?

kestreltom
04-02-2008, 03:07 PM
Digits,

OK... now were off. Nice thinking - thanks! Would you post a link to the UHU schematics or discussion that treat this topic? I would like to take a look at it.

Yes, I was wondering what sort of damping, if any, would be needed keep the limiting circuit from unstable oscillating. Keep in mind that the pwm frequency becomes the current limit period - so at 20K we have 50us for example. Unnecessary oscillating/switching will caused a lot of ripple and harmonics with resulting motor heating and other nasty stuff.

Just ruminating here: the comparator circuit of choice would need to have some dead band, so a latch, schmidt trigger, or a line driver (ex:74LS244N) - or all three on the logic outputs will help keep switching clean. Another idea would be to run the comparator output through a flip-flop that is clocked to the pwm rate. This way we are guaranteed a clean logic high or low once per pwm period.

I have not had a chance to research how to handle recirculating current yet. My take is that since the current sense resistor will only generate a positive voltage when current is flowing from the motor to ground, then it wouldn't matter what the voltage potential is at the rails. The current sense comparator inputs only respond to a positive signal from the sense resistor leads - so negative current flow here, and thus a negative sense voltage would be ignored.

Comments?

Tom

epineh
04-02-2008, 09:19 PM
I may jump on board as well, I am doing much the same thing, I have made my own H Bridge board and this will plug into a seperate processor board. As yet I have no current limit but would like to do something. My thoughts on the regen from the servo is to build a regen power dump circuit that sits on the motor power supply, as the voltage spikes, the excess energy is dumped and this keeps the voltage under a certain level.

This way a standard current limit only has to trip under overload conditions.

Just my 2c. Keen to see how this all goes.

Russell.

kestreltom
04-02-2008, 11:26 PM
more 2 cents...

A simple regen power dump, as Russell points out is actually part of the common power supply for all the amplifiers attached to it. My guess is that a linear switching circuit using a high current bipolar transistor and a low value but very large resistor would form the basic circuit.

Tom

H.O
04-03-2008, 12:33 AM
Hi guys,
I've been a bit involved in testing the new HP-UHU board and I've designed a powerdump circuit that helps clamping the powersupply voltage. You can find the schematic for this in post #1646 here (http://www.cnczone.com/forums/showthread.php?t=14217&page=138).

However, clamping the voltage is just part of the problem which has also been discussed quite a bit in the UHU-thread, basicly starting here. (http://www.cnczone.com/forums/showpost.php?p=409531&postcount=1599)

/Henrik.

digits
04-03-2008, 11:09 AM
Cheers Henrik - that is very helpful :)

If I have understood it correctly:

During regenerative braking at full speed, there is a danger of exploding the MOSFET's and power capacitors if the sum of the motor back EMF and the PSU voltage exceed their specifications - hence the dumping circuit.

There is also a danger of melting the motor-windings if the current produced by this summed voltage exceeds the motor's limits.

However, is it the case that if you measure and limit the current through the motor during full-speed reversal, both of these disasterous events can be avoided, at the minor penalty of only being able to decelerate at the same rate that you can accelerate?

I'm not saying that measuring the actual motor current will be easy, but it might be a neater solution than burning off a shed load of power in braking resistors.

Then again, I may have got the wrong end of the stick again!

H.O
04-03-2008, 12:15 PM
Hi digits,

If you browsed thru the messages in the UHU thread you probably noticed that I don't have a full understanding of this issue either, but little by little it is sinking in, I think/hope. So, please don't take this as 'the truth' but more as an open discussion.

Yes, the dump circuit is there to prevent the powersupply voltage from increasing above what the drive is rated at and/or the voltage rating of the capacitors in the powersupply itself. The capacitors in the powersuopply will absorb quite a bit of regenerative energy even without a dump circuit but if operating close to the drives limit and driving heavy loads it might be a good idea to use one. Industrial drives either have the dump circuit built in or simply shuts down the drive on overvoltage - which also prevents it from dying.

The powerdump circuit does not impose any negative performance on the motor at all. But again, it's only part of the problem.



The transistors in the H-bridge can die of too much voltage and/or too much current, the dump circuit will prevent it from the former. However, it can't prevent from the later.

Measuring true motor current (tourqe) is the key to prevent it from dying from too much current while regenerating. A common type of H-bridge in DIY-drives, like the HP-UHU works by turning on two of the diagonal MOSFETs and look at the current that flows thru the senseresistor at the bottom of the bridge. When this current reaches the setpoint it switches off the MOSFETs untill the next PWM cycle - nice, effective and simple. (But not the best way)

If the motor is spinning in one direction, generating, say 100V, and the H-bridge applies the powersupply voltage of 140V "in series" with the motor the resulting voltage across the motor terminals is now 240V.

The 140V powersupply will "push" current thru H-bridge, thru the motor, down thru the sense-resistor and back to the powersupply untill the current sense circuit turns off the MOSFETs (just like it always does). But during the short period that the MOSFETs are ON the current generated by the 100V BEMF of the motor has a "closed circuit" from the "positive" terminal of the "generator", up thru the diode in turned OFF upper MOSFETs, down thru the other turned ON MOSFET and back to the "negative" of the "generator". The only thing limiting this current is the winding resistance, wiring, connectors, PCB traces and RdsON of the MOSFET.


For a large, high voltage, high current servo motor this current might be 100's of amps. By measuring the actual current thru the motor you can catch this and turn off the bridge before the current rises to high.




The "right" way to do it is to have two control-loops in the drive, one "inner" loop, the torque-loop (or current loop) that is always controlling the current and one outer loop, usually a position loop in this case that calculates how much torque is needed and "orders" that amount of torque from the inner loop.


Complicated, yes. That's why you don't see it on many "DIY-drives". The VSD-A from Granite Devices is the only one I know of that does it the "proper way" and has a price you can actually afford without taking a second mortage on the house.



Again, please don't read more into this than it is. I'm still trying to figure most of this stuff out too.

Sorry for the ramble....

/Henrik.

digits
04-03-2008, 01:08 PM
Thanks for such a detailed reply Henrik - I keep forgetting about those darn diodes!

It does still sound to me though that if you are sensing the current on the motor leads, and reducing the PWM on-time to clamp it to a safe max, you will also limit the FET/diode current, won't you?

Having already toasted 3 G320's due to back-EMF induced PSU voltage rise or excessive diode current, I am very keen to find a way to solve this safely if I do build a 'simple' PWM amp.

Cheers.

H.O
04-03-2008, 01:58 PM
Hi,

It does still sound to me though that if you are sensing the current on the motor leads, and reducing the PWM on-time to clamp it to a safe max, you will also limit the FET/diode current, won't you?

Yes, exactly. The tricky part is how to do it - the devil's in the details.

Let us know what you come up with if you give it a go.

/Henrik.

kestreltom
04-03-2008, 10:52 PM
Henrik

Thanks for the helpful post! This made me jump to the UHU HP forum and spend some time reading there, watching the videos, thinking, etc.

I took a good look at the the current limit circuit posted in the UHU_MODIFIED_Dated1.4.08_R1.0b.pdf file, and I noticed the dual slow/fast response circuits that combine outputs before piping the signal to the microcontroller. What is the reason for having separate slow and a fast response signals & why combine them?

Thinking about recirculating currents and the capabilities of EMC2 here...
I suspect that EMC2 does not have the ability at this time to read a current limit logic/analog input and incorporate it into the position control computations that adjust pwm. As far as I know, PWMgen, or the Pluto P configs only take position feedback from the encoders and interpolate velocity from the same before calculating error and commanding the pulse width on 2 separate (up/down) complementary pins. This would be analogous to a torque command, or what I think you refer to as the outer torque loop. This is a very simple arrangement which Samco calls "pwm & pwm", and may have undiscovered limitations due to the fact that EMC2 can read position & velocity, but has no way of knowing if the motors and amps are melting down. The only response from EMC2 in a severe servo overload situation would be tripping the maximum position error setpoint.

In order to avoid damaging motors and mosfets, or exploding capacitors with recirculating back emf - I am guessing that the simple/smart way to go is to design in a lot of overcapacity into the basic H bridge and power supply so that the limits are not ever reached - which I believe Samco has achieived here. Adding a current dump and a current limit will increase useable power to the servos, increase safety and reliability, will not require any input from EMC2, and will cost a little in added complexity.

Since pulse by pulse current limiting, or the inner torque loop, is not hard to implement directly on the motor drive, it should be done.

That said (whew...) I am getting ready to improvise a design. Your input from your UHU HP experience is very helpful - since it is a high power design.

Please feel free to respond, correct, add...

Thanks,
Tom

H.O
04-04-2008, 07:30 AM
Hi Tom,

The reason for the fast/slow limit is that you can utilize the peak torque of the motor for a limited time before the continous limit "kicks in". It is supposed to give you 2.2 times the continoues torque for a few seconds and then limit the current to the value you set. That is what it's supposed to do but although tested on the prototype it doesn't seem to work properly on two of the beta-boards. (Mine and Jozsi's). They both operates at the peak-current limit all the time, the integrator circuit never charges enough to trip the slow limit which it apparently did on the prototype. I'm sure there's something simple going on and we'll figure it out soon.


With larger motors there's an absolute must to have a current limit circuit. If you don't you can fry both the H-bridge and the motor in case of jamed mechanics or what not. Take my motor as an example, it has 0.24ohm armature resistance, if the motor won't spin due to it being jamed, applying 140V across it will result in a current of 580A(!). If that much current is ever let into the motor it will self destruct in a heartbeat.

You definetly need some safety margin on the components in the powerstage but as you can see above it gets very unpractical and very expensive to design "around" a proper current limit scheme.


I don't use EMC myself but I dare to say that trying to use the CNC-control software to limit the current won't work. Real-time or not it's too slow, you need to react in uS here or something will smoke.


The output from the current limit circuitry on the HP-UHU does not go back to the microcontroller, it inhibits the PWM by disabling the MOSFET drivers for the rest of the PWM cycle. The microcontroller has no knowlege or control over the current - it's all done in hardware.

What I guess you could do is something like what the HP-UHU does, ie. feed the PWM from EMC to the H-Bridge and then inhibit the PWM by disabling the MOSFET drivers with the current limit circuit, cycle by cycle as is done on the UHU. This will not prevent regenerative current from blowing the high-side MOSFETs though, dump circuit present or not. (Depending on powersupply voltage, motor etc of course).

Interesting stuff... ;-)

/Henrik.

samco
04-04-2008, 08:11 AM
I am sure there are going to be limitations... Mainly what I want to try is this..

1. H-bridge will be fused.
2. Following error will be set as tight as it can.
3. Accelleratioin will be set to a 'safe' amount.

The h-bridge is running slow decay mode. (the motor windings are shorted out thru the bottom 2 fets durring the off cycle) This also makes the h-bridge more linear vs input signal.

This is by no means a perfect setup. But it will be fun to play with. We may in the end buy some comercial amps.

sam

H.O
04-04-2008, 09:23 AM
Sam,
By all means, go for it. Please keep us posted on the progress!

/Henrik.

samco
04-04-2008, 09:45 AM
On a side note. I am looking at classic ladder within emc to do the spindle shifting (among other things :))

http://www.electronicsam.com/images/KandT/conversion/shiftlogic.JPG

here is how the old controller did it .. blast from the past. (servo loop)

http://www.electronicsam.com/images/KandT/conversion/loopblock.JPG
http://www.electronicsam.com/images/KandT/conversion/loopexp1.JPG
http://www.electronicsam.com/images/KandT/conversion/loopexp2.JPG

kestreltom
04-05-2008, 01:42 AM
Henrik, Samco

Thanks guys for the excellent explanations.

Henrik, After my last post, I realized I was mistaken that the UHU current limit circuit fed info back to the microcontroller... a quick glance at the schematic and I saw the D fllip-flop (CD4013BCN) which cancels the chopper signal - OK, got that one.

I read about the trouble you have been having recently with the current sense integrator. Hope you guys solve that one & thanks for helping me understand how the fast and slow circuits work together.

I've been trying to understand the concept of back emf / recirculating currents. Here is my stab at it:

The point at which mosfets get blown is when Mach3 or EMC2 command a high speed motor reversal. Large motors, big lead screws, heavy tables & low friction ways make this problem even worse. When this happens, the H-bridge swaps polarity instantly, but the motor's inertia & back emf now become in effect, forward emf - with the result that the motor momentarily has virtually no resistance to current flow until it can reverse direction and build back emf up again. So the result is a huge current spike that lasts for a part of the duration of the motor reversal. The motor can be compared to a gigantic ambi-polar capacitor: charge it up in one direction until it's full (back emf = Vm ), then quickly swap the leads and watch the sparks fly as you try to connect it again!

If I understand this correctly, (looking at the above scenario) then during reversal, the current will initially flow from the high side rail all the way down thru the motor to the low side rail. The bottom sense resistor(s) will in fact catch this current spike and shut down the high side mosfet, thus turning both bottom fets on and transitioning to an electronic brake. The current sense resistor is out of the loop for this short period, but it might be possible to put a low value resistor in series with this loop, between the bottom fets and the sense resistor(s), to limit recirculating current.

Samco, I can see that by tuning the acceleration ramps you can help some of this by maximizing the amount of time that both bottom mosfets are on during the reversal. I am hoping that I can make a limit circuit that will save us some $ on fuses ;-)

I will draw up a prototype schematic next week and post it here.

Tom

H.O
04-05-2008, 05:17 AM
Hi Tom,

The point at which mosfets get blown is when Mach3 or EMC2 command a high speed motor reversal. Large motors, big lead screws, heavy tables & low friction ways make this problem even worse. When this happens, the H-bridge swaps polarity instantly, but the motor's inertia & back emf now become in effect, forward emf - with the result that the motor momentarily has virtually no resistance to current flow until it can reverse direction and build back emf up again. So the result is a huge current spike that lasts for a part of the duration of the motor reversal. The motor can be compared to a gigantic ambi-polar capacitor: charge it up in one direction until it's full (back emf = Vm ), then quickly swap the leads and watch the sparks fly as you try to connect it again!

Yes, if reversing the polarity of the bridge while the motor is still spinning in the "other" direction the BEMF is now in series with the powersupply.

If I understand this correctly, (looking at the above scenario) then during reversal, the current will initially flow from the high side rail all the way down thru the motor to the low side rail. The bottom sense resistor(s) will in fact catch this current spike and shut down the high side mosfet, thus turning both bottom fets on and transitioning to an electronic brake. The current sense resistor is out of the loop for this short period, but it might be possible to put a low value resistor in series with this loop, between the bottom fets and the sense resistor(s), to limit recirculating current.

This is where it starts to differ between different switching schemes. The UHU, for example, does not short the winding. Basicly there's only three states:
1) All MOSFETs OFF
2) Upper right, Lower left
3) Upper left, Lower right

So the way I see it, with the UHU (which still might be wrong) is that when reversing direction and power is applied "in series" with the BEMF you have a circulating current in the upper part of the bridge, because what used to be the "negative" side of the BEMF is now connected to the high side rail thus raising the positive side of the BEMF "generator" to Vsupply+BEMF. So the current travels up thru the upper turned OFF MOSFET's diode and then down thru the turned ON MOSFET and back to the negative sides of the BEMF "generator". This current will flow untill the "normal" current, thru the senseresistor trips the current limit and turns off the MOSFETs.

If I've got this right you would have to take the above into cosideration even if you move to switching sceme where you short the winding with the two lower MOSFETS. And IF you do short the winding with the lower MOSFETS you absoultely need to monitor and limit the current flowing during the "shorted" period. If you don't you will destroy both the bridge and maby even the motor. If the motor is generating 100V of BEMF and has armature resistance of 0.5ohm and you short the winding you'll have a current spike of 200A there.

I've been thinking alot about this the last couple of months and I really hope I've got it right this time.

Looking forward to seeing the schematic!

/Henrik.

kestreltom
04-05-2008, 02:01 PM
Hi Henrik,

Good to hear your responses.

Yes, it looks like the UHU handles PWM differently. Thanks for the info.

You said:
"So the way I see it, with the UHU (which still might be wrong) is that when reversing direction and power is applied "in series" with the BEMF you have a circulating current in the upper part of the bridge, because what used to be the "negative" side of the BEMF is now connected to the high side rail thus raising the positive side of the BEMF "generator" to Vsupply+BEMF. So the current travels up thru the upper turned OFF MOSFET's diode and then down thru the turned ON MOSFET and back to the negative sides of the BEMF "generator". This current will flow untill the "normal" current, thru the senseresistor trips the current limit and turns off the MOSFETs."

Have you watched this on a scope to see how high the voltage spikes are on the motor leads when compared to the voltage at the rails? It would also be interesting to see how high the negative potential spikes are on the mosfet drain & source leads while it is being bypassed. If the negative spike is large enough in amplitude and duration, that also will destroy the mosfet. Refering to Samco's design, has anyone tried adding separate ultra-fast diodes in parallel with the mosfets on the UHU hp design? I didn't see any reference to this in the schematic, or on the silkscreens.

Thinking about this, I realized that it would be instructive to build a prototype circuit board with calibrated sense resistors located on all the high current traces so that one could probe around and actually see (using an scope) when the current spike occurs, what direction its going, and map out its pathway. When making a copper mask, I will add some pads and test points for surface mount sense resistors on all the high current traces. The pads could be easily bridged when not in use.

Samco - sorry for all the circuit design discussion. I'm sure you must tire of the feeling of having someone go through your sock drawers... as you've already been there & done that. Thanks for putting up with me.

regards,
Tom

H.O
04-07-2008, 12:17 AM
Hi Tom,
No, I haven't probed anything in the power-section of my UHU - it's all theory so far. Good idea about the senseresistors in the prototype PCB, it's going to be very interesting to finally get some real life data on this!

I don't think anyones tried an external freewheel diodes on the HP-UHU, it's still a very new design and there's not many drives out there yet. Besides, so far the power-section have been working quite good as-is.

Looking forward to see your prototype!

/Henrik.

samco
04-07-2008, 06:47 AM
No problem. I love it. :)



Samco - sorry for all the circuit design discussion. I'm sure you must tire of the feeling of having someone go through your sock drawers... as you've already been there & done that. Thanks for putting up with me.

regards,
Tom

digits
04-08-2008, 05:13 AM
Hi guys, I have been thinking and googling this a lot recently - I found these interesting ICs from International Rectifier, which monitor the current in a sense resistor connected in series with the motor. Unfortunately they seem to be a bit hard to find from the usual electronic suppliers:

http://www.irf.com/product-info/imotion/csic.html

I have also been thinking that it would be possible to measure both the "regenerative BEMF through off-MOSFET's diode" and intended braking current by putting a sense resistor in the high-side of both sides of the H-bridge. The BEMF current would be -ve wrt the braking current, so they'd have to be summed intelligently, but I have seem some app notes which use this technique, so I guess it's possible. It would also give us short-circuit detection/protection practically for free :)

The Linear devices LT6104 seems to use this twin-high side sense resistor trick - I think it'd need some extra components to raise its power supply voltage to something more useful though.

Cheers.

kreutz
04-08-2008, 08:45 AM
Hi digits,

If you browsed thru the messages in the UHU thread you probably noticed that I don't have a full understanding of this issue either, but little by little it is sinking in, I think/hope. So, please don't take this as 'the truth' but more as an open discussion.

Yes, the dump circuit is there to prevent the powersupply voltage from increasing above what the drive is rated at and/or the voltage rating of the capacitors in the powersupply itself. The capacitors in the powersuopply will absorb quite a bit of regenerative energy even without a dump circuit but if operating close to the drives limit and driving heavy loads it might be a good idea to use one. Industrial drives either have the dump circuit built in or simply shuts down the drive on overvoltage - which also prevents it from dying.

The powerdump circuit does not impose any negative performance on the motor at all. But again, it's only part of the problem.



The transistors in the H-bridge can die of too much voltage and/or too much current, the dump circuit will prevent it from the former. However, it can't prevent from the later.

Measuring true motor current (tourqe) is the key to prevent it from dying from too much current while regenerating. A common type of H-bridge in DIY-drives, like the HP-UHU works by turning on two of the diagonal MOSFETs and look at the current that flows thru the senseresistor at the bottom of the bridge. When this current reaches the setpoint it switches off the MOSFETs untill the next PWM cycle - nice, effective and simple. (But not the best way)

If the motor is spinning in one direction, generating, say 100V, and the H-bridge applies the powersupply voltage of 140V "in series" with the motor the resulting voltage across the motor terminals is now 240V.

The 140V powersupply will "push" current thru H-bridge, thru the motor, down thru the sense-resistor and back to the powersupply untill the current sense circuit turns off the MOSFETs (just like it always does). But during the short period that the MOSFETs are ON the current generated by the 100V BEMF of the motor has a "closed circuit" from the "positive" terminal of the "generator", up thru the diode in turned OFF upper MOSFETs, down thru the other turned ON MOSFET and back to the "negative" of the "generator". The only thing limiting this current is the winding resistance, wiring, connectors, PCB traces and RdsON of the MOSFET.


For a large, high voltage, high current servo motor this current might be 100's of amps. By measuring the actual current thru the motor you can catch this and turn off the bridge before the current rises to high.




The "right" way to do it is to have two control-loops in the drive, one "inner" loop, the torque-loop (or current loop) that is always controlling the current and one outer loop, usually a position loop in this case that calculates how much torque is needed and "orders" that amount of torque from the inner loop.


Complicated, yes. That's why you don't see it on many "DIY-drives". The VSD-A from Granite Devices is the only one I know of that does it the "proper way" and has a price you can actually afford without taking a second mortage on the house.



Again, please don't read more into this than it is. I'm still trying to figure most of this stuff out too.

Sorry for the ramble....

/Henrik.

Henrik;

You are assuming the worst case scenario when you reverse direction at full speed when traveling forward at full speed. That situation does not normally happen because of your acceleration setting in Mach3's motor tuning (EMC should have an equivalent setting). Granite Devices have an extra acceleration limit because there is a trajectory profile calculation in its algorithm, that might help during that situation, but the use of a current loop is not a solution either.

The modified UHU drive (UHU HP) will limit the current through the Mosfets to the peak value set by the Continuous Stall current adjustment potentiometer and the Fast limit reference voltage under all possible circumstances (except short circuit currents not returning through the sense resistor), but will not limit the regenerative current through the diodes. None of the drives on the market, that I know, will do that, not even the Granite Device's which use an integrated power stage with no blocking diodes in series with the lower IGBTs (if there is one, please, let me know). The pulsed current spec for the anti-parallel diodes should be high enough to withstand that current, otherwise they will fail.

UHU chips use a modified PID (with a higher order term) to control positioning, the PID acts upon the PWM duty cycle which controls speed (motor voltage). Current will increase or decrease following the required torque to keep the closed PID loop happy, until a peak maximum current reference is reached, then the 4013 flip-flop is reseted in order to limit the duty cycle. From that point on, and until PWM polarity reversal (depending on set speed), all the Mosfets are OFF, so no recirculation current goes through them, all recirculation is done through the anti-parallel diodes.

Under normal use the peak current values are not reached during the PWM cycles. PWM mode is locked Anti-phase (50% duty cycle = no movement), so the recirculating current during the PWM off is done only during the dead-band time (approx. 1 usec), the current regulation is done by virtue of the duty cycle value, which is fast and effective for a 4 quadrant drive. When Mach3/EMC command a deceleration phase, the duty cycle does not change drastically, but gradually, so controlling a gradual deceleration until a movement reversal is done. During this time, current could reach the peak value and be limited to that value but stored energy will not trigger a destruction of the power stage because there is no 100% or 0% duty cycle.

I am not saying that the UHU chip's way of control positioning is better than the method used on drives that use an internal fast current/torque loop and external positioning/speed loop (it is not, but is simple enough to include in a cheap micro-controller)

So the solution to the hypothetic H bridge destruction problem you are concerned about is:

1-: Good motor tuning in Mach3 or EMC (acceleration/speed settings)
2-: Manufacturer's specs should include proper derating (might have been the cause of the problems with that manufacturer's drives, unless they were not using 4 quadrant driving in Lock anti-phase mode)
3-: Never use a drive near the maximum specified (limits) currents and voltages, buy a higher power model if necessary.
4-: Use a current limiting resistor (high power) in series with the motor. Not recommended because the efficiency and performance are degraded.
5-: Use a power supply voltage clamp circuit to avoid overcharging the DC bus capacitors and possible over-voltage to the drive. Recommended.

Regards,

Kreutz.

H.O
04-08-2008, 11:50 AM
Hi Kreutz,
I'm glad to see you jump in and share your expertice with us here too! As I said, little by little it's sinking in and your post here helped that process even further.

First, regarding the VSD-A - I don't have access to the schematic and I've no detailed info on how it works. The only thing I know is that they (Granite Devices) assures me that my motors won't destroy the drive due to regenerative braking, no matter what due to its true torque control loop. They have a peak rating of 80% of my motors continous current, while the UHU that may/may not be damaged has a peak rating of 130%. I did not know (and it would really surprise me) if the trajectory planner in the VSD-A is in effect when running Step/Direction. AFAIK it's only operational when running the drive in SPI mode.


Second, I know I'm assuming the worst case scenario but usually, when something can go wrong, sooner or later it does. I would hate to have the drive blow because I mess up the motortuning or something like that. And I know that even with Mach3 at full acceleration there's still not an immidiate direction reversal so it may not be a problem at all, but again....


And regarding derating and operating near rated peak level. When a drive is rated at 180V/25A you shouldn't have to worry about it running at 130V/20A IMO. It may very well be the case that none of the commonly used DIY drives monitor/control the regenerative current but that might also be the reason why so few exists (at 80V+) that actually seems to work at the level they are rated at.


I have some more results regarding the Fast/Slow limit but we'll talk about that in the "correct" thread. Thanks again for stepping in and clearing up the concepts even further. And I DO hope you didn't read my message as if I was bashing the HP-UHU, beacause I'm not.

Best regards,
/Henrik.

kreutz
04-08-2008, 12:22 PM
.......regarding derating and operating near rated peak level. When a drive is rated at 180V/25A you shouldn't have to worry about it running at 130V/20A IMO. It may very well be the case that none of the commonly used DIY drives monitor/control the regenerative current but that might also be the reason why so few exists (at 80V+) that actually seems to work at the level they are rated at.....

I agree, you should not worry about running them at that voltage and current levels. I can't control what is in the UHU chip firmware, but properly tuned the PID parameters and Mach3/EMC2 acceleration/speed settings, it should not fail, and if it does, I will team up with Paul and Irfan in order to correct the root cause and replace your drive.

Don't worry, your concern about the drive ruggedness is 100% valid, let's take the UHU HP to the limits, your contributions to the threads are helping us to make it better. I want you to feel like you are not on your own if anything fails, we will be backing you all the time.

I DO hope you didn't read my message as if I was bashing the HP-UHU, because I'm not.


Again, I appreciate your feedback it will be always of help to us. :)

Thank you and Regards,

Kreutz.

kreutz
04-08-2008, 12:33 PM
First, regarding the VSD-A - I don't have access to the schematic and I've no detailed info on how it works. The only thing I know is that they (Granite Devices) assures me that my motors won't destroy the drive due to regenerative braking, no matter what due to its true torque control loop. They have a peak rating of 80% of my motors continous current, while the UHU that may/may not be damaged has a peak rating of 130%. I did not know (and it would really surprise me) if the trajectory planner in the VSD-A is in effect when running Step/Direction. AFAIK it's only operational when running the drive in SPI mode.



I don't have access to the schematics either, but I have followed their threads and read the tuning documentation posted on their website. I think have a pretty good idea of how Xerxes did it and what is in the firmware, as well as the capabilities of the design based on the parts he is using. By the way, I am an admirer of his work, some time ago I was going to try a BLAC servo drive design, when I saw his drive I stopped my work, it is a good product at the right price.

Kreutz.

PCW_MESA
04-08-2008, 03:51 PM
""The 140V powersupply will "push" current thru H-bridge, thru the motor, down thru the sense-resistor and back to the powersupply untill the current sense circuit turns off the MOSFETs (just like it always does). But during the short period that the MOSFETs are ON the current generated by the 100V BEMF of the motor has a "closed circuit" from the "positive" terminal of the "generator", up thru the diode in turned OFF upper MOSFETs, down thru the other turned ON MOSFET and back to the "negative" of the "generator". The only thing limiting this current is the winding resistance, wiring, connectors, PCB traces and RdsON of the MOSFET.


For a large, high voltage, high current servo motor this current might be 100's of amps. By measuring the actual current thru the motor you can catch this and turn off the bridge before the current rises to high.""



Umm, no, there is alway the motor inductance in series...

When you apply full reverse to a motor in motion(using the above examples numbers), the applied motor voltage will change to 140V in the switching time of the MOSFETS, That is the diodes are out of the circuit since there is a low (very low) impedance path through the MOSFETS to the power rails.

Once the MOSFETS are switched, the motor current will decrease towards 0 at a rate of 240V/MotorInductance, (it has to decrease since the direction of applied voltage has reversed), pass through Zero and start to increase in the direction of the HBridge, ultimately tripping the current limit circuitry. Notice that the BEMF make the current slew faster than normal (2X would be the limit)

What limits the current is the motor inductance. Current control would be impossible without it. As long as you have at least low side current sense resistors, a fast current control circuit, and a reasonable amount of rotor inductance you are fine...


Peter Wallace

kreutz
04-08-2008, 04:11 PM
Umm, no, there is alway the motor inductance in series...

When you apply full reverse to a motor in motion(using the above examples numbers), the applied motor voltage will change to 140V in the switching time of the MOSFETS, That is the diodes are out of the circuit since there is a low (very low) impedance path through the MOSFETS to the power rails.

Once the MOSFETS are switched, the motor current will decrease towards 0 at a rate of 240V/MotorInductance, (it has to decrease since the direction of applied voltage has reversed), pass through Zero and start to increase in the direction of the HBridge, ultimately tripping the current limit circuitry. Notice that the BEMF make the current slew faster than normal (2X would be the limit)

What limits the current is the motor inductance. Current control would be impossible without it. As long as you have at least low side current sense resistors, a fast current control circuit, and a reasonable amount of rotor inductance you are fine...


Peter Wallace

I Agree!

Actually it the motor electric time constant L/R, the armature resistance is low enough to keep the time constant high enough to allow us using the pulse by pulse peak current limiting technique.

Kreutz.

PCW_MESA
04-08-2008, 04:39 PM
I Agree!

Actually it the motor electric time constant L/R, the armature resistance is low enough to keep the time constant high enough to allow us using the pulse by pulse peak current limiting technique.

Kreutz.

I guess since the current control is normally running so far from stalled rotor current (VRail/R-Armature), I dont worry much about the time constant or armature resistance, just that DI/DT = (VRail +- VBEMF)/LMotor...


Peter Wallace

H.O
04-09-2008, 12:59 AM
Hi guys,
Interesting, as usual. As soon as I think I got this someone comes along and throw in something new... ;-)

What would you say is a reasonable amount of inductance then. I realise that as the powersupply voltage goes up the reasonable L-figure does too. My motor as an example is 0.24ohm/1.2mH.

/Henrik.

PCW_MESA
04-10-2008, 08:35 AM
Hi guys,
Interesting, as usual. As soon as I think I got this someone comes along and throw in something new... ;-)

What would you say is a reasonable amount of inductance then. I realise that as the powersupply voltage goes up the reasonable L-figure does too. My motor as an example is 0.24ohm/1.2mH.

/Henrik.

I think 1.2 mH is totally reasonable since its what you have! :-)

Using the previous examples numbers (140 V rail and 100V BEMF after fast reverse = 240V total) gives a DI/DT of 200 mA per uSec, a very managable number with reasonably fast current sense circuitry.

Peter Wallace

H.O
04-10-2008, 10:13 AM
Thanks alot Peter :)

So if the switching frequency is 20kHz and our max dutycycle is 90% we would have an ON-time of 45uS (max), correct? So even with 140V rail, 100V BEMF, and full reverse the current can not change more than 9A during a single switching cycle?

I think I'm going to give up on this one, the more I "learn" the more confused I get ;-)

/Henrik.

kreutz
04-10-2008, 04:23 PM
Hello;

I took some time today to read the whole thread. Very interesting. I am not familiar with EMC but still think you might have something good going on here.

Since I am an old school guy still thinking in terms of $$/features, I can see that there are always different approaches to solve the same problem (in general, the problem is always available $$)

In this case I should dig a little more on the costs of the Mesa boards before comparing the approach to low cost 16 bit DSP controllers or low cost ARM7 based 16/32 bits processors which already include the 4x quadrature encoder interface, A/D and dedicated hardware PWM channels for less than 6 dollars a piece in qty=1.

My experience is that, in order to save a few dollars, sometimes we end up dedicating a lot of time and more money than we were willing to pay originally, but immensely satisfied by the lot we end up learning...:) Keep up the good work!

Kreutz.

kestreltom
04-12-2008, 12:37 AM
Hi Peter,

I think 1.2 mH is totally reasonable since its what you have! :-)

Using the previous examples numbers (140 V rail and 100V BEMF after fast reverse = 240V total) gives a DI/DT of 200 mA per uSec, a very managable number with reasonably fast current sense circuitry.

Peter Wallace

As I mentioned in a previous email, I have been working with Samco's Eagle schematic to modify it to include a simple current sense circuit, based on the LM319AM comparator (National Semi) Here is a link to the datasheet pdf (http://www.ortodoxism.ro/datasheets2/b/0fdselut0as7dhrhudyty34q9f3y.pdf) - so I just checked in to see what if anything has been going on in this thread and voila! - seems like a good place to be looking these days.

I have a question for you: What is the most crucial parameter that affects sense speed? If there are other factors, such as the r/c filter network between the sense resistor and the comparator, which are crucial to sense timing, would you please enlighten me here?

I hope to post a proto schematic here in a few days. Hope that you will look it over, mark it up. Thanks!

Tom

epineh
04-12-2008, 05:28 AM
I think I'm going to give up on this one, the more I "learn" the more confused I get ;-)

/Henrik.

I feel a bit the same Henrik, but it is great to see some clever minds working together to get a more DIY friendly current limit solution (I hope :))

I certainly hope you guys succeed, I have built my own H Bridge, but don't have a clue what to do about current sensing, I am kind of hoping that a simple low side sense resistor/comparator trip would be better than no current sense at all.

I have looked at high side current limiter IC's but they are all low voltage, I guess the circuit could be modified to use for a servo drive but it seems like a way to introduce more problems.

I have also heard of hall effect packages that clip onto the motor supply wire, some have a little link passing through for PCB mount, I don't have a part number yet but I wonder if they would work.

Sam if you read this, how hard is it to setup additional parallel port cards with EMC? If it is easy enough it would be sweet to have 3 ports, one for each axis and it associated IO, I am thinking the onboard port and two P-port cards. I have to admit I get a little confused with the EMC setup and I don't think it is a Linux thing as we use a couple of machines running Ubuntu at home... I must just be getting old :confused:

I will still pursue my own step/dir or wave drive servo drive as I have other plans for them but it would also be very tempting to setup 3 H Bridge's only with EMC reading the encoders/outputting PWM directly, especially as I already have one working H Bridge (without overcurrent protection though :D)

Cheers.

Russell.

H.O
04-12-2008, 07:02 AM
Hi,
I certainly hope you guys succeed, I have built my own H Bridge, but don't have a clue what to do about current sensing, I am kind of hoping that a simple low side sense resistor/comparator trip would be better than no current sense at all.
Oh, absolutely! The only thing it won't "catch" is the regenarative current which may not even be a problem depending on what MOSFETS you have in the H-bridge, powersupply voltage and the motor being driven and the level of control you have over the aceleration deceleration ramps.

Running without any current limit circuit at all would be bad though IMHO, certainly with larger, high voltage motors. Think about what happens if you run into a hard stop, there's no BEMF since the motor isn't turning so basicly what you do is apply your powersupply voltage across the armature resistance which is usualy 1ohm or less on larger motors. Yes, there's also the inductance which will make the current rise somewhat slower but it won't prevent it from reaching destructive levels.

Sorry, can't help with EMC :-/

Keep it up!
/Henrik.

NC Cams
04-12-2008, 07:05 AM
Not to spoil all the fun by jumping in late but:

A one chip, PWM servo motor control IC was offered by Unitrode/TI as the UC1637 or 2637 or 3637. All it needed was a bipolar supply and a +/- analog input and it ran a servo at 20khz as I recall. Get a copy of U-102 application note for useage how-to's.

It offered pulse by pulse current limiting via a simple to implement sense resistor at the bottom of the totem pole driver. One could easily change the sensitivity or cut-in point of the current limiting via attenuation or amplification sense via a good quality op amp .


WIth a bit of adaptation, one could also take the SG3526 (voltage controlled PWM IC) and adapt it to/for unipolar PWM motor driving. It might be much more available as are it's less featured brothers (SG3523, SG3524 and SG3524). The same ic's can be obtained from National by changing SG to LM.

Pretty sure they all have pulse by pulse current limiting built in (the 3526 does for sure)- all you do, again, is trigger it with an amplified signal off of a sense resistor.

One could drive fets directly with them (we did) but probably you'd be better off driving fet drivers with it.

PWM unidirectional driving is a snap via the 3637 - bidirectional driving might need some AND logic on the back end and some window comparator's on the input voltage end to of the PWM amps to control direction as a function of analog input voltage.

Although 100% on is not doable with the PWM chips listed, from our testing, you can't see a difference in 99% vs 100% in the DC motors we were working with.

These simple and easy to get inexpepsive IC's take care of the logic and likewise simple IC's taking care of the PWM and current limiting (on a pulse by pulse basis) should simplify the design process of the project.

BTW, the SG3526 can run a higher and lower than 20KHZ, just in case you wanted to play around with drive frequencies.

Finally, I would'nt even try to current sense at/near ground without a bopolar P/S. Using an op amp or comparator to sense ground current voltages off the sense resistor is a real challenge with inexpensive parts. Why bother to deal with that grief when a bibolar supply is already/should be available on this type of circuit anyway?

We fought theat battle in near ground voltage sensing while sensing/limiting motor current with R/C cars and and there were always issues. Use a bipolar supply and bingo, bango, you're done, relatively speaking.

The theory and schematics of the circuits and other REAL pertintent stuff to the project at hand/under discussion can be obtained in the U102 application note that should be still availble from Unitrode/TI

kreutz
04-12-2008, 10:02 AM
Hello;

Using analog PWM chips like the suggested, or the more advanced: UC1638, UC2638, UC3638, require designing the RC loop compensation circuits, which would have to be calculated for each motor (because component values depend on motor parameters).

I haven't seen (on the thread) any awareness of the required H bridge controlling signals. Having an H-bridge and PWM driving one leg or the opposite could be done of several different ways (some right and some wrong for the application), I haven't read, on this thread, any reference to 4 Quadrant control required for a servo amplifier output stage. Selecting the right PWM technique should have been done on the fist stages of the design.

I suggest reading the following basic links:

http://www.modularcircuits.com/h-bridge_secrets1.htm
http://www.modularcircuits.com/h-bridge_secrets2.htm
http://www.modularcircuits.com/h-bridge_secrets3.htm

Another suggestion: I have seen ugly accidents happening on the prototyping stage, I suggest a low power proof of concept design before tackling a high voltage high current approach. Usign an integrated H-bridge, on the proof of concept stage, as was done using the L298 and L293 is OK, but I suggest doing a discrete approach.

Handling a bi-directional DC motor with an H-bridge (like a spindle motor), even with a closed loop, is not the same as handling a servo motor.

Safety should be the first stage of the design and safety awareness should be kept during every stage. Safety includes current sensing and limiting to safe levels. This should be designed and tested before testing the H-bridge.

This post is not intended, by any means, as a way to discourage you. It is a way to tell you that there are many things you should be aware and have learned before powering on the prototype. There is a lot to learn on the way, and a lot to be proud about when you finish. Go Ahead!.

Kreutz.

PCW_MESA
04-12-2008, 10:46 AM
Hi Peter,



As I mentioned in a previous email, I have been working with Samco's Eagle schematic to modify it to include a simple current sense circuit, based on the LM319AM comparator (National Semi) Here is a link to the datasheet pdf (http://www.ortodoxism.ro/datasheets2/b/0fdselut0as7dhrhudyty34q9f3y.pdf) - so I just checked in to see what if anything has been going on in this thread and voila! - seems like a good place to be looking these days.

I have a question for you: What is the most crucial parameter that affects sense speed? If there are other factors, such as the r/c filter network between the sense resistor and the comparator, which are crucial to sense timing, would you please enlighten me here?

I hope to post a proto schematic here in a few days. Hope that you will look it over, mark it up. Thanks!

Tom

Well, if the sense circuit is for current control it need not be too fast and in fact needs to be either RC filtered or better blanked to mask the switching noise. One thing to consider with comparators is that the voltage across the sense resistor is normally quite small if you dont want to waste too much power and the ground noise is large so for accurate current sensing its a good idea to use a differential amplifier before the comparator (basically 4 wire current sensing)

In our HBridges we just use LM339 comparators, they are fast enough for good current control, since they are preceded by gain of 10 differential amplifiers, so the comparator overdrive is large (comparator speed is proportional to overdrive) I believe our blanking time is 1 uSec, that is we do not look at the comparator output until 1 uSec after MOSFET switching.

Once you have the differential amplifier you can share its output between multiple comparators (say a zero comparator for synchronous rectification or multiple levels for a drive+, drive-, hold type of current control)

Low side sensing (with 2 current sense resistors, one for each leg) is sufficient for current control in all modes including regeneration. The logic and blanking do get somewhat tricky so something like a CPLD is a good idea for the control logic.

Peter Wallace

NC Cams
04-12-2008, 12:35 PM
Regen on the MSI amps used on my Bridgeport seems to be done via high speed Schottky diodes that bypass the paralleled fets, REAL BIG ONES. Crude but effective I guess.

The issues raised in post #104 will probably be addressed via the typical "but this is a DIY project, it doesn't have to be rocket science" comment. None the less, I do hope advantade is taken of the input otherwise.

The issues brought up in the posts surriounding #104 are why the "oh by the ways" always crop up. Perhaps this is why the typical servo amp is quite populated with IC's and other goodies. They've clearly "been there and done that" (IE fixed the smoking chips problems)

Getting a DC motor to turn in both directions and also stop quickly is easy - the model train guys have done it for years. HOWEVER, do make a servo amp (transformer to the train guys) do the things a servo amp has to do, and SURVIVE under the duress it will see, takes a bit more sophistication in the circuitry.

The PWM and servo Ic's were presented to hopefully simplify the analog to PWM/high freq and the current control/pass element design aspects of this project.

The "gingerbread" (currentl limit, rc loop,, regen protection, etc) were also offered in the app note an extent answer the questions posed. Surely, if one wants to make their amp surviveable under all anticipated duress, things like RC loop comp and other application specific stuff will have to be addressed/learned.

by the way, regen on my Fanuc 5T's is handled by a huge dual conductor (2 NO's/2 NC's) relay. The drive is connected to the motors thru the NO terminals of the relay. WHen no drive signal is called for, the the NC's connect the motor leads to a dumping resistor that simply dumps any regen across the relay. The control that trigger the relay are amplified drives from TTL logic IC's. Not unlike what one could do with the PWM' and some outside logic and a window comparator on the assumed +/-10 analog drive.

If one doesn't add the protection circuits that one probably should, simply run it until it smokes. One might want to socket the chips that can/will smoke. THis way, it will be easier to fix the amp and roll merrily along. That will probably suffice unti one gets tired of replacing chips or learns how to design the necessary and appropriate protection circuitry.

However, when one does do a more sophisticated design, it is SO much more fun to run the machine than to be constantly fixing the damn thing.

epineh
04-13-2008, 01:08 AM
Low side sensing (with 2 current sense resistors, one for each leg) is sufficient for current control in all modes including regeneration. The logic and blanking do get somewhat tricky so something like a CPLD is a good idea for the control logic.

Peter Wallace

I have been quietly wondering something along these lines, what if a small but fast micro was used to monitor voltages across the sense resistor? This would mean changes could be done to the protection in software instead of hardware and could be fine tuned to a particular servo.

Just a thought.

Nice to hear from you NCCams, haven't seen you post for a while. I always enjoy reading your post's, but I don't pretend to always understand what you are talking about, a lot of it goes way over my head :)

Cheers.

Russell.

NC Cams
04-13-2008, 07:38 AM
Epineh: Thanks for the note/comment. I was quite sick earlier this year - actually, I almost died - had a friend/business partner not found me when he did, ........ Anyway, I am just getting back up an about. BIG changes in life style are on the horizon and I"m dealing with that most of my time. Other priorities keep me from coming to the Zone like I used to.

RE: bi-directional current sensing - current flow thru the bridge is ALWAYS the same direction. The pass elements/fets simply change the direction that it will travel thru the motor. Thank God for that or else current sensing with polarity changing sense voltages would be a PITA/nightmare.

RE relay protection of the drive ala Fanuc: Fanuc put their relay between the output of the drive and the motor terminals. Can't readily tell if they use high or low side sensing ans the drive schematic is broken up to MANY pages and it is very difficult to understand as it is. The way I understand it, low side sensing is easier, especially when/if you divorce the regen current thru the high side which is normally done when "braking". In Fanuc's case, they simply dump it into resistors when drive is "off".

RE: Near ground current sensing: we learned a lot about doing this while matching NiCd batteries for R/C car racing. Imagine pulling 20-40 amps from SINGLE 1.2 v cell that is only demonstrating a 0.8 or less volt output under load. All the while, monitoring voltage so that you can accurately graph a FULL discharge curve of the cell. And also, watching for a clean/consistant cutoff dnd discharge voltage. AND, to stop the discharge process consistantly. Cheap simple circuits don't always work well when you try to do that.

When/if one looks at the UC3637 IC, one sees' how this is all done. IE Low ohm sense resistor, R/C filter/buffer feeding the current sense inputs, an "op amp" (which really could be an amp and comparator to amp and sense the sense voltage).

Hint to DIY'ers: not all the schematics of the inside of the IC are exactly what they're doing - some of the magic and "smoke" of the IC's are merely the sophistications discussed previously that are not easily duplicated as well or as cheaply as the IC. HING: buy the IC and simplifiy life and the process.

Whether one uses IC's or micro controllers, the issue eventually becomes one of cost and complexity. Micros are neat, compact devices BUT require programming. THis alone can push the cost factor outside the realm of doability or affordability of the DIY'er and/or his project.

The problem with IC's is board space and cost escallation as parts proliferation/circuit sophistication rises. Analog control via IC's is perhaps easier for the DIY to do as there are any number of circuit ideas out there that can be adapted, grafted, outrigh plagiarized or simply kluged as needed.

For the adept designers, it is probably easier to start from scratch, for the neophyte DIY'er, probably a cut and paste/adapt as knowlege is obtained method might be better.

The UC3637 (depending on availability) or others of the same ilk would be where i'd staft as an upscale DIY'er that I am. The hard stuff is done (PWM, high freq switching, current sensing, pass elements). It would get you going FAST. Apply bipolar power (forget low voltage, too much noise) and off one goes.

Want to get sophisticated with N level fets thruout the bridge? at least you have a proven pass element that works and start from. Pretty easy to switch out a working element for the experimental one.

Want to do high side sensing of drive vs braking current? I"d suggest it is easier to put a comparator circuit on the drive signal, take that and drive a protective relay ala Fanuc did.

This way, you isolate the drive from reverse current. IMO, it is easier and better to keep the braking current from getting to the drive than figuring out a way to deal with it or to protect the drive AFTER, if/when it gets there.

The question, I guess is whether one is trying to totally reinvent the wheel. Or, simply trying to make an inexpensive one to drive a motor adapted to servo use rather than designed for it (instert title of thread here for "reality check").

The technology to drive servo motors is QUITE mature albeit not well documented for the picking on the net. (The 3637 is one of the few and one of the easiest that I found). The way I see it, the project at hand is one of reinventing a wheel that is affordable and simple enough for DIY (cheap) construction on a onesy,twosy basis.

Finally, if this is a breadboard project, low voltage current sensing is difficult at best to do under the best of cases. It is beyond inconsistant and frustrating when breadboarding a project. Even the use of a PCB deserves careful design layout and packaging for the same reasons - reading low/near voltage grounds requires knowhow and a well thought out board and GOOD pieces (sense resistor, amps, board layout, etc).

We learned our lessons trying to sense 20-40 amp signals across 0.01 ohm sense resistors and trying to keep current CONSTANT thru the process. From what I know about that level of sensing, my suggestions are: KISS (keep it simple stupid).

Get something to work, perhaps copying some of the circuit simply to use a proven building block so as to simplify repairs in the case of an "OOPS". Too many unknowns or unproven "clean sheet" circuits makes for a frustrating journey thru the already murky world of electronics and IC's. As far as electronics goes, you can't see electrons flow thru them, THEREFORE you can't trust them. Besides, anything that relies on "smoke" to function, (when you let the smoke out of IC"s, they quit working), it CAN'T be trusted.

kreutz
04-13-2008, 10:26 AM
.............

RE: bi-directional current sensing - current flow thru the bridge is ALWAYS the same direction. The pass elements/fets simply change the direction that it will travel thru the motor. Thank God for that or else current sensing with polarity changing sense voltages would be a PITA/nightmare..............



Not completely right.

Regenerative current in Fast decay flows in opposite direction on the sense resistor (when the current sense resistor is placed either on the high side or the low side) developing a negative voltage on it. Depending on the PWM mode, you need to measure the regenerative current in order to control average current (and in the safety/current limit circuit). Slow Decay current, if employed (sometimes is used to brake the motor), is not even sensed unless the current sense device is positioned in series with the motor, which