Electrical Switch doesn't work

Hello everyone,
I am trying to use a switch in a simulation of an electrical circuit and I dont know why, but it is not working correctly. I have created a simplifyed system to check the switch function and it also doesn't work. I paste a screenshot of the system so you can check it.
The idea was to activate and desactivate the switch with a pulse generator, so the current of the circuit, which is a constant 1A DC, fluctuates between 0A and 1A. Despite of it, the current is 1A during the whole simulation.

6 Comments

It does not appear that you are using the Circuit Breaker block? https://www.mathworks.com/help/physmod/sps/powersys/ref/breaker.html
I am having difficulty identifying the current source you are using. It is not one of the SPS Electrical Sources https://www.mathworks.com/help/physmod/simscape/electrical-sources.html and it is not a SPICE source https://www.mathworks.com/help/physmod/sps/spice-sources.html ?
Hi Walter, thank you for your fast answer. My current source is a ideal DC current source (https://es.mathworks.com/help/physmod/simscape/ref/dccurrentsource.html ) and the breaker circuit is the ideal standard one ( https://es.mathworks.com/help/physmod/sps/ref/circuitbreaker.html?s_tid=doc_ta ). Both are included in the Simscape Electrical Library.
Ah, what is the block with the circle'd A ?
Which pulse generator are you using, and what parameters did you configure for it?
That block simulates a current sensor connected to the electrical circuit (in blue) which measurment is sent like a physical signal (in brown). Later this physical signal is converted to a Simulink signal. This is the block: https://es.mathworks.com/help/physmod/simscape/ref/currentsensor.html?searchHighlight=current%20sensor&s_tid=srchtitle
I am using a simple pulse generator ( https://es.mathworks.com/help/simulink/slref/pulsegenerator.html?s_tid=doc_ta ), I paste its configuration (PD: I already tried with higher values of the pulse to see if the breaker works but it didn't):
The Pulse generator you are using uses an output of 0 when the pulse is not underway, and uses an output according to the given Amplitude when the pulse is underway.
However, the Circuit Breaker https://www.mathworks.com/help/physmod/sps/ref/circuitbreaker.html?s_tid=doc_ta only closes when the voltages crosses below the threshold... so we need to know what threshold you configured... and what you configured the initial state as ?
The treshold is configurated for 0.5V. Under this value it is supposed to be closed, and when it reachs higher values than 0.5V, it should be open.

Sign in to comment.

 Accepted Answer

Jonas
Jonas on 30 Aug 2021
Edited: Jonas on 30 Aug 2021
You are using an ideal current source set to 1 A. This means that whichever load you attach to it, it will maintain 1A.
By opening and closing the switch, you are just changing the required voltage the ideal current source needs to maintain the 1A. Even when your switch is opened, it has a certain 'Open conductance'. This means that in the open position, the switch still has 1/1e-6 Ohm = 1000 000 Ohm resistance, which means the ideal current source will employ 1000 000 Volts to maintain the 1A current through it.
You are basically simulating huge sparks and fireworks. Yes, Simscape is also able to simulate those. It will not prevent you from doing so.
This is why the current measurement with scope will always read 1A. Try to add a voltage measurement accross the switch and see the large voltage.

5 Comments

In case you are wondering what the solution would be:
Use for example an Ideal Voltage source at 1V in parallel with a 1 Ohm resistor as a source.
Hi Jonas, thank you for your help!
nfortunately I have tried it with voltage source instead of current source and the result has even less sense. I connected a 1V ideal source to a switch with a 1Ohm resistor and in parallel to another 1Ohm resistor permanently connected. The scope shows that the current through the switch is still constant, and 1A (which doesnt have any sense because it should change between 1 and 0.5A).
This is the scope for that circuit:
You are using a Circuit Breaker block, you need to use a Switch block.
Read the text displayed for the Block Parameters of the Circuit Breaker block. "If vT rises above the threshold, then the circuit is broken when the current next crosses zero". In your case, the current never goes to zero again (because it is a static supply) so it stays closed.
You were right Jonas, thank you so much for the help!

Sign in to comment.

More Answers (0)

Categories

Products

Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!