Would you like to react to this message? Create an account in a few clicks or log in to continue.

You are not connected. Please login or register

electrical switch

2 posters

Go down  Message [Page 1 of 1]

1electrical switch Empty electrical switch Tue Dec 15, 2020 3:54 pm

TimFisch

TimFisch

Is it possible to implement an electrical switch?

My students are struggling with the CPU performance when using FETs/BJTs as simple switches. A simple (logic-level) switch would be great: i.e.


  • a device with 3 analog I/Os (e.g. IN, OUT, SW).
  • when SW>threshold -> short circuit between IN and OUT
  • else open circuit between IN and OUT

debilbl4 likes this post

https://wiki.mexle.hs-heilbronn.de/

2electrical switch Empty Re: electrical switch Tue Dec 15, 2020 7:55 pm

arcachofo

arcachofo

I have a "solid state relay" in mind, but not implemented yet.
Hopefully it will be done soon.

Some workarounds:
- For low freq. you can use relays.
- For digital stuff you can use a buffer and activate "tristate" property.
- Fuction component could be used for unidirectional digital/analog.
- For bidirectional analog stuff you can use an analog miltiplexer with only 1 address bit.
( solid state relay would be a simplified version of this )

3electrical switch Empty Re: electrical switch Wed Dec 16, 2020 2:45 pm

TimFisch

TimFisch

We tried to use the relay, but had some trouble in older versions (relav was not switching, then triggered via PIN on atmega328). In the 0.5.15-RC3 I was not able to reconstruct the bug. It seems that this is solved.

A single 2-input analog multiplexer is not available, is it?

https://wiki.mexle.hs-heilbronn.de/

4electrical switch Empty Re: electrical switch Wed Dec 16, 2020 8:36 pm

arcachofo

arcachofo

I can switch a relay (defaul values) from an atmega328 pin in 0.4.13-SR5 for example.
Problem can be speed. But you can switch a relay with almost any current and very fast if you change it's properties:
For low current incrase resistance and lower IOn & IOff
For faster switch decrease inductance.


For analog multiplexer you can choose the address size (default is 3), if you set it to 1 then you get 1 address pin (the switch) and 2 channels, like a 1 pole 2 throw switch.

For example here a relay (1P2T) and equivalent analog mux (Address bits=1):

electrical switch Switch10

5electrical switch Empty Re: electrical switch Thu Dec 17, 2020 2:23 am

TimFisch

TimFisch

I reconstructed the problem:
We had to switch only for some microseconds.
A student had to simulate load balancing of multiple li-ion cells (emulated via RC-elements).  

We did not suceed to set the inductance to minimum in order to get the normally open relay working. Interestingly, the normally closed relay did work.
The real simu file and code is a bit complex. The activation and deactivation is done via interupts, based on the cell voltage levels.

I tried to make a simplified example (see attached). With a relay (default values) in 0.5.15 it is not working. By changing it to norm close (no changes of the inductance) it works...

Shouldn't it work / not work similarly?

We used an inverter before to get the function of a norm open. In our case the inductance had to be below 0,001 therefore this was not a solution.
Attachments
electrical switch Attachment328WithRelais.zip
You don't have permission to download attachments.
(2 Kb) Downloaded 1 times

https://wiki.mexle.hs-heilbronn.de/

6electrical switch Empty Re: electrical switch Thu Dec 17, 2020 4:01 pm

arcachofo

arcachofo

Shouldn't it work / not work similarly?
Yes... looks like there is an error there.

This issue is related to IOn an IOff values:
The current to turn on the relay is higger than the cutoff current.
This should not be related to whether the switch is closed or oppened, but indeed in simulide both are modelled as the same thing.
If you set both properties to the same value then it works/not_works consistently.
This will be solved for next update ( both 0.5.15 and 0.4.14).

But for a few us, definetly relays are not a good solution.

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum