Electromagnet waveform

ronv

Joined Nov 12, 2008
3,770
I agree, The real inductance is probably higher with the plunger in and the back EMF. That would explain why the voltage at the top of the coil drops further than expected.
I'm thinking the voltage and current measurements were made in actual operation??

upload_2015-3-11_13-58-8.png
 

ronv

Joined Nov 12, 2008
3,770
OK. I added some back emf to the coil and now it looks just like the picture.
Also added stuff to interface with the micro and the current sense.
It's starting to look like an entry in the messiest schematic contest.
I did not completely isolate the micro from the high voltage, but I did kind of protect it.
It will probably still need some tweeks and we need to pick parts, but maybe you guys can check it out. Tomorrow the little love dumpling gets cataract surgery so I won't be around much.
No offence, but if you promise to not let the micro hang in high power we can size a lot of stuff for average power instead of maximum possible. Up to you.
 

Attachments

Thread Starter

cmartinez

Joined Jan 17, 2007
8,253
I'll take a look at the schematics, and study them some more. You have earned my forever grateful award.
The best of luck with your cataract surgery!
 

Thread Starter

cmartinez

Joined Jan 17, 2007
8,253
Ronv! I'm getting an error when I try to open the file! it tells me I don't have the LM358 LTspice file!
I've already tried googleing it and I can't find it, and if I did, how do I install it?
 

ronv

Joined Nov 12, 2008
3,770
Sorry, My bad. :(
You can just use a low voltage zener from the spice library for the 1N751.
And a LT1014 op amp for the 358.
 

Thread Starter

cmartinez

Joined Jan 17, 2007
8,253
Excellent! Thank you very much! I'll take a look at it and then get back to you.
Glad you're back, I assume that your cataract operation went well?
 

ronv

Joined Nov 12, 2008
3,770
It's pretty much the same -- just some real parts.
The only thing bothering me is that the pwm needs to start faster than your picture, but it may act a little different with the real coil.
It was the wife that had the sugery -- she is already out spending money. :)
 

Thread Starter

cmartinez

Joined Jan 17, 2007
8,253
Well, I'm glad she's ok... the best indicator of a woman's health is her enthusiasm for going shopping.

Question:
The initial pulses reach a negative voltage on startup, about -10V, while the maximum voltage reached is 80V instead of 120V.
Is this important? Can it be adjusted? Or maybe I should just build this thing already, make measurements, see how it works, and then take it from there?
 

Thread Starter

cmartinez

Joined Jan 17, 2007
8,253
Here's the coil's waveform shown by LTspice, it looks the same when referenced to ground or to the lower side of the coil.

Capture.JPG
 

ronv

Joined Nov 12, 2008
3,770
I think I got to cute trying to model the back emf. Just take V4 out. I think all will be ok when the pwm is closed loop with the micro.
 

Thread Starter

cmartinez

Joined Jan 17, 2007
8,253
I think I got to cute trying to model the back emf. Just take V4 out. I think all will be ok when the pwm is closed loop with the micro.
Yup... taking V4 out did the trick, and now things are back to normal. Maximum voltage at the startup pulses reaches only 100V, but that's Ok, I guess. Guess I can take it from here... I'll order the parts, do the assembly and get back to you.
One last thing, where can I find the LTspice model for the 1N751 diode?
 

ronv

Joined Nov 12, 2008
3,770
We should go back and revisit the power supply as well. We can raise the voltage a bit. I'm not sure how to handle the back EMF since we have no way of knowing how the solenoid acts exactly, So you might want to get a selection of 10 watt resistors so the current can be adjusted.

Here is the 751 file. I think you can just paste it in the end comp file under standard diodes.
The comp file is ltspiceIV, Library, comp.

.model 1N751 D(Is=.88f Rs=.25 Cjo=175p M=.55 nbv=1.7 bv=5.1 Vj=.75 Isr=1.86n Nr=2 Ibv=20.245m Ibvl=1.96m Nbvl=15 Tbv1=-21.3u Vpk=5.1 mfg=OnSemi type=Zener)
 

Thread Starter

cmartinez

Joined Jan 17, 2007
8,253
We should go back and revisit the power supply as well. We can raise the voltage a bit. I'm not sure how to handle the back EMF since we have no way of knowing how the solenoid acts exactly, So you might want to get a selection of 10 watt resistors so the current can be adjusted.

Here is the 751 file. I think you can just paste it in the end comp file under standard diodes.
The comp file is ltspiceIV, Library, comp.

.model 1N751 D(Is=.88f Rs=.25 Cjo=175p M=.55 nbv=1.7 bv=5.1 Vj=.75 Isr=1.86n Nr=2 Ibv=20.245m Ibvl=1.96m Nbvl=15 Tbv1=-21.3u Vpk=5.1 mfg=OnSemi type=Zener)
Thanks! it worked like a charm. I was just going to ask you that, since I found several LTspice models that were just plain text like this one, and I didn't know how to install them.
Another thing that I noticed is that the mosfet's labels don't correspond to the mosfet model being used in the simulation. Should I buy the ones specified in the labels?
Also, I'm giving serious thought to building the 12V to 120VDC power supply instead of the one you suggested, since I'd like to avoid running another cable to the machine. 12VDC is readily available close by, but 220VAC is not.
 

ronv

Joined Nov 12, 2008
3,770
Thanks! it worked like a charm. I was just going to ask you that, since I found several LTspice models that were just plain text like this one, and I didn't know how to install them.
Another thing that I noticed is that the mosfet's labels don't correspond to the mosfet model being used in the simulation. Should I buy the ones specified in the labels?
Also, I'm giving serious thought to building the 12V to 120VDC power supply instead of the one you suggested, since I'd like to avoid running another cable to the machine. 12VDC is readily available close by, but 220VAC is not.
Yes, the ones in the labels are the ones to buy. I just used parts with similar characteristics in the simulation.
Ugh on the power supply. I guess you could buy a small inverter, rectify it and regulate it. Just seems a waste to step it down then step it back up.
 

Alec_t

Joined Sep 17, 2013
14,314
Any idea what purpose the dozen or so little humps along the plateau section of the waveform serve? Clearly the valve is receiving holding current throughout the plateau, but why that modulation? I could understand the current being chopped right at the end of the plateau perhaps, to slow the valve's closing; but there seems no reason to modulate the current mid-plateau.
 

Thread Starter

cmartinez

Joined Jan 17, 2007
8,253
Any idea what purpose the dozen or so little humps along the plateau section of the waveform serve? Clearly the valve is receiving holding current throughout the plateau, but why that modulation? I could understand the current being chopped right at the end of the plateau perhaps, to slow the valve's closing; but there seems no reason to modulate the current mid-plateau.
The waveform can last anything from 3 ms and up to around 10 ms, and has a cycle of around 20 ms. It always starts with the high voltage pulses, and ends with the negative kickback at the end. But the plateau is stretched accordingly to make it last the amount of time set by the controller. As the plateau stretches, more of those bumps begin to appear at regular intervals.
Since this machine sometimes works 24/7, my guess is that those small voltage cutoffs are there to keep the valve's coil at a low temperature as possible.
And by the way, the plateau in my original measurements has several bumps going to 0 volts, while the one generated by @ronv 's circuit go to 12 V. That really doesn't make much of a difference at this point, since it's something that I can reprogram in the MCU I'm planning to use. Which by the way, is the AT89LP4052.
 
Top