Phase 7. Separating cathode and anode preparation processes

In the course of the previous phases we have modeled the battery production process with a single electrode type. In reality the battery contains the electrodes of two types: anode (negative) and cathode (positive). The preparation processes for these two types are similar enough that they both could be described by the electrode preparation logic we employ in our model. To avoid the duplication of the existing block sequence and make our flowchart concise, we will create a custom block that encapsulates this sequence and use parameters to distinguish between the anode preparation process and cathode preparation process.

But first, we will draw the missing section of the production floor layout where the cathodes are handled.

Prepare the layout

  1. Draw a conveyor as displayed in the image below and name it cathodeConveyor.

  2. In its properties specify the following:

    a. Material item type: Electrode
    b. Z: 20
    c. Width: 0.5 meter

  3. Place a Station on the cathodeConveyor.
  4. Name it cathodeCoatingStation.
  5. In its properties specify:

    a. Visible: no
    b. Process time: 1 second
    c. Length: 0.5 meter.

  6. In the Actions section of the station's properties and type the following code in the On process finished field: agent.color = silver;

    We use this code to change the color of the cathode plates passing through the coating station.

  7. Using the Rectangular Node element from the Space Markup palette, draw the area at the end of the cathodeConveyor where the coated cathodes will be stored.
  8. Name it cathodePlatesBuffer.
  9. In the node's properties specify:

    a. Visible: no
    b. Locations layout: Arranged.

  10. Next, draw the location where the cathodes will be transported for curing.
  11. Name it cathodeCuringOven.
  12. In the properties of the cathodeCuringOven specify the Visible: no.
  13. Next, click the Attractors... button and in the displayed dialog window specify the attractors creation mode as a grid of 5 x 1.

  14. Draw another Rectangular Node.
  15. Name it preassembleCathodesBuffer.
  16. Set the Visible property to no and the Locations layout to Arranged.

Add the 3D animation

  1. Go to the 3D Objects palette and drag the Pasting Machine 3D object to the Main diagram.
  2. Place it over the cathodeCuringStation.
  3. Drag the Drying Chamber 3D object and place it over the attractor in the cathodeCuringOven node.
  4. Make sure that the figure is located inside the walls of the layout and fully covers the attractor. Note, that you can also adjust the placement of attractors in the node by selecting and dragging them.
  5. Rotate the figure by the handle so that the entrance of the curing chamber faces the cathodeConveyor.
  6. Ctrl drag the Drying Chamber 3D figure to create 4 more copies and adjust their placement according to the image below.

Now that the layout and animation are ready, we can start making changes in the flowchart.

Create a custom block

  1. Select the first seven blocks of the flowchart (from the source block to the unbatchElectrodes block) and right-click the selection.
  2. Select the Create Flowchart Block option from the context menu.

  3. In the displayed New agent dialog window specify the Name: PrepareElectrode.
  4. A new block prepareElectrode with a default icon will replace the selected blocks in the flowchart.
  5. The PrepareElectrode agent will appear in the model tree in the Projects view.

If you select the prepareElectrode block in the graphical editor, in its properties you will see all the customized parameters of the initial seven blocks. The labels of the parameters are generated automatically. Our next step will be to correct these labels and adjust the parameters themselves.

Correct the parameter labels of the custom block

  1. Double-click the PrepareElectrode agent in the Projects View to open its graphical editor. You can see all the parameters located on the agent's graphical diagram.
  2. To change the parameter's label, select the parameter, go to the Value editor section of its properties and type the new label in the Label field.

  3. Use this method to change the parameter's labels according to the table below.

    Note! You will see that not all parameters are listed in the table. Do not worry and skip the unlisted ones, since they will be adjusted separately.

    Parameter name

    New label


    Batch size


    Location of plates for batching


    Batch location


    Electrodes source conveyor


    Electrodes target conveyor


    Curing time


    Curing location


    Electrodes per arrival


    Electrodes interarrival time


    Electrodes buffer


    Time to load at the oven


    Time to unload at the buffer


    Curing oven


    Forklifts fleet


    Time to load batch from the conveyor


    Time to unload batch at the oven

Next, we must deal with the remaining parameters.

Adjust the custom block's parameters
  1. Since in our model both anodes and cathodes are represented by the Electrode agent, go to the source block's properties, switch the New agent field back to the value editor mode and select the Electrode agent from the drop-down list.
  2. Delete the source_newEntity parameter.
  3. Similarly, both anode and cathode batches will be represented by the PlatesBatch agent. Go to the batch block properties, switch the New batch field back to value editor mode and select the PlatesBatch agent from the drop-down list.
  4. Delete the batch_newBatch parameter.
  5. Both anodes and cathodes batches will be transported by the same fleet, therefore go to the toElectrodeBuffer block's properties and specify the Fleet: toOven_fleet(agent)
  6. Delete the toElectrodeBuffer_fleet parameter from the PrepareElectrode graphical editor.
Now that we have finished adjusting the parameters, let's change the default icon of our custom block to the following image:
  1. Right-click the image above and save it to your model folder.
  2. Delete the blue rectangle from the PrepareElectrode graphical editor.
  3. Drag the Image element from the Presentation palette to the graphical diagram of the PrepareElectrode agent and place it roughly over the icon area where the blue rectangle used to be.
  4. In the displayed window navigate to the model folder and select the saved custom icon image.
  5. In the image's properties select the Icon check box.
  6. Adjust the placement of the icon so that the port is situated exactly at the image's border:

  7. Navigate to the Advanced section of the icon's properties and type the following code in the On click field: return true;

    This way we'll be able to navigate inside the custom block by double-clicking it during the simulation.

  8. We should also add the counter to see how many agents have been generated by this block. Drag the Text element from the Presentation palette and place it next to the right bottom corner of the new icon.
  9. In the text object's properties specify the following:

    a. Select the Icon check-box.
    b. In the Text field type a stub value, e.g. 0. Next, switch the field to dynamic value editor and type the following expression: source.out.count()
    c. Set the Color to blue.

Add the logic behind the cathodes preparation process

  1. Go to the Main graphical diagram and rename the prepareElectrode block to prepareAnode.
  2. Drag the PrepareElectrode element from the model tree to the Main diagram and connect it to the second in port of the assembler block. Name the block prepareCathode.

  3. In the block's properties specify the following:

    a. Batch size: 100
    b. Location of plates for batching: cathodePlatesBuffer
    c. Batch location: cathodePlatesBuffer
    d. Electrodes source conveyor: cathodeConveyor
    e. Electrodes target conveyor: cathodeConveyor
    f. Curing time: 2 minutes
    g. Curing location: cathodeCuringOven
    h. Electrodes per arrival: 200
    i. Electrodes interarrival time: 1.5 hours
    j. Electrodes buffer: preassembleCathodesBuffer
    k. Time to load at the oven: 0.5 minutes
    l. Time to unload at the buffer: 0.5 minutes
    m. Curing oven: cathodeCuringOven
    n. Forklifts fleet: forklifts
    o. Time to load batch from the conveyor: 0.5 minutes
    p. Time to unload batch at the oven: 0.5 minutes

  4. Next, go to the properties of the assembler block and specify Quantity 2: 15.
  5. Run the model!

Now the electrodes of both types are transferred to the assembling station where they are combined into blocks and put into battery cases. But, as you can see, even though the single electrodes that pass through the coating stations change color from the default white to their respective peru and silver, the batches remain identical. Let's do something about that!

We have the PlatesBatch agent that represents both anode batches and cathode batches in our flowchart. We need to add a parameter to this agent to help the flowchart blocks distinguish between them. Since this parameter should describe only a limited number of agent attributes (anode and cathode), we will use an option list as the parameter's type.

Create an option list

  1. In the Projects view right-click the name of your model and choose New > Option List from the context menu.

  2. In the New Option List dialog box specify the Name: ElectrodeType.
  3. In the Specify elements table provide the names of the attributes: ANODE and CATHODE.

  4. The option list will appear in the project tree grouped in the Option Lists branch.

Add the parameter to the PlatesBatch agent

  1. Drag the Parameter element from the Agent palette on the PlatesBatch graphical diagram.
  2. Call it electrodeType.
  3. In the Properties view of the parameter specify its Type: ElectrodeType.

The next step is changing the color properties of the batch animation figure.

Define the dynamic change of the color

  1. Select the rectangle in the PlatesBatch graphical diagram.
  2. Switch the Fill color field to the dynamic value editor and type the following code: electrodeType == ANODE ? peru : silver

    We use this code to check the value of the electrodeType parameter and assign the color to the rectangle depending on the result. If the value is ANODE, the color is peru. Otherwise, the color is silver.

Now, let's help our custom block differentiate between the two electrode types.

Define the electrode type for the prepareElectrode agent
  1. Add a parameter to the prepareElectrode agent.
  2. Name it electrodeType.
  3. In the parameter's properties specify its Type: ElectrodeType and Label: Electrode type.
  4. In the properties of the batch block switch the New batch field to the dynamic value editor and specify the following: new PlatesBatch( electrodeType )
  5. Go to the Main graphical diagram. In the properties of the prepareAnode block specify the Electrode type: ANODE.
  6. In the properties of the prepareCathode block specify the Electrode type: CATHODE.
  7. Run the model! Now the custom block passes the type of the electrode to the batches and the color of the batches changes accordingly.

Reference model: Lead Acid Battery Production - Phase 7

Phase 6. Delivery to charging location

Phase 8. Modeling the grids production