Professional Documents
Culture Documents
Abstract—This paper presents an innovative approach to potential applications in industrial automation, robotics, and
motor driver frequency adjustment by integrating facial smart home environments.
recognition technology and machine learning. Traditional
Variable Frequency Drives (VFDs) often require manual
II. SYSTEM MODEL
adjustments, limiting dynamic control capabilities. Our system
utilizes a facial recognition model trained with deep neural
networks to accurately capture and interpret operators' facial
expressions in real-time. This approach eliminates manual
adjustments, providing an intuitive interface for efficient
motor speed control. The applications of this system extend to
industrial automation, robotics, and smart homes.
I. INTRODUCTION
The implementation of Variable Frequency Drives
(VFDs) has brought significant advancements to motor
control systems. In this project, we explored the concept of
controlling the motor's frequency using machine learning
algorithms, specifically by recognizing and analyzing facial
expressions. To realize this, we employed a hardware setup
consisting of an Arduino-based system generating
Sinusoidal Pulse Width Modulation (SPWM) signals and
utilized MOSFETs for switching. The AC input was
rectified and fed into an inverter, enabling us to control the
frequency using the generated SPWM signals.
The machine learning aspect involved training a facial
recognition model using deep neural networks to accurately
capture and interpret facial expressions in real-time. By
showing their faces to the system, operators could influence
the motor's frequency through the ML algorithm's analysis
of their expressions. This approach eliminated the need for
manual adjustments and provided an intuitive interface for
controlling motor speeds.
Overall, this project showcased the integration of
machine learning algorithms with hardware components to
achieve variable frequency control in motor drives. The
combination of SPWM generation with MOSFET
switching, along with the facial recognition-based machine
learning model, demonstrated an innovative approach to
motor control. The project's findings contribute to the
advancement of intelligent motor control systems and offer
Fig 2.1: System Model
III. MACHINE LEARNING C. Algorithm Used
D. Results/Plots/conclusion
IV. COMMUNICATION
B. Protocol Used
A. Communication model used The ESP-32 module utilizes the Wi-Fi protocol for wireless
communication. Wi-Fi (Wireless Fidelity) is a widely
In the project, the ESP-32 module was utilized for adopted protocol that enables devices to connect and
wireless communication. The ESP-32 is a powerful Wi-Fi communicate wirelessly within a local area network (LAN)
and Bluetooth-enabled microcontroller module widely used or with the internet. Here's an overview of how the ESP-32
in Internet of Things (IoT) applications. It integrates a dual- utilizes the Wi-Fi protocol for communication:
core processor, Wi-Fi and Bluetooth connectivity, and 1. Wi-Fi Connectivity: The ESP-32 module is
various input/output (I/O) pins, making it an ideal choice for equipped with built-in Wi-Fi capabilities,
wireless communication in the project. allowing it to connect to Wi-Fi networks as a
client or act as an access point.
Here's a general overview of how the ESP-32 works for
wireless communication: 2. Network Configuration: To establish a Wi-Fi
connection, the ESP-32 module needs to be
1. Wi-Fi Connectivity: The ESP-32 module configured with the appropriate network
incorporates Wi-Fi capabilities, allowing it to credentials, such as the network SSID (Service Set
connect to a local network or act as an access point. Identifier) and password. This information is
It can establish a wireless connection with other typically provided through the device's firmware
devices or connect to the internet for data or programmatically set during the initialization
exchange. process.
2. Bluetooth Connectivity: In addition to Wi-Fi, the 3. Network Discovery: The ESP-32 module can scan
ESP-32 module also supports Bluetooth for available Wi-Fi networks within its range. It
communication. It can establish Bluetooth can retrieve information about nearby networks,
connections with other devices, enabling seamless including their names (SSIDs) and signal
communication and data transfer. strengths. This allows the module to choose and
3. Programming and Configuration: The ESP-32 connect to the desired network based on the
module can be programmed using various provided credentials.
development environments, such as the Arduino 4. Wi-Fi Client Mode: In client mode, the ESP-32
IDE or Espressif's official development module connects to an existing Wi-Fi network,
framework. This allows developers to write code similar to how a smartphone or computer connects
to control the module's functionalities and to a Wi-Fi hotspot. Once connected, the module
configure its wireless communication parameters. obtains an IP address from the network's DHCP
server, which enables it to communicate with
4. Wireless Data Transfer: With the ESP-32 module,
other devices on the same network or access the
wireless data transfer is achieved by utilizing the
internet.
Wi-Fi or Bluetooth protocols. The module can
send and receive data packets wirelessly, allowing 5. Data Exchange: With Wi-Fi connectivity
it to transmit information to other devices within established, the ESP-32 module can send and
its range. receive data packets over the network. It can
communicate with other devices or servers within
5. Integration with Other Components: In the project, the same Wi-Fi network using TCP/IP or other
the ESP-32 module is likely integrated with other application layer protocols such as HTTP, MQTT,
hardware components, such as the Arduino board or WebSocket. This allows for bidirectional data
or sensors. This integration enables the ESP-32 to transfer and facilitates the exchange of
receive data from the facial recognition system or information between the ESP-32 and other
motor control unit and wirelessly transmit it to
connected devices.
other devices for further processing or display.
6. Security: The ESP-32 supports various Wi-Fi output, which is then fed into the motor control system for
security protocols, including WEP, WPA, and precise and efficient control of the motor's frequency.
WPA2, to ensure secure communication over Wi-
Fi networks. These security mechanisms help
protect sensitive data from unauthorized access or
tampering.
By leveraging the Wi-Fi protocol, the ESP-32 module
enables wireless communication and connectivity,
allowing it to exchange data with other devices or servers
within the same Wi-Fi network. This capability facilitates
remote control, monitoring, and integration with other
systems, making it suitable for a wide range of IoT
applications.
V. HARDWARE
A. AC to DC converter
Fig 5.1: Rectifier
In this project, an AC to DC converter was implemented
to convert the alternating current (AC) input into direct
current (DC) to power the motor control system. Power
diodes with a 10A rating were utilized as rectifiers in the AC
to DC conversion process. Here's an overview of how the
AC to DC converter and power diodes function:
1. Rectification: The AC input from the power source
undergoes rectification, where the negative portion
of the AC waveform is converted into a positive
voltage. This process ensures that the output is a
unidirectional current.
2. Full-Wave Rectification: Full-wave rectification is
achieved by using a bridge rectifier circuit, which
typically consists of four diodes. In this project,
power diodes with a 10A rating were employed for
their capability to handle high current levels.
3. Diode Operation: Power diodes are semiconductor
devices that allow current to flow in one direction
while blocking it in the opposite direction. When
the AC input voltage is positive, two of the diodes
in the bridge rectifier conduct, providing a forward
path for current flow. Simultaneously, the other Fig 5.2: Rectifier Output
two diodes are reverse-biased and block the current
flow in the opposite direction.
4. Conversion to DC: As the AC waveform B. Motor driver IC
alternates, the conducting diodes switch
accordingly, allowing the positive portion of the In this project, although a motor driver IC was initially
AC waveform to pass through. This results in a considered, it was ultimately not used. Instead, MOSFETs
pulsating DC waveform with a frequency twice were chosen as an alternative approach for controlling the
that of the input AC voltage. However, it still motor. Several factors influenced this decision:
contains ripple or fluctuations. 1. Precision and Efficiency: MOSFETs offer precise
5. Filtering: To reduce the ripple and obtain smoother control over the motor's speed and direction. By
DC output, a filtering capacitor is typically adjusting the gate voltage, MOSFETs can regulate
connected in parallel to the load. The capacitor the current flow to the motor with high accuracy.
helps smooth out the pulsating waveform by This level of control allows for efficient operation
storing charge during the peak voltage periods and and better performance compared to using a motor
releasing it during the low voltage periods. driver IC.
By utilizing power diodes with a 10A rating in the AC 2. Power Handling Capability: MOSFETs are
to DC converter, the project ensures that the diodes can capable of handling high current and voltage
handle high current levels effectively. This enables the levels, making them suitable for driving motors
conversion of AC input into a rectified and smoothed DC with varying power demands. This feature ensures
that the control system can handle the motor's 2. Speed Regulation: Through the implementation of
requirements without the limitations imposed by pulse width modulation, the H-bridge allowed for
the current ratings of a motor driver IC. fine-tuned speed control. By adjusting the duty
By leveraging MOSFETs for motor control, the project cycle of the PWM signal, the effective voltage
achieved precise and efficient regulation of the motor's applied to the motor could be controlled, resulting
speed and direction. This decision offered greater control in precise speed regulation across a wide range of
flexibility, integration options, and power handling operating speeds.
capabilities, while also contributing to the project's 3. Efficient Power Conversion: The H-bridge circuit
research goals in advancing motor control systems through minimized power losses by utilizing the switching
novel methodologies and components. nature of the switches. When the switches were
fully on, they presented minimal resistance,
maximizing the efficiency of power conversion
C. H-bridge description and results
from the DC supply to the motor.
4. Overcurrent Protection: To protect the motor and
In this project, an H-bridge configuration was utilized for the H-bridge circuit from overcurrent conditions,
motor control. The H-bridge is a circuit topology appropriate current sensing and protective
commonly used to control the direction and speed of DC measures, such as fuses or current-limiting
motors. It consists of four switching devices, typically devices, were incorporated. These measures
MOSFETs or transistors, arranged in a configuration that ensured safe operation and prevented damage to
allows bidirectional current flow through the motor. Here's the motor and circuitry.
a description of the H-bridge and the results obtained: The implementation of the H-bridge configuration
demonstrated effective bidirectional control and precise
1. Switching Devices: The H-bridge incorporates speed regulation of the motor. The combination of the H-
four switching devices arranged in two pairs. Each bridge circuit with pulse width modulation provided
pair consists of two complementary switches, versatility, efficiency, and reliable operation, making it a
typically labeled as high-side and low-side suitable choice for motor control applications.
switches. These switches can be MOSFETs,
transistors, or even specialized motor driver ICs.
2. Direction Control: By selectively activating the D. Final Hardware Results
high-side and low-side switches, the H-bridge can
control the motor's direction. For instance, In the hardware section of the project, several key
activating one pair while keeping the other pair components and configurations were implemented to
deactivated allows current to flow in one achieve motor control. The H-bridge configuration,
direction, while reversing the activation pattern utilizing MOSFETs as switching devices, played a crucial
changes the direction of current flow. role in bidirectional control and speed regulation of the
3. Speed Control: The H-bridge also enables speed motor. By activating the appropriate switches, the motor
control by implementing pulse width modulation could be made to rotate in either direction. The use of pulse
(PWM). By rapidly switching the switches on and width modulation (PWM) allowed for precise speed control
by adjusting the duty cycle of the PWM signal. This
off at varying duty cycles, the effective voltage
combination of the H-bridge and PWM facilitated versatile
and current applied to the motor are adjusted. This
and efficient motor operation. Additionally, the power
PWM technique allows for precise speed control. diodes used in the AC to DC converter ensured the
conversion of AC input to DC power for the motor control
system. The integration of the ESP-32 module enabled
wireless communication, providing connectivity and data
exchange capabilities. Overall, the hardware
implementation successfully achieved bidirectional motor
control, precise speed regulation, efficient power
conversion, and wireless communication, contributing to
the overall success of the project.
APPENDIX
IMPORT SOCKET
DEF DETECT(SAVE_IMG=FALSE):
ELSE:
# DIRECTORIES DATASET = LOADIMAGES(SOURCE,
IMG_SIZE=IMGSZ, STRIDE=STRIDE)
SAVE_DIR =
PATH(INCREMENT_PATH(PATH(OPT.PROJECT) / OPT.NAME,
EXIST_OK=OPT.EXIST_OK)) # INCREMENT RUN
# GET NAMES AND COLORS
(SAVE_DIR / 'LABELS' IF SAVE_TXT ELSE
SAVE_DIR).MKDIR(PARENTS=TRUE, EXIST_OK=TRUE) # NAMES = MODEL.MODULE.NAMES IF HASATTR(MODEL,
MAKE DIR 'MODULE') ELSE MODEL.NAMES
COLORS = [[RANDOM.RANDINT(0, 255) FOR _ IN
RANGE(3)] FOR _ IN NAMES]
# INITIALIZE
SET_LOGGING()
# RUN INFERENCE
DEVICE = SELECT_DEVICE(OPT.DEVICE)
IF DEVICE.TYPE != 'CPU':
HALF = DEVICE.TYPE != 'CPU' # HALF PRECISION ONLY
SUPPORTED ON CUDA MODEL(TORCH.ZEROS(1, 3, IMGSZ,
IMGSZ).TO(DEVICE).TYPE_AS(NEXT(MODEL.PARAMETERS())
)) # RUN ONCE
# LOAD MODEL OLD_IMG_W = OLD_IMG_H = IMGSZ
MODEL = ATTEMPT_LOAD(WEIGHTS, OLD_IMG_B = 1
MAP_LOCATION=DEVICE) # LOAD FP32 MODEL
T3 = TIME_SYNCHRONIZED()
IF SAVE_IMG OR VIEW_IMG: # ADD BBOX TO
IMAGE
# APPLY CLASSIFIER LABEL = F'{NAMES[INT(CLS)]} {CONF:.2F}'
IF CLASSIFY: PLOT_ONE_BOX(XYXY, IM0, LABEL=LABEL,
PRED = APPLY_CLASSIFIER(PRED, MODELC, IMG, COLOR=COLORS[INT(CLS)], LINE_THICKNESS=1)
IM0S)
P, S, IM0, FRAME = PATH[I], '%G: ' % I, # DEFINE THE IP ADDRESS AND PORT NUMBER FOR
IM0S[I].COPY(), DATASET.COUNT THE ESP32
X.SENDALL(DELAY.ENCODE())
PRINT(F'DONE. ({TIME.TIME() - T0:.3F}S)')
#DATA = X.RECV(1024)
#IF DATA.DECODE() == "ACK":
PRINT(F' DATA SENT SUCCESSFULLY')
IF __NAME__ == '__MAIN__':
TIME.SLEEP(1)
PARSER = ARGPARSE.ARGUMENTPARSER()
PARSER.ADD_ARGUMENT('--WEIGHTS', NARGS='+',
TYPE=STR, DEFAULT='YOLOV7.PT', HELP='MODEL.PT
# STREAM RESULTS PATH(S)')
OPT = PARSER.PARSE_ARGS()
PRINT(OPT)
#CHECK_REQUIREMENTS(EXCLUDE=('PYCOCOTOOLS',
'THOP'))
WITH TORCH.NO_GRAD():
DETECT()
STRIP_OPTIMIZER(OPT.WEIGHTS)
ELSE:
DETECT()