Skip to content
amarofarinha edited this page Oct 14, 2024 · 16 revisions

What is Equipment Stop?

Equipment Stop, is a critical safety feature implemented in various systems, including the battery emulator project. Its primary purpose is to halt all operations immediately in case of an emergency or potentially hazardous situation. The Equipment Stop feature is designed to enhance safety by immediately halting all operations. When activated, it opens battery contactors controlled by the emulator, interrupting high-voltage connections to prevent potential hazards. Additionally it signals pause, effectively ceasing any ongoing charging or discharging processes by setting the maximum charge and discharge values to zero.

How (hardware)

Equipment stop can be added via a Normally Closed (NC) latching switch. This is how most equipment/emergency stop buttons work.

LilyGo board

Connect the Equipment stop button to the GPIO pins on the LilyGo

  • GPIO Pin35 - Switch NC
  • Any VDD pin - Switch NC

Note

There are not many free GPIO pins on the LilyGo board. The Pin35 might already be in use if you use some other optional functionality. If a collision happens, you can check the Battery-Emulator/Software/src/devboard/hal/hw_lilygo.h for free pins and remap

Stark CMR

Connect the Equipment stop button to the GPIO pins on the Stark CMR

  • GPIO Pin2 - Switch NC
  • VDC pin - Switch NC

External Pull Resistors for Equipment Stop Button

In our system, we use external pull resistors to ensure stable and reliable readings from the equipment stop button. Specifically, we use a 2kΩ resistor between the switch and VCC (3.3V) and a 10kΩ resistor between the GPIO pin and GND. This configuration creates a pull-down circuit, which stabilizes the signal and prevents floating values when the button is not pressed.


  • The 2kΩ resistor ensures that when the button is in its normal (released) state (NC circuit closed), the GPIO pin is pulled to a reliable high signal (3.3V) without excessive current flow.
  • The 10kΩ pull-down resistor ensures that when the button is pressed (NC circuit open), the GPIO pin is pulled to ground, preventing it from floating and avoiding false triggers.

Important: Users must add these external resistors to their setup to ensure proper functionality of the button. Without these resistors, the GPIO pin may experience unstable readings or false triggers.

How (software)

  • Step 1: Enable EQUIPMENT_STOP_BUTTON in USER_SETTINGS.h

To enable the Equipment Stop Button functionality, ensure the following line is uncommented in your USER_SETTINGS.h file:

image

This activates the functionality for an external button to stop the equipment.

  • Step 2: Set the Switch Behavior in USER_SETTINGS.cpp

Next, configure the switch behavior in USER_SETTINGS.cpp. You need to set the STOP_BUTTON_BEHAVIOR variable to either LATCHING_SWITCH or MOMENTARY_SWITCH, depending on your desired button action.

image

LATCHING_SWITCH: A normally closed (NC) latching switch. When the switch is pressed, it activates the equipment stop and keeps the stop active as long as the physical switch remains in the pressed position. The stop will only deactivate when the switch is manually returned to its normal (closed) state.

MOMENTARY_SWITCH: A normally closed (NC) push switch. A short press activates the equipment stop. To deactivate, press and hold the button for 15 seconds. This mode keeps the stop state persistent between reboots.

Internal Debounce Module

We have also implemented an internal software debounce module for handling button inputs more reliably, preventing false triggers caused by mechanical noise.

Why

The Equipment Stop feature was developed to enhance the overall safety and control of the equipment. It provides users with a reliable method to halt operations when needed, ensuring that the system can be effectively managed during both routine use and unexpected situations.

This feature is essential for maintaining operational integrity, as it opens the battery contactors controlled by the emulator, interrupting high-voltage connections and mitigating potential hazards. Additionally, it signals a pause in power usage by setting both the maximum and minimum charge values to zero, thereby preventing any unintended operation of the equipment.

Overall, the development of the Equipment Stop functionality reflects our commitment to providing users with a comprehensive safety mechanism that promotes responsible equipment management and ensures the reliability of the system.

Clone this wiki locally