Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

LTspice DPDT Relay Model

Status
Not open for further replies.

crutschow

Well-Known Member
Most Helpful Member
I just generated a functional simulation model for a DPDT relay symbol I had previously downloaded (both attached).
It includes an approximate 15ms open and close delay to simulate the mechanical relay operation.
I'm posting it for others to use because I wasn't able to locate such a model elsewhere.
I've also posted it in the Yahoo LTspice Users Group.
 

Attachments

  • DPDT.asy
    2 KB · Views: 1,267
  • DPDT.sub
    500 bytes · Views: 1,225
Last edited:
Nice.
Slight mod suggested, since not all users put LTS files in the default location:- replace the absolute path to the diode library with .lib standard.dio
 
Works OK,
For Old XP Pro users the (x86) entry in the .lib C:\Program Files(x86)\LTC\LTspiceIV\lib\cmp\standard.dio needs deleting in the sub file.
 
i had problem with circuit element S - as "is?" **broken link removed**
you don't seem to have L elements -- you should brief the recommended use in about. "Short Guide"
otherwise "we" appreciate adding up to ever expanding models set , Hi crutschow (muhahahahaa)
 
Thanks, I changed the .sub file to a relative reference for standard.dio.

I didn't include an L element since the value for that can vary widely, depending upon the relay, and this is just a functional model.
 
I took it, as is, but it's not working. Am I missing something? I lack of knowledge (for now) about Spice syntax so I left the .sub file untouched (including the relative path of the standard.dio).
 

Attachments

  • Test relay.asc
    1.2 KB · Views: 398
What version of LTspice do you have?
Where did you put the relay .asy and .sub files?
 
Post a screen grab of your simulation schematic.
When I run your .asc file, the relay symbol does not show.
 
Each file is in the correct path (the .sub and the .asy).
By default, LTspiceXV11 looks for the .sub and .asy files in your ....... Documents/ .... path. Is that where you have them?
 
Post a screen grab of your simulation schematic.
When I run your .asc file, the relay symbol does not show.
Weird. I've attached 2 screenshots. I've looked in the .sub. Vt (trip voltage for what I could understand) should be 0.36V. So, when VPulse overcome that threshold, the relay have to switch. But it doesn't actually.

By default, LTspiceXV11 looks for the .sub and .asy files in your ....... Documents/ .... path. Is that where you have them?
Yes.

I've downloaded the first file uploaded. On my side I can see the relay symbol and I don't have simulation error (except the logic relay behaviour).
 

Attachments

  • Rel1.PNG
    Rel1.PNG
    26.3 KB · Views: 1,351
  • Rel2.PNG
    Rel2.PNG
    34.2 KB · Views: 563
Last edited:
Cockpit error. I didn't look closely at your simulation times.
The relay model has a delay of about 14ms to simulate the operation of a real relay but you were trying to turn it on and off in 10ms.
Real mechanical relays generally don't operate that fast.

1553532066039.png
 
Omg, nice catch! Thank you I didn't notice. Now it's working perfectly.

If I want to modify the delay time, I just have to adjust the R-C value right? For example, If I set the C1 value from 15nF to 5nF I should obtain a 5ms delay (my case).

Also, tipically the switch Set time is different from the Reset time. I'm wondering how I can introduce differents delay in the model...
 
I just have to adjust the R-C value right? For example, If I set the C1 value from 15nF to 5nF I should obtain a 5ms delay (my case).
Yes, if that's C1 is in the model.
Also, tipically the switch Set time is different from the Reset time. I'm wondering how I can introduce differents delay in the model.
You would have to modify the model so that the charge time of the cap is different than the fall time.
Perhaps two resistors with a diode in series with each, one being in the opposite direction.

But unless simulating those times exactly is important in your design, it's probably not worth the effort.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top