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

Ac simulation #4076

Draft
wants to merge 45 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
c00d04f
Update Bug.md
failiz Feb 5, 2024
0d58769
fixes bug with u simbol. The u symbol should be replaced by a u in ng…
failiz Mar 8, 2023
115ba42
split different options of the spice circuit in sepate lines. Added i…
failiz Mar 12, 2023
600a144
towards transitoty simulations (still work in progress)
failiz Mar 13, 2023
7de4eb7
allow to change properties of the pulse and sinusoidal power supplies
failiz Mar 22, 2023
46bccb8
modified resources.xml to adapt to the new moduleIDs of the new power…
failiz Sep 20, 2023
fc03cb0
added number of cycles as a property to change in pulse power supplies
failiz Sep 20, 2023
be8fac1
fixed bug in loop, removed setElementId to show all the svg elements
failiz Sep 20, 2023
93eedcc
working towards the aligning the oscilloscope signals with the oscill…
failiz Sep 29, 2023
8db3f72
towards multiple oscilloscope in the simulation. Added offset marks t…
failiz Oct 3, 2023
5c2924f
if the negative terminal of a power supply is not connected and there…
failiz Oct 3, 2023
00abb32
handles the 4 channels and adds noise to the signals if the com probe…
failiz Oct 3, 2023
1a4378a
better name for a property
failiz Oct 3, 2023
af0c891
improved oscilloscope in sch view and added axis labels
failiz Oct 4, 2023
a36833f
added axis scale in the oscilloscope for the sch view
failiz Oct 5, 2023
105fd7b
added control of the horizontal simulation to the analysis without lo…
failiz Oct 5, 2023
af0414f
added handling of horizontal positions for multiple oscilloscopes
failiz Oct 6, 2023
433a51a
allow to introduce negative numbers in the properties of parts. This …
failiz Oct 7, 2023
dab2f73
Show the result of the simulation at the end time, not at the startin…
failiz Oct 7, 2023
6e2c3db
In sch view, added the name of the axes to the oscilloscope.
failiz Oct 10, 2023
47ac612
updated position of the labels and axes in the oscilloscope when simu…
failiz Oct 10, 2023
af9e5f6
added properties for the triangular wavegenerator
failiz Oct 10, 2023
b848df3
added some examples for the transitory analysis
failiz Oct 10, 2023
8e1440a
added 555 example
failiz Dec 4, 2023
082736d
Finish wiring of the BB view of the 555 example
failiz Dec 5, 2023
8e7dcd3
added two sketches as examples of the transient simulation
failiz Dec 5, 2023
3ed26cb
fixed oscilloscope text string (too many arguments)
failiz Dec 7, 2023
bfbacda
fixed bug when properties contain capital letters. If so, the propert…
failiz Dec 7, 2023
d258cf5
imprved handling of properties with capital letters
failiz Dec 7, 2023
7684fbd
improved simulation error dialog. Now, there is a scroll area for the…
failiz Dec 7, 2023
a10fdb5
show the right channel in the axis of the oscilloscope (SCH view)
failiz Dec 7, 2023
ef83cec
added properties of the transformer so that users can modifiy its pro…
failiz Dec 7, 2023
3dead91
fixed error when a property does not have symbol: If there is no symb…
failiz Dec 7, 2023
bcf5960
calculate the com voltage at the oscilloscope when there is a wire co…
failiz Dec 8, 2023
cccd30e
First implementation using an animation of the results of the simulat…
failiz Dec 9, 2023
2701e68
now all parts get voltages and currents depending on simulation time
failiz Dec 10, 2023
5d3fc49
Revert elcos
Feb 13, 2024
560f296
Added functionality to set sim frequency and save it to project.
Dec 15, 2023
a70ce54
added the simulation properties to the project properties menu
failiz Feb 18, 2024
4fa9783
added simulator message (sim time) at the top right corner when simul…
failiz Feb 20, 2024
9eb7edb
Added sawtooth generator and modified properties of the triangular si…
failiz Apr 6, 2024
1712697
changed ac poewer supply to sine, added generic pulse power supply an…
failiz Apr 7, 2024
234eb9a
make the transitory simulation not blocking. Results will be shown wh…
failiz Apr 7, 2024
1c56001
added exception for the oscilloscope as it does not have a pcb view
failiz Apr 7, 2024
39b0dad
Load analog code model to have access to current limiting devices for…
failiz May 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/ISSUE_TEMPLATE/Bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ labels: Bug
---
## Current Behaviour
Text
<please attach screenshot if possible>
<please attach a screenshot if possible>
<please attach a Fritzing file if possible. To attach it, change the extension of the file from fzz to zip (e.g., bug.zip instead of bug.fzz)>

**Build:**
<e.g. Version 0.9.3 (b5c895d32 2016-04-19) Cocoa [Qt 5.12.2]

Expand Down
220 changes: 218 additions & 2 deletions resources/properties.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,88 @@
<property name="voltage" symbol="V" minValue="0" maxValue="1000" defaultValue="5" numeric="yes" editable="yes">
<suffix suffix="DC2PowerModuleID"/>
<suffix suffix="AC2PowerModuleID"/>
<suffix suffix="SinePowerSupplyModuleID"/>
<suffix suffix="DCPowerSupplyModuleID"/>
<suffix suffix="TriangularPowerSupplyModuleID"/>
<suffix suffix="SawtoothPowerSupplyModuleID"/>
<menuItem value="3.3" />
<menuItem value="5" />
<menuItem value="12" />
</property>

<property name="frequency" symbol="Hz" minValue="0" maxValue="1000" defaultValue="60" numeric="yes" editable="yes">
<property name="amplitude" symbol="V" minValue="0" maxValue="1000" defaultValue="5" numeric="yes" editable="yes">
<suffix suffix="SinePowerSupplyModuleID"/>
<suffix suffix="TriangularPowerSupplyModuleID"/>
<suffix suffix="SawtoothPowerSupplyModuleID"/>
<menuItem value="3.3" />
<menuItem value="5" />
<menuItem value="12" />
</property>
<property name="initial voltage" symbol="V" minValue="0" maxValue="1000" defaultValue="0" numeric="yes" editable="yes">
<suffix suffix="PulsePowerSupplyModuleID"/>
</property>
<property name="pulsed voltage" symbol="V" minValue="0" maxValue="1000" defaultValue="5" numeric="yes" editable="yes">
<suffix suffix="PulsePowerSupplyModuleID"/>
</property>
<property name="period" symbol="s" minValue="0" maxValue="1000000" defaultValue="0.1" numeric="yes" editable="yes">
<suffix suffix="PulsePowerSupplyModuleID"/>
<suffix suffix="TriangularPowerSupplyModuleID"/>
<suffix suffix="SawtoothPowerSupplyModuleID"/>
</property>
<property name="pulse width" symbol="s" minValue="0" maxValue="1000000" defaultValue="0.05" numeric="yes" editable="yes">
<suffix suffix="PulsePowerSupplyModuleID"/>
</property>
<property name="duty cycle" symbol="%" minValue="0" maxValue="100" defaultValue="25" numeric="yes" editable="yes">
<suffix suffix="PWMPulsePowerSupplyModuleID"/>
</property>
<property name="rise time" symbol="s" minValue="0" maxValue="1" defaultValue="0.001" numeric="yes" editable="yes">
<suffix suffix="GenericPulsePowerSupplyModuleID"/>
</property>
<property name="fall time" symbol="s" minValue="0" maxValue="1" defaultValue="0.001" numeric="yes" editable="yes">
<suffix suffix="GenericPulsePowerSupplyModuleID"/>
</property>
<property name="number of pulses" symbol="" minValue="0" maxValue="1000000000000" defaultValue="0" numeric="yes" editable="yes">
<suffix suffix="PulsePowerSupplyModuleID"/>
<suffix suffix="TriangularPowerSupplyModuleID"/>
<suffix suffix="SawtoothPowerSupplyModuleID"/>
</property>

<property name="frequency" symbol="Hz" minValue="0" maxValue="1000000" defaultValue="60" numeric="yes" editable="yes">
<suffix suffix="AC2PowerModuleID"/>
<suffix suffix="SinePowerSupplyModuleID"/>
<suffix suffix="PulseGenericPowerSupplyModuleIDwerSupplyModuleID"/>
<menuItem value="10" />
<menuItem value="20" />
<menuItem value="50" />
<menuItem value="60" />
<menuItem value="100" />
</property>

<property name="offset voltage" symbol="V" minValue="0" maxValue="1000" defaultValue="0" numeric="yes" editable="yes">
<suffix suffix="SinePowerSupplyModuleID"/>
<suffix suffix="TriangularPowerSupplyModuleID"/>
<suffix suffix="SawtoothPowerSupplyModuleID"/>
</property>
<property name="delay time" symbol="s" minValue="0" maxValue="100" defaultValue="0" numeric="yes" editable="yes">
<suffix suffix="SinePowerSupplyModuleID"/>
<suffix suffix="PulsePowerSupplyModuleID"/>
<suffix suffix="TriangularPowerSupplyModuleID"/>
<suffix suffix="SawtoothPowerSupplyModuleID"/>
</property>
<property name="damping factor" symbol="s-1" minValue="0" maxValue="10" defaultValue="0" numeric="yes" editable="yes">
<suffix suffix="SinePowerSupplyModuleID"/>
</property>
<property name="phase" symbol="degrees" minValue="0" maxValue="360" defaultValue="0" numeric="yes" editable="yes">
<suffix suffix="SinePowerSupplyModuleID"/>
</property>
<property name="internal resistance" symbol="&#937;" minValue="0" maxValue="1000000" defaultValue="0.1" numeric="yes" editable="yes">
<suffix suffix="PowerSupplyModuleID"/>
<suffix suffix="77c36646df552e9fe72f360837f556ccleg"/>
<suffix suffix="1000AFDF10011leg"/>
<suffix suffix="c7c8e292b3beec531de0c51f2576d329"/>
</property>

<property name="frequency" symbol="" minValue="" maxValue="" defaultValue="16 MHz" numeric="no" editable="no">
<property name="frequency" symbol="Hz" minValue="" maxValue="" defaultValue="16 MHz" numeric="no" editable="no">
<suffix suffix="CrystalModuleID"/>
<menuItem value="32 kHz" />
<menuItem value="1 MHz" />
Expand Down Expand Up @@ -274,6 +345,9 @@
<suffix suffix="LEDModuleID"/>
<suffix suffix="SuperfluxModuleID"/>
</property>
<property name="max current" symbol="A" minValue="0" maxValue="1000" defaultValue="1.0" numeric="yes" editable="yes">
<suffix suffix="LabDCPowerSupplyModuleID"/>
</property>

<property name="power" symbol="W" minValue="0" maxValue="1000000000000" defaultValue="" numeric="yes" editable="yes">
<suffix suffix="ResistorModuleID"/>
Expand Down Expand Up @@ -329,4 +403,146 @@
<suffix suffix="PhotocellModuleID"/>
</property>

<property name="volts/div" symbol="V" minValue="0" maxValue="100" defaultValue="1" numeric="yes" editable="yes">
<suffix suffix="OscilloscopeModuleID"/>
<menuItem value="0.001" />
<menuItem value="0.01" />
<menuItem value="0.1" />
<menuItem value="1.0" />
<menuItem value="3.3" />
<menuItem value="5.0" />
<menuItem value="10.0" />
<menuItem value="50.0" />
</property>

<property name="time/div" symbol="s" minValue="0" maxValue="100" defaultValue="0.01" numeric="yes" editable="yes">
<suffix suffix="OscilloscopeModuleID"/>
<menuItem value="0.000001" />
<menuItem value="0.00001" />
<menuItem value="0.0001" />
<menuItem value="0.001" />
<menuItem value="0.01" />
<menuItem value="0.1" />
<menuItem value="1.0" />
<menuItem value="5.0" />
<menuItem value="10.0" />
</property>

<property name="ch1 offset" symbol="V" minValue="-300" maxValue="300" defaultValue="0" numeric="yes" editable="yes">
<suffix suffix="OscilloscopeModuleID"/>
<menuItem value="0.001" />
<menuItem value="0.01" />
<menuItem value="0.1" />
<menuItem value="1.0" />
<menuItem value="3.3" />
<menuItem value="5.0" />
<menuItem value="10.0" />
<menuItem value="50.0" />
</property>

<property name="ch2 offset" symbol="V" minValue="-300" maxValue="300" defaultValue="0" numeric="yes" editable="yes">
<suffix suffix="OscilloscopeModuleID"/>
<menuItem value="0.001" />
<menuItem value="0.01" />
<menuItem value="0.1" />
<menuItem value="1.0" />
<menuItem value="3.3" />
<menuItem value="5.0" />
<menuItem value="10.0" />
<menuItem value="50.0" />
</property>

<property name="ch3 offset" symbol="V" minValue="-300" maxValue="300" defaultValue="0" numeric="yes" editable="yes">
<suffix suffix="OscilloscopeModuleID"/>
<menuItem value="0.001" />
<menuItem value="0.01" />
<menuItem value="0.1" />
<menuItem value="1.0" />
<menuItem value="3.3" />
<menuItem value="5.0" />
<menuItem value="10.0" />
<menuItem value="50.0" />
</property>

<property name="ch4 offset" symbol="V" minValue="-300" maxValue="300" defaultValue="0" numeric="yes" editable="yes">
<suffix suffix="OscilloscopeModuleID"/>
<menuItem value="0.001" />
<menuItem value="0.01" />
<menuItem value="0.1" />
<menuItem value="1.0" />
<menuItem value="3.3" />
<menuItem value="5.0" />
<menuItem value="10.0" />
<menuItem value="50.0" />
</property>

<property name="ch1 volts/div" symbol="V" minValue="0" maxValue="100" defaultValue="1" numeric="yes" editable="yes">
<suffix suffix="OscilloscopeModuleID"/>
<menuItem value="0.001" />
<menuItem value="0.01" />
<menuItem value="0.1" />
<menuItem value="1.0" />
<menuItem value="3.3" />
<menuItem value="5.0" />
<menuItem value="10.0" />
<menuItem value="50.0" />
</property>

<property name="ch2 volts/div" symbol="V" minValue="0" maxValue="100" defaultValue="1" numeric="yes" editable="yes">
<suffix suffix="OscilloscopeModuleID"/>
<menuItem value="0.001" />
<menuItem value="0.01" />
<menuItem value="0.1" />
<menuItem value="1.0" />
<menuItem value="3.3" />
<menuItem value="5.0" />
<menuItem value="10.0" />
<menuItem value="50.0" />
</property>

<property name="ch3 volts/div" symbol="V" minValue="0" maxValue="100" defaultValue="1" numeric="yes" editable="yes">
<suffix suffix="OscilloscopeModuleID"/>
<menuItem value="0.001" />
<menuItem value="0.01" />
<menuItem value="0.1" />
<menuItem value="1.0" />
<menuItem value="3.3" />
<menuItem value="5.0" />
<menuItem value="10.0" />
<menuItem value="50.0" />
</property>

<property name="ch4 volts/div" symbol="V" minValue="0" maxValue="100" defaultValue="1" numeric="yes" editable="yes">
<suffix suffix="OscilloscopeModuleID"/>
<menuItem value="0.001" />
<menuItem value="0.01" />
<menuItem value="0.1" />
<menuItem value="1.0" />
<menuItem value="3.3" />
<menuItem value="5.0" />
<menuItem value="10.0" />
<menuItem value="50.0" />
</property>

<property name="horizontal position" symbol="s" minValue="0" maxValue="1000" defaultValue="0" numeric="yes" editable="yes">
<suffix suffix="OscilloscopeModuleID"/>
</property>

<property name="input inductance" symbol="H" minValue="0" maxValue="1000000" defaultValue="0.001" numeric="yes" editable="yes">
<suffix suffix="TRANSFORMER-PTH"/>
<suffix suffix="TRANSFORMER-SMD"/>
</property>
<property name="output inductance" symbol="H" minValue="0" maxValue="1000000" defaultValue="0.001" numeric="yes" editable="yes">
<suffix suffix="TRANSFORMER-PTH"/>
<suffix suffix="TRANSFORMER-SMD"/>
</property>
<property name="input resistance" symbol="&#937;" minValue="0" maxValue="1000000000000" defaultValue="1" numeric="yes" editable="yes">
<suffix suffix="TRANSFORMER-PTH"/>
<suffix suffix="TRANSFORMER-SMD"/>
</property>
<property name="output resistance" symbol="&#937;" minValue="0" maxValue="1000000000000" defaultValue="1" numeric="yes" editable="yes">
<suffix suffix="TRANSFORMER-PTH"/>
<suffix suffix="TRANSFORMER-SMD"/>
</property>

</properties>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
12 changes: 12 additions & 0 deletions sketches/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,12 @@
<sketch id="ComposedArduinoR4WifiShield" >
<language country="en" name="Composed Arduino R4 WIFI Shield" src="core/Shields/ComposedArduinoR4WifiShield.fzz"/>
</sketch>
<sketch id="555ICastable" >
<language country="en" name="555 IC astable" src="core/Simulator/EN/trans/555_IC_astable.fzz"/>
</sketch>
<sketch id="flipFlopLedFlashingCircuit" >
<language country="en" name="FlipFlop Led Flashing" src="core/Simulator/EN/trans/flipflop_led_flashing_circuit.fzz"/>
</sketch>
</sketches>
<categories>
<category>
Expand Down Expand Up @@ -505,6 +511,12 @@
<sketch id="SimplePotentiometer"/>
<sketch id="IrSensorTransistorMotor"/>
</category>
<category>
<language country="en" name="Transient Simulation"/>
<language country="es" name="Simulacion Transitoria"/>
<sketch id="flipFlopLedFlashingCircuit"/>
<sketch id="555ICastable"/>
</category>
</category>
<category>
<language country="en" name="Shields"/>
Expand Down
2 changes: 1 addition & 1 deletion src/connectors/debugconnectors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void DebugConnectors::monitorConnections(bool enabled)

QSet<QString> DebugConnectors::getItemConnectorSet(ConnectorItem *connectorItem) {
QSet<QString> set;
static QRegularExpression re("^(AM|VM|OM)\\d+");
static QRegularExpression re("^(AM|VM|OM|Oscilloscope)\\d+");
Q_FOREACH (ConnectorItem * toConnectorItem, connectorItem->connectedToItems()) {
ItemBase * attachedToItem = toConnectorItem->attachedTo();
VirtualWire * virtualWire = qobject_cast<VirtualWire *>(attachedToItem);
Expand Down
Loading