Tutorial 1: Electric circuits
In this tutorial you will:
- Get in touch with some basic electric components.
- Make and modify connections between component ports.
- Play with different configurations using the given components.
Start by loading the tutorial system into the workspace, and then navigate through the components in the tree and the scene to explore them.
Basic electric component
The system includes a table with a small electric box, DC power supply, a set of buttons, and three different lamps.
Select one of the components, i.e. the green button called 'S01' inside the 'station' assembly.
You can now see the component's public variables and their values in the right panel and under them the component's ports.
If you click on the (i) icon of the variables, the description of the component will appear in a new window.
We will explain the possibilities of the public variables in another tutorial.
If you click on the (i) icon of the ports instead, the symbol of the component will appear with a dot representing each port. If you place your mouse over a port it will display its name.
You can explore all different components and their ports now.
Build a basic circuit
The first basic circuit you are going to build is the one represented in the diagram below. The power supply 'PS01' will be directly connected to the red light 'H01'. 'PS01' has two electric output ports called 'dc_p' and 'dc_n', and you will connect them directly to 'H01' input ports, 'x1' and 'x2' respectively.
Select the 'Move' mode in the toolbar and using the movement axes bring the electric box ('BOX') to the center of the table and place the 'H01' light on top of it like in the screenshot below. You may need to adjust the vertical position of 'H01' to place it properly on the box.
Component's ports can be connected following the same principles as in the electric diagram above. There are different types of ports, such as electric, pneumatic, mechanical, etc. Only ports of the same type can be connected. Furthermore, an output port can be connected to several input ports, but not the other way around. Input and output ports can be distinguished by their symbols.
Port connections are set assigning input ports to output ports. This is done by telling each input port which is the output port that sets the value on it. This is why several input ports can be connected to the same output port but not the other way around.
That said, to assign the connections on the input ports of the light, select the 'H01' component and click on the port selection tool to the right of the 'x1' port. The port selection tool will display all compatible ports in the system, and because connections can be made between components in different assemblies, first you need to select the 'station' assembly, where all our components are grouped. Then search for the 'PS01' component, the power supply, and finally, you will see both output ports on it, 'dc_p', and 'dc_n'. Now you can connect 'x1' input to 'station > PS01 > dc_p'.
Once the selection is done, the connection address will be shown on the selection box. Do the corresponding connection between 'x2' and 'dc_n' ports following the previous electric diagram. Once done, you should have the same port configuration as below.
If you connected the wrong ports by mistake, you can always remove a connection by clicking on the (x) icon that appears when you place the mouse over the port selection tool.
Connections made to an output port can be inspected. If you select the 'PS01' component now, each output port will show how many connections have been made with it. Furthermore, if you click on the port selection tool, you can see its connection and even remove it by clicking on the remove (x) icon. Selecting the 'dc_p' port you will see that it is connected to the input port ‘x1’ of the ‘H01’ component inside the same assembly, as expected.
The basic circuit is now ready to be tested. We expect that the lamp will switch on immediately after the emulation has started.
To start the emulation, click on the 'Start' button in the toolbar. The clock will start counting the emulation time and the interaction mode will be enabled. You can pause and restart the emulation at any time.
Moving or rotating elements is disabled during emulation, among other functionalities.
If the connections were made correctly, the lamp will change color to bright red as soon as the emulation starts.
You can even inspect the 'PS01' and 'H01' port values to see that the values are transferred between them. To do that, you just need to click on the inspection view on the right of each port.
Each port type will show different values when you inspect it. In the case of electric ports, both 'voltage' and 'current' are represented by their amplitude, frequency, and phase. In this case, the power supply provides 24V DC.
If you reset the emulation, the system will be reset and the lamp will change back to its inactive color.
Modify the circuit
Make sure you have paused or reset the emulation before you continue so you can modify the system.
Now we are going to add the 'S01' pushbutton to the circuit, between the 'PS01' and 'H01' components so we can manually switch on the light when we press the pushbutton.
First, grab the 'S01' component and place it on the box, close to the light.
Now we just need to connect the 'x1' input port on the button to the 'dc_p' port of the power supply and modify the light's 'x1' connection to 'S01.x2' as shown below.
Finally, if you start the emulation again, the light won't switch on until you activate the button component by clicking on it in the scene (using the left mouse button). When you release the button the light will switch off as expected.
Time to play!
Now is time to play and build your configurations using the different buttons and lamps you have in the system.
Here you have some examples: