Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(hepa-uv): add support for the safety relay in the new revisions of the Hepa/UV module. #782

Merged
merged 7 commits into from
Jun 17, 2024

Conversation

vegano1
Copy link
Contributor

@vegano1 vegano1 commented May 31, 2024

Overview

As a result of the initial safety evaluation of the Flex HEPA/UV unit, we have added a safety relay between the PCBA and UV lamp ballast that monitors the Flex door switch, the placement reed switch, and the UV enable pushbutton. This safety relay will cut the supply to the UV lamp ballast if the door is opened or if the placement reed switch is not activated. Furthermore, the user must press the UV to enable the pushbutton to enable the relay after both the door switch and placement reed switch are in the correct state. All of this happens without firmware interaction.

This pull request incorporates the changes required to support the new electrical design, since most of the logic is the same, the work is concentrated on adding support for the safety relay. This pull request goes with monorepo pr Opentrons/opentrons#15311.

Closes: PLAT-300 PLAT-301 PLAT-302

Change log

  • renamed UV_NO_MCU_PIN to nUV_PRESSED_PIN for accuracy
  • added nSAFETY_ACTIVE_MCU (PB5) input pin to know the state of the safety relay
  • added internal safety_relay_active flag in uv_task to keep track of the safety relay state
  • update safety_relay_active state from the nSAFETY_ACTIVE_MCU gpis whenever uv_task handles irq.
  • added safety_relay_active flag to HepaUVStateResponse
  • check the safety_relay_active state after turning on the UV light
  • send safety_relay_inactive 0x11 error code if the relay is not active
  • added ot_utils::freertos_sleep::sleep to cpp-utils to sleep the task for n milliseconds

Test Plan

  • Make sure that the UV light turns off when the door is opened
  • Make sure that the UV light turns off when the reed switch is inactive
  • Make sure that the UV light turns ON when the door is closed, the reed switch is active, and uv push button is pressed
  • Make sure that we CAN'T turn on the UV light via CAN unless the door is closed, the reed switch is active, and uv push button has been pressed.
  • Make sure we send safety_relay_inactive = 0x11 error if the safety relay is unarmed after turning on the UV lights

- added nSAFETY_ACTIVE_MCU input pin to know the state of the safety relay
- added internal safety_relay_active flag in uv_task to keep track of safety relay state
- update safety_relay_active state from the nSAFETY_ACTIVE_MCU gpis whenever uv_task handles irq.
- added safety_relay_active flag to HepaUVStateResponse
- check the safety_relay_active state after turning on the uv light
- send safety_relay_inactive 0x11 error code if the relay is not active
- added ot_utils::freertos_sleep::sleep to cpp-utils to sleep the task for n milliseconds
include/common/core/wtf.hpp Outdated Show resolved Hide resolved
- change safety relay pin PB6 -> PB5
- add c1 revision
@vegano1 vegano1 requested review from ahiuchingau and sfoster1 June 14, 2024 20:33
@vegano1 vegano1 marked this pull request as ready for review June 14, 2024 20:33
Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, nice work!

@vegano1 vegano1 merged commit 0e8fb3d into main Jun 17, 2024
36 of 37 checks passed
@vegano1 vegano1 deleted the PLAT-300-handle-safety-relay-pin branch June 17, 2024 17:53
y3rsh pushed a commit that referenced this pull request Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants