Embedded Systems & Cyber-Physical Systems Project (PDF)
Document Details
Uploaded by WarmheartedJasper5439
Reykjavík University
Tags
Summary
This document is a project report likely for a university course on embedded systems and cyber-physical systems. The document discusses concepts like embedded systems, Cyber Physical Systems (CPS), Internet of Things (IoT) and Industry 4.0 principles applied to a project, likely on a robotics platform such as a rover.
Full Transcript
Chapter 1 1. Define Embedded System/Cyber Physical Systems using an example and a counter example. An embedded system is a dedicated computing system integrated into a larger device for a specific function, like the microcontroller in a washing machine. A cyber-physical system...
Chapter 1 1. Define Embedded System/Cyber Physical Systems using an example and a counter example. An embedded system is a dedicated computing system integrated into a larger device for a specific function, like the microcontroller in a washing machine. A cyber-physical system (CPS) combines computational components with physical processes, such as a smart thermostat that controls temperature based on sensor data. A general-purpose PC is a counterexample, as it is not embedded and serves multiple purposes. ○ Project Connection: Our RC rover is an example of a CPS. It integrates sensors (e.g., distance sensor, RGB sensor) with computation (Raspberry Pi) to control the physical behavior (e.g., speed, direction). 2. What is the “Internet of Things” (IoT)? IoT refers to a network of physical devices embedded with sensors, software, and connectivity features, enabling them to collect and exchange data over the internet. Examples include smart thermostats and wearable fitness devices. The main objective is to create intelligent, interconnected systems for automation and data analysis. ○ Project Connection: If we added Wi-Fi or Bluetooth-based data logging to our rover, it could be considered an IoT device, transmitting sensor data (e.g., speed, distance measurements) to a remote server for monitoring. 3. What is the goal of “Industry 4.0”? Industry 4.0 aims to create smart factories that use CPS, IoT, and artificial intelligence for process automation, real-time monitoring, and data-driven decision-making. This allows for enhanced efficiency, flexibility, and customizability in manufacturing. ○ Project Connection: Our rover project applies Industry 4.0 principles by incorporating real-time control (e.g., PID for speed regulation) and potential data-driven adjustments (e.g., line-following using sensor feedback). 4. In which application areas do you see opportunities for CPS and IoT systems? Opportunities include: ○ Healthcare: Remote patient monitoring. ○ Automotive: Self-driving cars. ○ Smart Cities: Traffic optimization. ○ Agriculture: Automated irrigation systems. ○ Project Connection: The control algorithms and sensor integration used in our RC rover could be adapted for autonomous vehicles or industrial robots, both examples of CPS applications. 5. Where do you expect major changes caused by information technology? Significant changes are expected in fields like: ○ Automation: Robotics and AI will enhance production. ○ Healthcare: Real-time patient monitoring and diagnostics. ○ Energy: Smart grids and efficient energy management systems. ○ Project Connection: The autonomous features we implemented (e.g., collision avoidance, line following) reflect similar trends in the automotive industry towards self-driving technology. 6. Which challenges must be overcome to fully take advantage of the opportunities? Key challenges include: ○ Interoperability: Ensuring compatibility between different devices. ○ Security: Protecting data from breaches. ○ Energy Efficiency: Reducing power consumption. ○ Scalability: Handling large-scale implementations. ○ Project Connection: We faced challenges with sensor integration and real-time processing, highlighting the importance of interoperability and efficient data handling. 7. What is a hard timing constraint? What is a soft timing constraint? A hard timing constraint must be met strictly (e.g., activating a car's airbag). Failing to meet this constraint results in system failure. A soft timing constraint allows minor delays, affecting system quality rather than functionality (e.g., video playback delays). ○ Project Connection: Collision avoidance in our rover involves a hard timing constraint; if the system fails to stop in time, it risks damaging the rover. Conversely, line-following precision can be seen as a soft timing constraint. 8. What is the “Zeno effect”? The Zeno effect refers to a scenario in timed automata where an infinite number of actions occur in a finite time interval, leading to deadlock or unresponsive behavior. ○ Project Connection: In our project, rapid sensor polling without proper delays could simulate a Zeno effect, where the system gets stuck processing events without progressing. 9. What is adaptive sampling? Adaptive sampling changes the frequency of data collection based on environmental conditions. For example, increasing the sampling rate during rapid changes in temperature but decreasing it when the environment is stable. ○ Project Connection: Our distance sensor could use adaptive sampling to increase accuracy during fast movement and reduce power consumption when the rover is stationary. 10. Which objectives must be considered during the design of embedded and cyber-physical systems? Objectives include: Reliability Real-Time Performance Energy Efficiency Security Cost-Effectiveness Project Connection: ○ We emphasized real-time performance in our PID control system for speed regulation and reliability in sensor feedback for obstacle detection. 11. Why are we interested in energy-aware computing? Energy-aware computing helps prolong battery life, reduce operational costs, and minimize heat generation. This is particularly crucial for portable and embedded systems. Project Connection: ○ Our rover runs on a battery pack, making energy efficiency critical for longer operational times. We optimized our code to minimize unnecessary sensor polling. 12. What are the main differences between PC-based applications and embedded/CPS applications? PC-based applications are designed for general-purpose tasks and have abundant resources (memory, CPU). In contrast, embedded/CPS applications are resource-constrained, require real-time processing, and are designed for specific functions. Project Connection: ○ The Python code running on our Raspberry Pi is designed for specific control tasks (e.g., motor speed control), tailored to the limited resources of the embedded environment. 13. What is a reactive system? A reactive system responds continuously to external inputs in real-time, such as a fire alarm system reacting to smoke detection. Project Connection: ○ Our rover’s collision avoidance feature exemplifies a reactive system, immediately responding to distance sensor data to prevent crashes. 14. How could we model design flows? Design flows can be modeled using UML diagrams or flowcharts, capturing the sequence of development stages, from requirements gathering to testing and validation. Project Connection: ○ We used flowcharts to design the control logic of our rover, visualizing the steps for sensor reading, data processing, and motor control. 15. What is the “V-model”? The V-model is a development approach emphasizing verification and validation. Each development phase corresponds to a testing phase, ensuring comprehensive evaluation at each stage. Project Connection: ○ We followed a V-model approach by first defining the rover’s requirements (e.g., collision avoidance) and then validating these through unit tests and system tests. 16. How could we define the term “synthesis”? Synthesis involves transforming high-level design specifications into a concrete implementation, such as generating hardware configurations for an FPGA or compiling code for a microcontroller. Project Connection: ○ We synthesized our control logic specifications into Python code running on the Raspberry Pi, implementing the real-time control algorithms. 17. What are the risks of the ${MODEL} development model? What are their benefits? For the V-model, risks include rigidity and difficulty adapting to changes, but the benefits are thorough testing and well-documented processes. Project Connection: ○ The structured testing in our project reduced integration issues, but it was challenging to adapt when we needed to change sensor configurations mid-development. Chapter 2: Models of Computation 1. What is a (design) model? What is the purpose of a model? How do we use models? A design model is an abstraction of a system used to simplify complex behaviors and predict outcomes. It helps in analyzing and discussing system functionality without building the actual product. Models can be used in software development for tasks like requirements gathering, system architecture design, and validation. ○ Project Connection: We used a finite state machine model for the rover's control system, defining states like "Line Following," "Collision Avoidance," and "Idle." 2. Name three requirements for specification/modeling languages for embedded systems. The requirements include: ○ Concurrency Support: To model parallel processes. ○ Precise Timing: Accurate representation of time constraints. ○ Modularity: Ability to build complex systems from simpler components. ○ Project Connection: Concurrency was vital in our rover project, as sensor reading and motor control needed to run in parallel. We ensured timing precision in tasks like PID control for speed regulation. 3. What is a “model of computation (MoC)”? A model of computation (MoC) defines the rules and structure of how a computation process is carried out. It sets the semantics of operations and their interactions. Examples include finite state machines, Von Neumann model, and dataflow models. ○ Project Connection: We used the finite state machine (FSM) model in our rover to handle different modes of operation like manual control, line following, and collision avoidance. 4. What is a “job” and how is it different from “tasks”? A task is a recurring activity scheduled for execution (e.g., sensor polling every second), while a job is a single instance of task execution (e.g., reading sensor data at 12:01 PM). Tasks are the general definition; jobs are the specific executions. ○ Project Connection: In our rover, the "task" could be monitoring the speed of the wheels, and each actual speed check is a "job." 5. Which are the two key techniques for communication on computers? The key techniques are: ○ Shared Memory: Direct access to a common memory space by multiple processes. ○ Message Passing: Processes exchange information via explicit messages, often used in distributed systems. ○ Project Connection: We implemented shared memory concepts by storing sensor data in shared variables accessible by the control logic, ensuring efficient real-time decision-making. 6. Which description techniques can be used for capturing initial ideas about the system to be designed? Techniques include: ○ Use Case Diagrams: To capture user interactions. ○ State Diagrams: To represent the different states of the system. ○ Flowcharts: For visualizing the sequence of operations. ○ Project Connection: We used state diagrams to map out the various operating modes of the rover, like "Idle," "Moving Forward," and "Obstacle Detected." 7. Give an example of a model of computation and describe how it may be used. Finite state machines (FSM) model a system based on its states and transitions. It is useful for designing control systems where the behavior depends on current state and input, such as traffic light control. ○ Project Connection: Our rover's behavior was modeled using an FSM to handle transitions between states like "Line Following" and "Collision Avoidance" based on sensor inputs. Chapter 3 1. What is meant by “hardware in a loop”? Hardware in a loop (HIL) testing involves simulating the software with actual hardware components to validate the system's behavior before full deployment. It allows real-time testing without the need for the complete physical setup. ○ Project Connection: We used HIL testing for our rover by connecting the Raspberry Pi directly to sensors and motors to validate the control algorithms in real-time. 2. What is an A/D converter? Name an example and describe how it works. An Analog-to-Digital (A/D) converter converts continuous analog signals into discrete digital values. For example, the MCP3008 chip reads voltage levels and outputs corresponding digital values for processing. ○ Project Connection: We used the MCP3008 A/D converter in our rover to read analog input from the distance sensor, converting the voltage readings into digital values for obstacle detection. 3. What is a D/A converter? Name an example and describe how it works. A Digital-to-Analog (D/A) converter converts digital signals into analog output. For example, an audio DAC in a sound system converts digital audio files into analog sound waves. ○ Project Connection: Although we did not use a D/A converter directly, the motor controller in our rover acts similarly by translating digital control signals into voltage levels to drive the motors. 4. Most common method: pulse width modulation (PWM). PWM is a technique used to control power delivery to devices by varying the duty cycle of a digital signal. It is commonly used for motor speed control. ○ Project Connection: We used PWM to control the speed of the rover’s DC motors, adjusting the duty cycle based on the desired speed. Chapter 4 1. What is an embedded operating system? An embedded operating system is designed to manage hardware and software resources in embedded systems, focusing on real-time performance and efficiency (e.g., FreeRTOS). ○ Project Connection: We used Raspbian Lite, an embedded OS, to manage the processes and GPIO interactions on the Raspberry Pi in our rover project. 2. What is a real-time operating system? A real-time operating system (RTOS) ensures that tasks are executed within strict timing constraints, providing predictable and deterministic behavior (e.g., FreeRTOS, VxWorks). ○ Project Connection: While we did not use a full RTOS, we implemented real-time elements in Python to handle precise motor control and sensor polling. Chapter 5 1. Resource access protocols: What is priority inversion? How is it happening? How can it be avoided? Priority inversion occurs when a lower-priority task holds a resource needed by a higher-priority task, causing delays. It can be avoided using protocols like priority inheritance, where the lower-priority task temporarily inherits the priority of the blocked higher-priority task. ○ Project Connection: In our rover, resource access for sensor data could have led to priority inversion if sensor polling was delayed by non-critical processes. We managed this by prioritizing sensor updates in our control loop. Chapter 6 1. What is the purpose of a real-time scheduler? A real-time scheduler ensures that tasks are executed according to their timing requirements, balancing task priorities to meet deadlines. ○ Project Connection: We used a basic scheduler in our Python code to manage the timing of sensor readings and motor updates, ensuring the rover responded promptly to changes in the environment. 2. Give an example of a real-time scheduler. An example is the Rate-Monotonic Scheduler (RMS), which assigns static priorities based on the periodicity of tasks. ○ Project Connection: Our control loop used a form of round-robin scheduling, giving equal time slices to sensor reading and motor control tasks. 3. What is schedulability? Schedulability is the ability of a system to complete all tasks within their specified time constraints. ○ Project Connection: We tested the schedulability of our rover’s control tasks by ensuring that sensor polling and motor updates occurred without delays, even under high load conditions.