Inductive Casting Machine controls - Page 1
Forum section: electronics / general

author: ratdude747
author_rank: Regular Contributor
timestamp: December 15, 2014, 09:21:51 am
content: For my Senior Capstone project, I was tasked with redesigning the controls for an Inresa S-300 Casting machine.Part of the agreement between my College and the machine's owner is that it becomes OSHW, hence why I'm re-posting it here. I don't have a github link yet, but I will shortly.All of the design files and whatnot have been finalized, and I'm waiting on PCBs and the second half of the part order.A kinda-brief description of the project:The machine is a 1992 Vintage Inresa S-300 Vacuum casting machine, made in Germany. It is powered off 240VAC 25A, for sizing purposes. It was originally made for the jewlery industry, having both vacuum and inert gas connections along with water cooling.The beef of the machine consists of a Primary and secondary; the Primary is a phase controlled SCR design used to generate 0±170VDC (two rails), which is re-inverted by the secondary to a pure-sine 18.6kHz using four TRACs and LC pairs (two per rail). The controling is done by a discreet PID and thermocoulple interface, and a mix of analog and digital (discreet ICs, nothing programmable) circuitry.The machine is missing 3 control cards, which are used to interface with the front panel and pulse the primary and secondary. My task is to redesign a solution to replace the cards (which are unobtainum) in a (where logical) more modern design that is both mod-friendly and replicable by people less skilled in electronics.My design is based around the Atmel ATmaga328P aka Arduino Uno, and uses all through hole devices on a 5x5 PCB. The Secondary and switch logic is all in the code, while the primary and analog inputs (PID, Power knob, and Primary rail check) are a hybrid design containing some analog circutry (mainly for AC sync and 5V to 15V conversion). Provided on headers are all 3 supply rails (+24,+15, and +5), the two unused I/O pins (Rx and Tx), SPI, a PID breakout jumper (for changing temperature interfaces), and ISP.The Schematics and PCB designs were done in KICAD, and the coding done in codevision AVR (I used C).In the mean time, here's the PCB renderings from OSH park (whom I've order the boards from):Side note, All files not text/image/gerber will have PDF versions, along with .svg's of every PCB layer; original editable sources will also be uploaded.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 15, 2014, 10:39:47 am
content: Schematic? What the heck does it do? Specs on the interface?If you're controlling on the level of actually pulsing the thyristors and stuff, I strongly advise against that. One teeny little slip-up in your code, the AVR crashes and poof goes a thousand dollars of semiconductors and/or fuses.Tim

author: ratdude747
author_rank: Regular Contributor
timestamp: December 15, 2014, 12:27:37 pm
content: Quote from: T3sl4co1l on December 15, 2014, 10:39:47 amThat was all to be in the github which I STILL haven't gotten together. For now, I'll attach the old schematic, the new (replaces PCBs 305, 308, and 380), and my code.Yes, it is at that level... but there are isolation transformers on all 6 pulse lines... they follow this format:IC (AVR/TCA785) -> voltage divider -> TIP120 (24V) -> IT255 Pulse transformer (Isolation and protection) -> Thyristor (SCR/TRIAC).So, even if it crashes, unless the interrupt routine driving the secondary doesn't get the memo to shut off (and even so, one would see the temps going way too high and shut it off at the hard switch), in all other fault modes in the worst case the primary gets left on (which the old design did anyway) and the secondary is stalled (due to the transistor's coupling).This is what the owner wanted (he's ex IBM with 24 patents; he's no dummy) and I know that a lot of welding equipment and the like use microcontrollers for control.

author: Paul Moir
author_rank: Frequent Contributor
timestamp: December 16, 2014, 12:44:45 am
content: A couple things strike me:No bypass capacitors. Fix that.No capacitance on the output of the regulators. While not strictly necessary, I'm not entirely comfortable with not having them especially in what's supposed to be a robust design. Its one of those things that you really have to look at 3 or 4 manufacturer's datasheets to infer. Some are not all that explicit about it. OnSemi's says "COut is not needed for stability; however, it does improve transient response. Values of less than 0.1 uF could cause instability." What do you make of that? Fairchild's says nothing, but most of their graphs have a COut present.Questions:Why the voltage dividers on the bases of the TIP120s? Why not just limit current with a single base resistor?Why are you driving the upper ones so hard? Fast switching a lot of power through those transformers?

author: ratdude747
author_rank: Regular Contributor
timestamp: December 16, 2014, 01:09:53 am
content: Most of the design bits in question were pulled from the old design... The voltage dividers worked in testing. Everything else was cloned from the old design part for part, and I didn't see a point in dicking around and reinventing the wheel.As for the voltage regulators, the old design didn't have caps after the ldo. This is all pretty low frequency stuff so I didn't see a point. It's not like it's a radio or anything.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 16, 2014, 01:49:50 am
content: Quote from: Paul Moir on December 16, 2014, 12:44:45 amA single base resistor limits current, but provides  no turn off current. Remember, the base is voltage controlled, and charge must be removed in order for the transistor to turn off, just like a MOSFET. The main difference: the base draws current (sometimes helpful, sometimes not), and the gain is much higher (fractional volts between on and off, not one or several volts).On the downside, TIP120 is a Darlington, meaning the second transistor has no means to withdraw base current besides recombination and internal construction (sometimes a diode back to the first base, or an internal B-E resistor: the latter is the case for TIP120). So it's very slow, on the order of a microsecond or so turn-off. Which isn't a big deal here, at least (SCRs are about as slow).It's noteworthy that none of the TIP120s are short circuit protected, so if the MCU crashes, not only are the power output / pre-reg SCRs left in an indeterminate state, the transistors or transformers get fried too.Tim

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 16, 2014, 01:54:04 am
content: Quote from: ratdude747 on December 16, 2014, 01:09:53 amThis is an extremely irresponsible or lackadaisical attitude: just because the fundamental isn't fast, doesn't mean it's not precise, or the transients aren't substantial.Supposing you actually need the several amperes capability of the TIP120s, you will get transients of many amperes per microsecond going through the supply rail! That won't be very friendly with long, thin traces and no supply bypass caps!Tim

author: ratdude747
author_rank: Regular Contributor
timestamp: December 16, 2014, 03:41:45 am
content: I understand fourier transforms. I also understand KISS and the like.Note that all the TIP 120's are sourced from a separate diode/capacitor combo off the filtered 18VAC... I was also generous with the two filtering capacitors value wise; both are IIRC beefier that what was present.I don't get what you mean about short circuit protection, the SCRs should be OK since they're transformer isolated. The old design did have capacitor coupling on the secondary TIP120 bases (in place of the voltage dividers), but this was more to account for the fact that the control logic was run between ground and a -15V rail. Originally I kept the setup but during a breadboarding test 5V wasn't enough to saturate the TIP120 through any capacitor I could try; while i could have then used a PNP to convert to 15V logic, to me, that seemed silly and too complicated.However, I didn't account for an MCU crash; In fact, I forgot that the outputs all go HIGH when the chip is ISP'd! To bad the boards are already ordered... What will cover me at least (and is good practice anyway) is that the transformers on the secondary are on the main board, not my board; they can be unplugged (and as part of the procedure, they will be). In addition, since an ISP provides 5V, the unit could be powered off.While this is indeed shitty engineering, I'll run with the current design and not build all three boards, knowing I may have to reorder them with a different secondary current boost design (I'd toss in some extra bypass caps just to be safe since I was having to rework it anyway).I may retry using capacitor isolation on the secondary pulse lines... Before I wasn't getting enough out of them to trip the TIP120And to say all my professors liked my design work... I feel like nothign but a fraud.

author: Paul Moir
author_rank: Frequent Contributor
timestamp: December 16, 2014, 03:53:53 am
content: Quote from: T3sl4co1l on December 16, 2014, 01:49:50 amThank you!

author: ratdude747
author_rank: Regular Contributor
timestamp: December 16, 2014, 08:30:22 am
content: Added Bypass caps to the schematic and pcb layout, now up to V1.1See the attached schematic and PCB renderings. Yes the Schematic is odd, but due to space I had to put the caps in thier own area. I at least marked what ICs they correspond to.Each rail, thus, has 2 0.1uf caps (1 per IC), so that should suffice. As for adding caps for the LDO outputs, I haven't gotten that far and Honestly I'm unsure what if anything would be appropriate. Would the Bypass caps suffice? (keep in mind the LDO's are fed by an EMI filter'd 18VAC with a generous input cap). If Not, I can rearrange the PSU section a bit (I have space, even with heatsinks) and add a couple caps (I'd rather not dick with it).

author: SeanB
author_rank: Super Contributor
timestamp: December 16, 2014, 09:13:09 am
content: A 7805 made by Nat Semi ( now TI) is stable at any input and output voltage and current, and will be happy even with a 1m length of 22AWG wire on all 3 leads, but a LDO will not do that. At some point with input voltage, output current and load impedance it will turn into a power oscillator, and even though with a DMM on the output giving a rock steady 5.00VDC, looking on a scope you might see a 1MHz or so sine wave of around 3Vpp on this supposedly stable rail. If it does this during power on you might only have the symptom of the CPU not starting every time, or doing a watchdog reset then running, or starting with odd values in registers instead of resetting properly. If unlucky this happens sometime during operation and the CPU crashes and blows up the transformers every few weeks.Add 10uF ( minimum value, you can use anything from 10 to 47uF if in the BOM) 35V aluminium SMD capacitors (105C or 85C, just must have low ESR and be rated for the ripple current of the load, but not too low, the datasheet will give advice, and not ceramic) right next to the regulators ( as in within 1 inch, using a thicker trace than you now have) on both input and output side, with a pair of vias to the ground plane right next to them, and then you are very unlikely to have issues with the regulation.Another tip is to use the 15V regulator output to provide power to the 5V regulator, then you share power dissipation more evenly between the 2, and as a bonus you can only use a single capacitor on the short link between the regulators, as it will satisfy the requirements for both simultaneously.

author: ratdude747
author_rank: Regular Contributor
timestamp: December 16, 2014, 09:42:04 am
content: ^I see. No SMD allowed on this one (as it is designed to be easy to solder)... Would 10-47UF lytic do the trick?I'm less keen on driving the 5 off the 15... as that makes the 15 supply BOTH. Neither is super heavy power draw (the 15 has two ICs and a front panel LED power readout display, and the 5 has one IC plus the MCU).Question: are the 7805 and 7515's technically LDO's? You make it sound like they're not, but I swore I saw them referred to as such.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 16, 2014, 09:52:47 am
content: Digikey puts 7805, etc. under "Regulators (LDOs)" (or whatever their exact heading is) because there's so damn many LDOs, who cares about the... HDOs, I guess.Even many self-proclaimed LDOs are not, e.g., the LM1086 referenced in another thread, or the ever popular LM1117 (same design).Only way to tell for sure is RTFDS. :/Tim

author: ratdude747
author_rank: Regular Contributor
timestamp: December 16, 2014, 10:03:18 am
content: ^Which I did... doesn't matter as this circuit is more or less what a pissant bench PSU from my freshman projects class used.TI said to use a 0.1uf ceramic disc for an output cap... I have 5 zillion film caps of that value already used for chip bypassing... I'll add two more near the regulators (worst case, the footprint will also work for ceramics). But I'm not going to add vias or SMD, as that's not what this project is about (I strive to not use vias at all, all side switching is at through-holes for parts).

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 16, 2014, 10:27:46 am
content: Why via aversion?For one, you're just using vias for all your components...same process.Vias are basically free, so by not stitching the ground plane, you're wasting a huge opportunity to make your circuit reliable, especially in the presence of high power switching.Tim

author: SeanB
author_rank: Super Contributor
timestamp: December 16, 2014, 11:35:19 am
content: With the pinout of the regulators you are using ( and BTW the -20V rail cap is silkscreened the wrong way) a standard 78xx will not fit there, so you are using a LDO version. The reason for the cascaded regulators is to make both heatsinks dissipate a similar amount of heat, and will keep the regulator dies cooler as they both share the load, instead of one doing all the work. A lot of the LDO chips need derating at high differential voltage, so lowering it does help, and provides an extra layer of overcurrent protection and is good to do.Standard leaded caps will work there just as well, and just use a good brand, not the cheapest one from MysterLee Clomolents in the mall. If you use ceramic leaded caps then you already have the footprint for most electrolytics there, just put one in instead.

author: ratdude747
author_rank: Regular Contributor
timestamp: December 16, 2014, 12:01:03 pm
content: Umm no, there is no -20V on this board. It's all positive rails. the OLD design had a -15, but I nuked that as I saw it as less trouble to just use single supply opamps. The second diode and Cap is for the transformer/TIP120's, which are run off the rectified and filtered 24V as per the old design.See a previous post for what I did about output caps... the input ones are UCC KY (IIRC they work for linear supplies, for SMPS jobs I use Nichicon HE). I've been on badcaps.net for years; I know about cap quality and where to use what 'lytic.I thought Dave Jones himself said "the ultimate goal in 2 layer through hole design is do it without a single additional via" (IIRC it was in the TRS 80 video). Sure, extra vias are more or less free, but I have massive ground planes with plenty of grounded devices that in themselves stitch the planes.Edit- nope, he said it was the avoidance of jumper links. Doh! Well, looks like I'll be stitching it... I suck.Next one of you will probably tell me to fab an RF can for it... This isn't an RF device... other than the 16MHz clock crystal, everything else is run no faster than 18.6kHz. If this were a bluetooth/wifi dongle then sure I'd hae littered it with ground VIAs. But here, they just get in the way and add one more thing I have to mess with every time I tweak the artwork.see attached.

author: SeanB
author_rank: Super Contributor
timestamp: December 16, 2014, 01:00:20 pm
content: Oops my wrong, thought it was a negative rail. I would also suggest an extra 100n ceramic across the input and output of your common mode choke, or connect the earth pin of the filter to something if there are capacitors inside.

author: ratdude747
author_rank: Regular Contributor
timestamp: December 16, 2014, 01:07:06 pm
content: The earth on the EMI filter (LC combo, it's an schaffner FN405) was left floating in the old design. I'd run it to one of the mount screw pads but I don't want to rely on that for a ground.

author: jeremy
author_rank: Super Contributor
timestamp: December 16, 2014, 01:26:17 pm
content: The important thing that via stitching solves is keeping return path impedance low. I'm not saying that this is what you did, but unfortunately a lot of students I have taught seem to try really hard to keep the +ve supply lines short, then just dump a ground plane on it and assume it will connect the other end ok.So T3sl4co1l is right, if you have unavoidable "islands" in your copper plane, it's a good idea to stitch them where possible using the other side of the board. But, if you just have a massive ground plane with no cuts, I think you will have minimal gains from via stitching over just relying on the through hole parts.But I am no PCB expert!

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 16, 2014, 02:13:33 pm
content: An RF can is probably not necessary, but if it's mounted inside, right up by all the power switching -- it might not be a bad idea!Solid planes can prevent or solve a lot of ugly problems. I designed a high frequency induction heater that used low voltage logic on the control board (multilayer, internal ground plane), which was mounted mere inches away from, and facing, the inverter modules. Which in the early prototype, had bad ringing, on the order of 400V peak and 60MHz, all over the damn place. But no logic glitches we could detect within the control board.A single side over ground plane design will work almost as well as multilayer construction. Traces are usually higher impedance and further from the ground plane (say 60 mil instead of 10-20 mil), so a few times more susceptible. But still, it's not easy for magnetic flux to get under the traces and induce interference, because of the shielding effect of solid ground plane.A double sided (stitched ground plane) design will work even better, probably as well as multilayer construction. If the design isn't very dense, then any given set of traces will be surrounded not only by ground plane on the opposite side, but plane on the same layer, on either side (look up 'coplanar waveguide with ground plane').But if you have big ol' slots and holes running through your ground (or other) pours, you lose the shielding benefit, and fields can extend through and wrap around traces, inducing noise.Keeping node impedances low also helps, since electrostatic induction is important too.Tim

author: ratdude747
author_rank: Regular Contributor
timestamp: December 17, 2014, 03:54:31 am
content: ^The RF can was sarcasm.---Found a HUGE problem. FAIL!I neglected to replicate the two 5W 220 ohm resistors used to feed the 24V to the secondary... which during some breadboard testing today I found was putting the TIP120s in thermal runaway!(this didn't happen when run at the primary's 60Hz and 30ns pulse duration, hence why it didn't have that on it's board).My guess is it was used to isolate the voltage and turn the current boost into more of a current based system.You know something is ****ed up when even with TIP122's and large heatsinks it overheats and stinks yet the stock pictures of the missing board show no heatsinks at all!I also missed that they were using a far beefier 1000uf filter cap and had a 68n bypass cap (I bumped it to 100n, since I have bajillion of those already in the design).Regarding what I meant to test, I was trying again with the capacitor coupling, which worked once I added the actual transformer. It used 220p for the old -15V logic, which I tripled to 680pf, since my AC signal is effectively 1/3 the size (with a different DC offset).This way, if the outputs for whatever reason get tied high, the caps coupling prevents that from burning the current boost stage.So, the changes made in this new update:-Redone secondary current boost, fed off two power resistors, bypass capped, and using a coupling capacitors in place of voltage dividers-Beefier PSU, with bigger caps and (where logical) fatter traces (40mil or 70mil)-Ground plane stitiching (my ground planes were already tied in all locations but this is extra insurance)This issue probably makes the ordered PCBs scrap copper... but for testing they hopefully will work (if I even go that that far, as so much is messed up I'm afraid even bodges won't make it testable).Look better at least?

author: ratdude747
author_rank: Regular Contributor
timestamp: January 15, 2015, 01:58:06 am
content: Many updates later... and I'm back to posting.Up to R1.6, with many changes, mainly better/fixed footprints, thicker traces, and better IC oreientation. I've also simplified the resistors (no more 0.4W ones, which were vestiges from the old design that were overspecced).Still in active development, all of the analog circuitry has been tested and confirmed on a V1.0 PCB.

author: dmills
author_rank: Super Contributor
timestamp: January 18, 2015, 06:55:46 pm
content: Do the supply tracks to that (I assume) transformer at the top of the board meet creepage and clearance spacings for whatever the supply voltage is?Seems to me that the copper pour is rather too close to those tracks if they are at mains potential.Regards, Dan.

author: ratdude747
author_rank: Regular Contributor
timestamp: January 18, 2015, 07:03:55 pm
content: Nope, it's an EMI filter. 18VAC on both sides.