Skip to content

mensfeng/podcast-test

Repository files navigation

GitHub license GitHub contributors GitHub issues GitHub pull-requests PRs Welcome

GitHub watchers GitHub forks GitHub stars Binder Gitter

Safety Engineering Readme

Hey everyone! For me, committing to product safety is like an adrenaline boost. Making lives easier, safer, and better is my ultimate vision. Right now, I'm diving into Model-Based Systems Engineering (MBSE) to build a detailed system database for a machine. Maybe one day I can make a LLM AI with these data. I'll be sharing my progress and interesting links I find along the way. Join me on this exciting journey!

Table of Contents

  1. MBSE
  2. Legislation and Regulatory
  3. Projects
  4. Appendix

1. MBSE

1.1 Definition

Model-based systems engineering (MBSE) is a formalized methodology that is used to support the requirements, design, analysis, verification, and validation associated with the development of complex systems.

MicrosoftAI-For-Beginners NASANASA-Progpy NoMagicDassault Systèmes

SysMLCreated by OMG supported by IBM, it has been researching in UML, SysML langudges

PlantUML This website shows how data can be converted into diagrams, but my question is these insturctions are not human langudge

NoMagicNoMagic World Conference (Dassault Systèmes)

1.2 Value of MBSE

In today's fast-moving world, getting products to market quickly and affordably is crucial. "Traceability" – keeping track of the system's development – is essential for smooth audits and certifications, and for legal protection.

Model-Based Systems Engineering (MBSE) is a big help here. It gathers all the information in one place, saving engineers time searching through scattered documents. This not only makes compliance easier but also improves safety standards.

Plus, MBSE lets you reuse parts of the system, making development cheaper and more sustainable. By using existing models and components, you can speed up development and cut costs.

1.3 My thought on MBSE project

1.3.1 Project Objective

A database system that captures machine function data in a human-readable way, displays data relationships using graphic diagrams, and can feed into a Language Model (LM) to build a chatbot.

1.4 Project Mind Map

1.4.1 PlantML

GPT3.5 created a sample SysML Diagram look like this below. I was quite satistfied with the result that is able to capture the hirearchy realationship of the system display in text format. I asked GPT3.5 how is this generated. It replies that this diagram is generated based of text input and output the diagram in text format. It utilized a PlanetUML liberary in python, and no use of SQL database. My summary of this system is text ----> diagram. This is a great start, but not quite what I am looking for...

1.4.1.1 Output

This is a sample SysML Block Definition Diagram, it captures the hierarchy of components and their relationships within the car system, as well as system functions related to speed and safety data. I have also using GPT3.5 to create other Model digrams which I will put them in appendix PlantML Output Diagrams.

@startuml
alice->bob:hello
@enduml

PlantUML markdown integration (error)
       +---------------------+
       |       CarSystem     |
       +---------------------+
                |
                |
      +---------------------+
      |        Car          |
      +---------------------+
      | - VIN: String       |
      | - make: String      |
      | - model: String     |
      | - year: int         |
      +---------------------+
            /        \
           /          \
  +-----------------+  +------------------+
  |     Engine      |  |   Transmission   |
  +-----------------+  +------------------+
  | - horsepower: int|  | - type: String   |
  | - displacement:  |  | - gears: int     |
  |    String         |  +------------------+
  +-----------------+
                |
                |
       +------------------+
       |     Sensor       |
       +------------------+
       | - type: String   |
       | - location:      |
       |    String        |
       +------------------+
                |
                |
       +------------------+
       |    Controller    |
       +------------------+
       | - type: String   |
       | - function:      |
       |    String        |
       +------------------+
Click to see Explanation



  • CarSystem: Represents the overall system of the car, which consists of various components

  • Car: Represents the main entity in the car system, with attributes like VIN, make, model, and year

  • Engine: Represents the engine component of the car, with attributes like horsepower and displacement

  • Transmission: Represents the transmission component of the car, with attributes like type (e.g., automatic, manual) and gears

  • Sensor: Represents various sensors in the car system, with attributes like type (e.g., speed sensor, temperature sensor) and location

  • Controller: Represents electronic control units (ECUs) or controllers in the car system, with attributes like type (e.g., engine control unit, ABS controller) and function.



Relationships and System Functions:

  • The CarSystem contains a Car entity, which encapsulates the entire vehicle

  • The Car has an Engine and a Transmission, which are essential components for vehicle propulsion

  • The Engine provides power to the car, and the Transmission controls the distribution of this power to the wheels

  • The Sensor component collects data such as speed, temperature, and pressure from various parts of the car

  • The Controller component processes this data and controls various functions within the car, such as engine control and anti-lock braking system (ABS)



1.4.1.2 Input

I asked GPT3.5 how did you produced the diagram. It told me it used the PlantUML library in python. PlantUML allows us to define diagrams using a simple text-based syntax and then generate the corresponding diagrams.

To use PlantUML in python enviroment we need to install it from the >terminal using pip

pip install plantuml



After that we can use it in python. see the sample below

from plantuml import PlantUML

# Create a PlantUML instance
uml = PlantUML()

# Define the text representations of the diagrams
requirements_diagram = """
@startuml
    package "Car Requirements" {
        package "Functional Requirements" {
            - Provide propulsion
            - Ensure safety
            - Monitor vehicle speed
        }
        package "Non-Functional Requirements" {
            - Fuel efficiency
            - Reliability
        }
    }
@enduml
"""

# Generate the diagrams
uml.processes.append(requirements_diagram)

# Render and save the diagrams
uml.render_directory('.', clean_first=True)

1.4.1.3 Feedback

To be honest, this system is not what I want for my project. But after this experience, I have a clearer vision of what I am looking for. From a top level the system should work like Diagram --> Text.DB. Describe the relationship between each entity is not very intuitive and the data is not stored in database that can be used to populate a LLM. And, with database I believe we can sync the data. Once place change will correlated to other database.

Store data in SQL Sample code



import sqlite3

# Connect to SQLite database
conn = sqlite3.connect('car_system.db')
cursor = conn.cursor()

# Create tables for each class
cursor.execute('''CREATE TABLE IF NOT EXISTS Car (
                    vin TEXT PRIMARY KEY,
                    make TEXT,
                    model TEXT,
                    year INTEGER
                )''')

cursor.execute('''CREATE TABLE IF NOT EXISTS Engine (
                    id INTEGER PRIMARY KEY,
                    car_vin TEXT,
                    horsepower INTEGER,
                    displacement TEXT,
                    FOREIGN KEY (car_vin) REFERENCES Car(vin)
                )''')

cursor.execute('''CREATE TABLE IF NOT EXISTS Transmission (
                    id INTEGER PRIMARY KEY,
                    car_vin TEXT,
                    type TEXT,
                    gears INTEGER,
                    FOREIGN KEY (car_vin) REFERENCES Car(vin)
                )''')

cursor.execute('''CREATE TABLE IF NOT EXISTS Sensor (
                    id INTEGER PRIMARY KEY,
                    car_vin TEXT,
                    type TEXT,
                    location TEXT,
                    FOREIGN KEY (car_vin) REFERENCES Car(vin)
                )''')

cursor.execute('''CREATE TABLE IF NOT EXISTS Controller (
                    id INTEGER PRIMARY KEY,
                    car_vin TEXT,
                    type TEXT,
                    function TEXT,
                    FOREIGN KEY (car_vin) REFERENCES Car(vin)
                )''')

# Commit changes and close connection
conn.commit()
conn.close()



1.4.2 Opensource/Free MBSE Application

SysML Modeling Tools (e.g., Cameo Systems Modeler Community Edition, Papyrus):

Cameo Systems Modeler Community Edition Cameo Systems Modeler offers a free Community Edition with limited features but includes basic support for database storage and integration.

Papyrus 🍍 Papyrus is an open-source modeling tool that supports SysML and UML. It offers database integration features and is available for free as part of the Eclipse Modeling Tools distribution. OpenMBEE (Open Model-Based Engineering Environment):

OpenMBEE 💓 is an open-source platform for model-based engineering that provides tools and resources for collaborative modeling. It offers database storage capabilities and is freely available for use. Modelio Community Edition:

Modelio is an open-source modeling tool that supports various modeling standards, including SysML and UML. The Community Edition is free to use and includes basic database integration features. Capella:

Capella is an open-source MBSE tool specifically designed for systems architecture modeling. It supports database storage and integration and is freely available for download. OpenModelica:

OpenModelica is an open-source modeling and simulation environment for cyber-physical systems. While primarily focused on simulation, it includes capabilities for database storage and management of models. Simulink:

Simulink, while not open-source, offers a free trial version and a limited-feature version called Simulink Coder. Simulink supports modeling and simulation of cyber-physical systems and includes database integration features.

1.4.3 Operation Solution

After getting to know PlantUML little better, I think the reason why it is popular is because it changed the way how these diagrams used to be developed. Started with diagram then convert it into code even database with entity relationships. Diagrams are created by coding the relationship between each entitiies. This method is not intuitive as first sight, but it can potencially reduce the number of re-edit the diagram manually. It sure limmits the freedom of manipulating the diagram layout, but it offers a more robust and efficient way to produce diagrams. Moreover, it enphasis the entity relationship as the developer creates the diagram. I have to start using it to find out if this is the solution for this problem.



2. Legislation and Regulatory

2.1 Overview

The area of medical device engineering is heavily regulated. Practicing systems design engineers must consult and cooperate with regulatory law, attorneys, and other experts. The resources in this guide can help you find legislative and regulatory information from Canada and the United States.

2.1.1 Commercial Product vs Industrial Solution

A commercial product is intended for purchase on the market by customers. Before launch, it must undergo a thorough process that includes patent protection, public disclosure, and licensing agreements to ensure viability and compliance with guidelines. On the other hand, an industrial solution may be developed in-house to support manufacturing processes. For example, a company may design a robot arm for use on a production line to automate tasks. In this scenario, the company faces two options:

  1. Commercialization: The company can choose to commercialize the robot arm, selling it to other companies to generate profit. To do so, it must obtain necessary certifications to comply with federal regulations, such as the Canada Consumer Product Safety Act, in the specified region.
  2. In-house Use: Alternatively, the company may opt to use the robot arm solely within its own facilities to optimize production processes as an improvement solution. In this case, the company must carefully consider safety risks associated with using the arm in-house to prevent harm or danger to human health. Additionally, it must adhere to regulations governing the operation of the robot arm within its facility.

2.2 Standard

2.3 Certification

2.4 Accreditation



3. Projects

3.1 Automatic Welding Tip Changing Machine

  • Leading the development of an automated system that can replace the weld tip on a welding robot, reducing both production cycle time and the need for human intervention

  • Adapting industrial communication protocols to better suit the factory environment and ensure safe communication with existing machines through a handshake mechanism

3.2 Walking Cane

Successfully designing and crafting a walking cane for the average Canadian, integrating CNC milling and turning operations, and validated the structural integrity through Finite Element Analysis (FEA)



Appendix

PlantML Output Diagrams

  1. SysML Requirements Diagram:
    +-------------------------+
    |       Car Requirements   |
    +-------------------------+
              |
              |
    +-------------------------+
    |      Functional         |
    |    Requirements         |
    +-------------------------+
    | - Provide propulsion    |
    | - Ensure safety         |
    | - Monitor vehicle speed |
    +-------------------------+
              |
              |
    +-------------------------+
    |    Non-Functional       |
    |    Requirements         |
    +-------------------------+
    | - Fuel efficiency       |
    | - Reliability           |
    +-------------------------+
  1. SysML Activity Diagram:
          +---------------------------+
          |     Start Engine           |
          +---------------------------+
          |                           |
+------------------------+    +-----------------------------+
|   Check Fuel Level     |    |    Ignition Key Turned      |
+------------------------+    +-----------------------------+
|   If fuel is low,      |    |  If ignition key is turned, |
|   display warning      |    |  send signal to start engine|
+------------------------+    +-----------------------------+
|   Otherwise, proceed   |    |        Start Engine         |
|   with ignition        |    +-----------------------------+
+------------------------+
  1. SysML State Machine Diagram:
      +-----------------------------+
      |         Engine State         |
      +-----------------------------+
          |                    |
    +-----------+          +------------+
    |  Off      |          |   Running  |
    +-----------+          +------------+
      |    |                   |     |
      |    | Ignition key     |     | Engine running
      |    +------------------+     |
      |          Engine off         |
      +-----------------------------+
  1. SysML Sequence Diagram:
   +-------------------------------+
   |     User - Car Interaction    |
   +-------------------------------+
            |                |
            | Start Engine   |
            |--------------->|
            |                |
            |                |
            | Engine Started |
            |<---------------|
            |                |
            |                |
            | Check Speed    |
            |--------------->|
            |                |
            | Speed Data     |
            |<---------------|
            |                |
            | Stop Engine    |
            |--------------->|
            |                |
   +-------------------------------+

Estimated DevOP Timeline and Staff by GPT3.5

Team Member Responsibilities Expertise Number of People
Database Developer Designing the database schema, creating tables, defining relationships, and optimizing database performance. Database management systems (e.g., SQLite, MySQL, PostgreSQL), SQL query optimization 1
Backend Developer Implementing CRUD operations for data management, integrating with the database, implementing business logic, and API endpoints. Backend programming languages (e.g., Python, Java, Node.js), web frameworks (e.g., Flask, Django, Express.js) 1
Frontend Developer Developing user interfaces for displaying diagrams and interacting with the system. Frontend technologies (e.g., HTML, CSS, JavaScript), web frameworks (e.g., React, Angular, Vue.js) 1
Full Stack Developer (optional) Combining backend and frontend development, implementing end-to-end functionality, and coordinating between different components. Both backend and frontend technologies. 1 (Optional)

Timeline:

Database Design and Setup (2 weeks):

  • Designing the database schema based on requirements.
  • Setting up the database and creating tables.

Backend Development (4 weeks):

  • Implementing CRUD operations for data management.
  • Developing APIs for retrieving and storing data.
  • Integrating with the database.

Frontend Development (4 weeks):

  • Designing user interfaces for displaying diagrams.
  • Implementing functionality for interacting with diagrams and data.

Integration and Testing (2 weeks):

  • Integrating backend and frontend components.
  • Testing the system for functionality, performance, and reliability.

Deployment and Launch (1 week):

  • Deploying the system to a production environment.
  • Conducting final checks and ensuring readiness for launch.

Total Time: 13 weeks (approximately 3 months)


About Mens Feng

Mens Feng is a seasoned safety engineer with a passion for leveraging technology to improve safety standards. With a background in mechanical engineering and a knack for innovation, Mens Feng has spearheaded numerous projects that have garnered recognition for their impact on safety and efficiency.

Contact Information

 

Fork this unlicensed repository to recreate!

Linkedin E-Mail Visits

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages