Forums

Re: LTspice question: modelling a solenoid

Started by Phil Allison May 7, 2009
On Fri, 08 May 2009 11:20:28 -0700, John Nagle <nagle@animats.com>
wrote:

>Jim Thompson wrote: >> On Wed, 06 May 2009 22:14:03 -0700, John Nagle <nagle@animats.com> >> wrote: >> >>> I need to model the "selector magnet" of a Model 15 Teletype. >>> This is an electromagnet with an iron core. >>> DC resistance is 55 ohms. Inductance is 4 Henries. >>> Normal operating current is 60mA continuous, but because of the >>> huge inductance, the normal power source is 120VDC fed through a 2K resistor. >>> >>> How do I divide up the resistance between the SPICE "series resistance" >>> and "parallel resistance"? Any ideas? >>> >>> John Nagle >> >> What does the flyback condition look like with the _real_ solenoid? At >> 4H I would expect some pretty low frequency "squirrelies" ;-) >> >> ...Jim Thompson > > The traditional driving circuit is a 120VDC supply fed through >a 2K resistor and keyboard contacts, with no snubbing at all. The contacts >arc visibly and produce noticeable ozone. That's the 1930 technology >in its original form. > > My present driving circuit is a 120VDC open-frame supply fed through >a 2K resistor and a high-voltage optoisolator, with a snubber consisting >of a 1pf cap in series with a 100 ohm resistor. This works fine, but >it's a bit bulky. > > I'll have to hook up a scope and look at the voltage across >the selector magnet. (After wiring up a voltage divider >to get the voltage down to the scope's range.) > > Trying to do this off a 5V supply is mostly an elegance thing. >But I may need to build a USB interface. Most USB to serial >converters won't go down to 45.45 baud. (They should, from the >spec, but in practice the firmware in common use won't go below >110 baud.) I want to run the Teletype from a laptop with USB >ports only, instead of a mini-tower PC with a classic serial port >that will run at 45 baud. So I may have to use an Atmel CPU with >USB software as an interface device. If I do that, it would >be convenient to eliminate the need for the 120VDC supply and >run the whole thing off the USB port. > > John Nagle
Here's how I'd attack your problem (in the manner of how I used to make CD ignition systems).... http://analog-innovations.com/SED/HammerDriver(J.Nagle).pdf (Paste to make sure your reader gets the parentheses part). [1] It is left as an exercise for the student to choose a PowerMOS replacement for S1... I no longer carry a catalog in my head like I did in the '80's :-) [2] Also what logic to choose for the driving signal path. [3] The coil is presently modeled simply as 4H + 55 Ohms. If it were my project I'd take a network analyzer to the coil. I'd also measure inductance versus current, and create an accurate Spice model... I suspect that the real world will be full of ring-a-ding-dings ;-) ...Jim Thompson -- | James E.Thompson, P.E. | mens | | Analog Innovations, Inc. | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | Phoenix, Arizona 85048 Skype: Contacts Only | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at http://www.analog-innovations.com | 1962 | Stormy on the East Coast today... due to Bush's failed policies.
On Wed, 06 May 2009 22:14:03 -0700, John Nagle <nagle@animats.com>
wrote:

> I need to model the "selector magnet" of a Model 15 Teletype. >This is an electromagnet with an iron core. >DC resistance is 55 ohms. Inductance is 4 Henries. >Normal operating current is 60mA continuous, but because of the >huge inductance, the normal power source is 120VDC fed through a 2K resistor. > > How do I divide up the resistance between the SPICE "series resistance" >and "parallel resistance"? Any ideas? > > John Nagle
Now at device level (no behavioral).... http://analog-innovations.com/SED/HammerDriver(J.Nagle)2.pdf (Paste to make sure your reader gets the parentheses part). 11mW dissipation in the MOSFET ;-) ...Jim Thompson -- | James E.Thompson, P.E. | mens | | Analog Innovations, Inc. | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | Phoenix, Arizona 85048 Skype: Contacts Only | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at http://www.analog-innovations.com | 1962 | If I'm talking, you should be taking notes.
On Tue, 12 May 2009 15:24:51 -0700, Jim Thompson wrote:

> Now at device level (no behavioral).... > > http://analog-innovations.com/SED/HammerDriver(J.Nagle)2.pdf
There's a problem with this, Jim. Your circuit works fine with a continuous pulse train, but teletype isn't like that, it can have long periods of no activity (constant Mark signal), then a few characters, then more inactivity. The selector magnet must respond to the first drop to Space (beginning of start bit) of the first character. The idle state is constant Mark (positive or 0V, depending on whether it's polar or neutral signaling). John's approach does take account of this. -- "Electricity is of two kinds, positive and negative. The difference is, I presume, that one comes a little more expensive, but is more durable; the other is a cheaper thing, but the moths get into it." (Stephen Leacock)
On Thu, 07 May 2009 10:16:12 -0700, John Nagle wrote:

> The circuit seems to better snubbing at the selector magnet, to dump > the > energy when the magnet is turned off. But I'm holding off on that until > the model is realistic. For a real magnet, the R/C snubber shown is > sufficient.
Running a simulation here, I get a massive (400V plus) negative spike at the coil on turnoff. I'd suggest replacing the RC snubber with a diode and a 2k resistor, which will give the same falling time constant as the original 120V "brute force" circuit, and reduce the -ve spike to around -80V. BTW, is there any reason for running your simulation at 75.75 baud, rather than the 45.45 you said you would be running the machine at? -- "Electricity is of two kinds, positive and negative. The difference is, I presume, that one comes a little more expensive, but is more durable; the other is a cheaper thing, but the moths get into it." (Stephen Leacock)
On Sat, 16 May 2009 08:43:14 -0700, Fred Abse
<excretatauris@invalid.invalid> wrote:

>On Tue, 12 May 2009 15:24:51 -0700, Jim Thompson wrote: > >> Now at device level (no behavioral).... >> >> http://analog-innovations.com/SED/HammerDriver(J.Nagle)2.pdf > >There's a problem with this, Jim. Your circuit works fine with a >continuous pulse train, but teletype isn't like that, it can have long >periods of no activity (constant Mark signal), then a few characters, then >more inactivity. The selector magnet must respond to the first drop to >Space (beginning of start bit) of the first character. > >The idle state is constant Mark (positive or 0V, depending on whether it's >polar or neutral signaling). > >John's approach does take account of this.
If "Mark" is current in the solenoid, it's fine. (I'm obviously not at all familiar with Teletype... I'm not THAT old ;-) ...Jim Thompson -- | James E.Thompson, P.E. | mens | | Analog Innovations, Inc. | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | Phoenix, Arizona 85048 Skype: Contacts Only | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at http://www.analog-innovations.com | 1962 | Stormy on the East Coast today... due to Bush's failed policies.
On Sat, 16 May 2009 09:10:20 -0700, Jim Thompson wrote:

> If "Mark" is current in the solenoid, it's fine.
On a neutral (current or no current) system, mark is no current. Makes idling more economical. -- "Electricity is of two kinds, positive and negative. The difference is, I presume, that one comes a little more expensive, but is more durable; the other is a cheaper thing, but the moths get into it." (Stephen Leacock)
On Sat, 16 May 2009 09:25:47 -0700, Fred Abse
<excretatauris@invalid.invalid> wrote:

>On Sat, 16 May 2009 09:10:20 -0700, Jim Thompson wrote: > >> If "Mark" is current in the solenoid, it's fine. > >On a neutral (current or no current) system, mark is no current. >Makes idling more economical.
Could the first "space" be made long? ...Jim Thompson -- | James E.Thompson, P.E. | mens | | Analog Innovations, Inc. | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | Phoenix, Arizona 85048 Skype: Contacts Only | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at http://www.analog-innovations.com | 1962 | Stormy on the East Coast today... due to Bush's failed policies.
On Sat, 16 May 2009 09:34:46 -0700, Jim Thompson wrote:

> Could the first "space" be made long?
The first space is the start bit from which the sample timing originates. It's the usual start/stop protocol: One start bit, five NRZ data bits, 1.5 stop bits. The start bit trips the clutch that starts the reading mechanism, which samples the position of the selector magnet at fixed intervals. The mechanism resets after 5 bit intervals and the clutch disengages. You can regard the idle condition as one long continuous stop signal, it's actually only 1.5 bit intervals between successive characters in a string. Most machines have an adjustment to set the sampling window relative to the start so as to get the sample on the flat part of the pulses. I once had a teletype as printer for a TRS-80 (remember those?), using the cassette motor relay for signaling. I think I've still got the Z80 assembly code somewhere. -- "Electricity is of two kinds, positive and negative. The difference is, I presume, that one comes a little more expensive, but is more durable; the other is a cheaper thing, but the moths get into it." (Stephen Leacock)
On Sat, 16 May 2009 10:22:45 -0700, Fred Abse
<excretatauris@invalid.invalid> wrote:

>On Sat, 16 May 2009 09:34:46 -0700, Jim Thompson wrote: > >> Could the first "space" be made long? > >The first space is the start bit from which the sample timing =
originates.
>It's the usual start/stop protocol: One start bit, five NRZ data bits, =
1.5
>stop bits. The start bit trips the clutch that starts the reading >mechanism, which samples the position of the selector magnet at fixed >intervals. The mechanism resets after 5 bit intervals and the clutch >disengages. You can regard the idle condition as one long continuous =
stop
>signal, it's actually only 1.5 bit intervals between successive =
characters
>in a string.
Punched tapes could reliably achieve this tightness of character separation. Manual typists had much more jitter in start to start. The system is truly asynchronous between characters. Intra character timing was created by steady speed electromechanical means.
> >Most machines have an adjustment to set the sampling window relative to >the start so as to get the sample on the flat part of the pulses. > >I once had a teletype as printer for a TRS-80 (remember those?), using =
the
>cassette motor relay for signaling. I think I've still got the Z80 >assembly code somewhere.
On Sat, 16 May 2009 18:35:20 -0700, JosephKK wrote:

> Punched tapes could reliably achieve this tightness of character > separation. Manual typists had much more jitter in start to start. The > system is truly asynchronous between characters. Intra character timing > was created by steady speed electromechanical means.
Most machines needed either CR-CR-LF or LF-CR-CR as end-of-line, adding a delay, to allow the carriage or basket to fully return, otherwise you got the first character of the next line printing whilst the carriage was still flying. That's the reason for the still-widespread CNC tape code using LF-CR-CR. It was designed for ASR33s et al. When all the "modern" magnetic and semiconductor media have lost data, punched paper tape will still be readable, by humans if necessary. -- "Electricity is of two kinds, positive and negative. The difference is, I presume, that one comes a little more expensive, but is more durable; the other is a cheaper thing, but the moths get into it." (Stephen Leacock)