Skip to content

yusenhu/Class-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Automatic Padlock Opening Controller

Project Description

The Automatic Padlock Opening Controller is a microcontroller-based system designed to automatically open a padlock using a motor-driven dial mechanism. Users interact with the system via a 4x4 keypad and monitor machine status in the Arduino Serial Monitor.

Core Functions

  • Set and track dial position (0-39 for a 40-mark lock).
  • Open padlock in automatic mode with combination sequence logic.
  • Provide one-click manual dial control in both directions.
  • Display mode status, prompts, and errors via Serial Monitor.

System Modes

1) Setup Mode

  • User enters initial dial position through keypad.
  • System stores the position and prepares for operation.
  • Dial position and prompts are shown in Serial Monitor.

2) Automatic Mode

  • User enters three combination numbers.
  • System performs lock sequence:
    1. Two full turns clockwise (RIGHT) to first number.
    2. One full turn counter-clockwise (LEFT), passing first number, to second number.
    3. One turn clockwise (RIGHT) to third number.
  • System prompts user to pull shackle after completion.

3) Manual Mode

  • User rotates dial manually with keypad:
    • 1: one-click clockwise
    • 2: one-click counter-clockwise

Free Time System (FTS) Architecture

A. Initialization Function

  • Initializes variables, flags, and mode defaults.

B. Machine Status Selection Function

  • Reads keypad and selects operating mode.

C. Machine Setup Data Function

  • Captures initial dial position and transitions system to ready state.

D. Automatic Function

  • Executes complete lock-opening sequence from three user-entered numbers.

E. Manual Function

  • Executes one-click movement per key press.

F. Programming Function

  • Not required in this project; not implemented.

G. Output Control Supervisor

  • Prints mode changes, prompts, and machine status to Serial Monitor.

H. Error Function

  • Handles invalid input and run-time fault messages.

Human-Machine Interface (Serial Monitor)

The interface displays:

  • Current mode
  • Dial position
  • Combination input progress
  • Error and reset messages

Example main menu:

EME-154 Mechatronics
Free Time System
Yusen Hu
****************************************
            OPERATION MENU
****************************************
1. Manual Operation
2. Automatic Operation
3. Machine Data Set-Up
5. Exit

System Development Summary

Key development items completed:

  • Implemented dial movement helpers:
    • moveCwToDialNO()
    • moveCcwToDialNO()
  • Implemented automatic sequence in ACSfunction().
  • Completed setup and automatic menu text blocks.
  • Added/updated emergency recovery in ERTfunction().
  • Added PI controller parameters scaffold (KI, INTEGRAL_LIMIT) for experimentation.

Challenges Encountered

  1. Motor tuning difficulty
    • Finding reliable MIN_PWM, KP, KI for different motor friction points.
  2. Memory / compatibility constraints
    • Adopted F() macro usage for many Serial strings.

About

Mechatronic Class Project

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages