Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relay coil & contacts do not work in subcircuits #127

Open
Forecaster opened this issue Dec 6, 2024 · 1 comment
Open

Relay coil & contacts do not work in subcircuits #127

Forecaster opened this issue Dec 6, 2024 · 1 comment

Comments

@Forecaster
Copy link

While creating a test circuit for testing some relay logic using a pair of contactors I tried to make the contactor layout I was using into a subcircuit using the relay coil and contacts. But once I had done so and tried to use the subcircuit it no longer worked.

It seems the links between the coil and contacts are broken when put into a sub-circuit.

It also appears to break links in the main circuit as well. In the example circuit the coil and contact relay2 will not engage until the subcirucit relay is deleted, after which they work normally. (Sometimes after deleting the subcircuit relay, relay2 still will not close until you move it a bit and put it back.)

The coil and contact inside the subcircuit use the label relay1.

I've been able to reproduce the behaviour in this minimal circuit:

$ 1 0.000005 0.2954511527092107 49 5 50 5e-11
425 752 144 752 288 0 relay2 0.2 0 0.02 20 0.015 0.005 0 3 1
426 640 144 640 288 4 relay2 0.05 1000000 0
207 640 144 640 80 4 L1
207 640 288 640 352 4 T1
207 752 288 752 368 4 A2
207 752 144 752 80 4 A1
. Relay 1 2 3 4 A1 1 1 0 A2 2 1 1 L1 4 0 0 T1 5 0 1 RelayCoilElm\s1\s2\rRelayContactElm\s4\s5 0\\srelay1\\s0.2\\s0\\s0.02\\s20\\s0.015\\s0.005\\s0\\s0\\s0\s4\\srelay1\\s0.05\\s1000000\\s1
410 352 240 448 320 1 Relay 0\srelay1\s0.2\s0.11992330494937747\s0.02\s20\s0.015\s0.005\s0\s2\s1 4\srelay1\s0.05\s1000000\s1
g 416 336 416 416 0 0
R 416 208 416 144 0 0 40 5 0 0 0.5
w 384 336 240 336 0
162 240 336 240 384 2 default-led 1 0 0 0.01
g 240 384 240 432 0 0
R 384 208 384 144 0 0 40 5 0 0 0.5
207 560 352 560 288 4 A2
g 560 352 560 432 0 0
207 512 80 512 16 4 A1
s 512 80 512 160 0 1 false
R 512 160 512 224 0 0 40 24 0 0 0.5
@pfalstad pfalstad added the bug label Dec 7, 2024
@pfalstad
Copy link
Owner

pfalstad commented Dec 7, 2024

Yes, it seems relay coils/contacts do not work in subcircuits.

relay2 works fine for me though. The relays have a 5ms delay which is a pretty long delay with the simulation speed you are using. If you just increase the simulation speed it works OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants