Embedded Systems and Design & Development - Feb 19, 2026 | Afternoon | VisionAstraa EV Academy

Embedded Systems and Design & Development - Feb 19, 2026 | Afternoon | VisionAstraa EV Academy

Understanding Motor Control and PWM Signals

Introduction to Motor Control

  • The session begins with a recap of the morning's focus on motor control, emphasizing the importance of voltage requiring two terminals for measurement or sourcing.

Importance of Reference Connections

  • A PWM signal is derived from a microcontroller unit (MCU) and must be applied to the gate of an NMOS transistor with reference to its source terminal.
  • Proper connections are crucial; without referencing the ground terminal of the MCU, voltage application to the gate will be incorrect, leading to potential circuit failure.

Circuit Overview

  • The setup includes an Arduino UNO as the MCU, a temperature sensor providing analog voltage input, and an NMOS power semiconductor switch controlling a motor.
  • The connection diagram shows that the PWM signal from pin 3 needs proper grounding by connecting the NMOS source to the MCU ground for accurate operation.

Connection Process

  • The instructor demonstrates how to connect wires from the ground terminal of the MCU to ensure correct reference for voltage application.
  • While running code that generates PWM signals, it’s noted that duty cycle values range from 0 to 255, affecting motor speed based on pulse width modulation.

Observations and Adjustments

  • As duty cycles change, corresponding changes in generated voltage across components should be observed. Participants are encouraged to experiment with different duty cycle values.
  • Discussion arises about stability in voltage readings; minor variations are expected due to software limitations and inherent ripple effects in PWM signals.

Understanding Voltage Ripple Effects

  • Voltage ripples occur due to high-frequency switching in PWM applications. This can lead to small fluctuations in output voltage across components.
  • A stable DC supply is essential for minimizing noise and ensuring consistent performance in motor operations.

Power Supply Considerations

  • The DC motor operates on a 9V power supply; varying this voltage directly affects RPM. Reducing voltage decreases speed proportionally until it reaches zero.
  • The use of PWM allows control over average voltage supplied to the motor through rapid switching via an NMOS transistor connected at pin 3 of the Arduino UNO.

Understanding PWM Duty Cycle and Motor Speed

Impact of Duty Cycle on Voltage and Speed

  • The duty cycle can be reduced from 190 to 10, resulting in a lower voltage output of approximately 330 to 350 mV, which drastically reduces motor speed.
  • Increasing the duty cycle to 200 raises the voltage and significantly increases the motor speed to around 13,000 RPM. Users are encouraged to experiment with different values for further insights.

Simulation Limitations and Recommendations

  • Tinkercad is primarily a simulation platform for testing program logic rather than operational correctness; it should be viewed as a tool for beginners in electrical coding development.
  • For high-fidelity results in circuit simulations, it's recommended to use SPICE software like LT Spice or Q Spice, which are freely available for download. These tools provide better accuracy compared to Tinkercad.

Circuit Testing and Temperature Monitoring

  • The next task involves combining motor speed variation with temperature monitoring using an LED indicator that turns on when temperatures are between 15°C and 35°C, ensuring safe operation of lithium-ion batteries.
  • Participants are instructed to complete their current circuit simulation before moving on to this new task involving temperature sensing and LED control based on temperature thresholds.

Code Implementation for Temperature Control

  • A code snippet will be provided via qext.in that allows users to sense input temperature and control the built-in LED based on whether the temperature falls within the specified range of 15°C to 35°C. Users must enter specific codes for access.
  • The program defines variables such as sensor value, ADC voltage, and temperature corresponding to each stage in the feedback process related to battery pack temperature monitoring. This setup is crucial for effective control decisions regarding LED activation based on sensed temperatures.

Understanding ADC Values in Feedback Loop

  • The ADC voltage derived from the temperature sensor is critical; it converts analog signals into digital data used within the program's logic flow, allowing real-time monitoring of battery conditions through various outputs including current temperature readings and corresponding digital values from ADC inputs.

Code Development for Temperature Monitoring

Setting Up the Program

  • The program begins by setting up input and output pins, including the built-in LED as an output and a PWM pin for signal generation.
  • The temperature sensor is configured to read values from the ADC input terminal A0, declared as an input. Serial communication is set at a baud rate of 9600.

Processing Sensor Data

  • Inside the loop structure, data from the analog pin is continuously read and stored in a variable named sensor value, which represents the integer equivalent of binary data.
  • A conversion formula derived earlier is applied to translate this sensor value into voltage readings, providing insights into actual temperatures within battery packs.

Debugging and Monitoring

  • For debugging purposes, temperature values are printed on the serial monitor to verify correct readings during development.
  • The program checks if the temperature falls between 15°C and 35°C; if true, it activates the built-in LED. If outside this range, the LED turns off.

Testing Logic with Simulation

  • After modifying the code (removing unnecessary lines), users can start simulations to observe how changes in temperature affect LED status.
  • This phase focuses solely on verifying temperature detection without integrating motor control yet; success is indicated by observing LED behavior.

Observing Results

  • Users can interact with a slider bar to adjust temperature settings while monitoring real-time readings on the serial monitor.
  • As temperatures change via slider adjustments, corresponding updates should appear on both serial monitor displays and LED status indicators.

Next Steps in Code Development

  • Once initial testing confirms logic correctness, participants are encouraged to modify parameters or test additional scenarios before moving onto integrating motor control functionalities.
  • Queries regarding exercises can be addressed through chat support; participants are reminded that Tinkercad account creation is quick and free for further experimentation.

Debugging Techniques in Code Development

Importance of Debugging Tools

  • Utilizing debugging tools is essential when developing code to identify and resolve issues effectively.
  • An oscilloscope can be used to visualize signals, such as PWM signals from a microcontroller, by connecting its terminals appropriately.

Visualizing Signals

  • Ensure proper time divisions are selected on the oscilloscope according to the frequency of the signal being analyzed.
  • Software platforms offer breakpoints that allow developers to pause code execution at specific points, enabling inspection of register contents for verification.

System Development Process

  • A combination of hardware and software debugging tools is recommended for effective system development.
  • The development process should be approached in smaller segments, starting with reading temperature values and controlling motor speed before integration.

Hierarchical Design Approach

  • Adopt a top-down design approach during system design while implementing a bottom-up approach for coding tasks.
  • Break down larger tasks into manageable chunks (e.g., measuring temperature, controlling motors), testing each individually before integration.

Integration and Testing

  • After verifying individual components like temperature measurement and motor control, integrate them based on temperature readings to adjust motor speed accordingly.
  • Share updated code for overall system functionality through Q text; modifications will primarily occur on the software side moving forward.

Battery Thermal Management System Overview

Temperature Control Requirements

  • The battery thermal management system aims to maintain temperatures between 15°C and 35°C by regulating coolant flow through cooling tubes.

Control Mechanism

  • P controllers are typically employed for managing coolant circulation; however, a simplified discrete method using if statements is utilized in this case for ease of programming.

Code Structure Insights

  • Initial setup includes declaring PWM pins and variables for storing temperature values. Serial communication is configured at 9600 baud rate.

Logic Implementation

  • The program logic focuses on displaying voltage and temperature values clearly; using degrees Celsius simplifies the coding process compared to raw sensor or ADC values.

Coolant Flow Control Logic

Overview of Coolant Temperature Management

  • The coolant flow must be controlled within a temperature range of 15 to 35°C, ensuring no circulation when temperatures are below 20°C.
  • When the temperature is between 20 to 25°C, the motor operates at one-fourth speed, resulting in slow coolant circulation.
  • For temperatures between 25 to 30°C, coolant circulation increases slightly; above 35°C, the motor runs at full speed for rapid cooling.

Implementation and Code Structure

  • The logic for controlling coolant flow is implemented using nested if-else statements; however, switch-case statements may be more effective for multiple conditions.
  • Key operational thresholds include:
  • Motor off below 20°C,
  • One-fourth speed from 20 to 25°C,
  • Full speed above 35°C.

Simulation and Testing

  • During simulation testing, adjustments can be made based on real-time temperature readings (e.g., current reading at 24°C).
  • A new code was shared for testing purposes with specific instructions on how to access it.

Advanced Control Strategies

Additional Requirements for Temperature Management

  • If temperatures exceed certain thresholds (e.g., beyond 80 or 90°C), additional controls such as stopping charging need to be integrated into the system.
  • A heater can be activated if temperatures drop below 5°C and should remain on until reaching a minimum of 15°C.

Circuit Design Considerations

  • Users are encouraged to modify control logic according to their needs while maintaining clarity in condition statements.
  • The circuit design includes a semiconductor switch that opens when temperatures exceed specified limits (e.g., greater than 90°C).

This structured approach provides an organized overview of the key concepts discussed in the transcript regarding coolant flow control and associated programming logic.

Tinkercad Session Wrap-Up

Encouragement for Exploration and Experimentation

  • The speaker encourages participants to ask questions regarding Tinkercad, emphasizing the importance of engaging with the platform.
  • Participants are urged to keep exploring and experimenting with what they have learned, highlighting the value of hands-on practice in acquiring new skills.
  • A positive message is conveyed as the speaker wishes all participants good luck in their endeavors.
  • Technical queries can be posted by customers; otherwise, the session is set to conclude soon.
  • The speaker reassures that there will be no changes in circuit-wise sessions moving forward.
Video description

At VisionAstraa EV Academy, we are committed to shaping the future of the Electric Vehicle (EV) Industry. Our institution serves as a bridge between Academia and Industry, empowering students with the skills and knowledge needed to thrive in the EV sector.