instructions need to use solidworks for the cad design and matlab for
Search for question
Question
Instructions
Need to use solidworks for the CAD Design and MATLAB for the code and simulink
I need the drawing to be made in matlab and the code to make the mechnism work
using discrete time in matlab and the simulink file to simulate function in matlab as
well/n 1. Create Complete CAD model of concept below and provide in isometric view
candle
Container
wax
intended
motion
lid
arm for lid to attatch to
3 mount For mechanism
base Plate
mechanism
mechanized arm
Closed Position
*mechanism
Open Position
as gold arm rotates
Counter clockwise
lid opens & closes a. Identify any hardware needed (Temperature Controller, Real time clock,
actuator, motor etc.)
i. include diagram of hardware setup
2. Create video of motion lid opening and closing from CAD design
3. Develop discrete time code in MATLAB using Euler's method
a. See example of code below (change code as needed)
% Define system parameters
mass 1; % ounce
friction coefficient = 0.1%; % N/m/s
external_force = 0; % N (no external force)
% Discretization parameters
sampling_time = 0.1%; % seconds
% Discretize the system using Euler's method
A = [1  sampling time/mass *friction_coefficient;
B =
sampling time/mass];
[sampling_time/mass;
0];
C = eye (2); % Identity matrix (assuming full state feedback)
D = zeros (2,1);
% Define the controller
Kp = 1; % Proportional gain
Ki 0.1; % Integral gain
Kd = 0.01; % Derivative gain
Define the discretetime PID controller
controller = pid (Kp, Ki, Kd, sampling time);
% Simulate the closedloop system
sys ss (A, B, C, D, sampling_time);
closed_loop_sys = feedback(sys, controller);
% Simulate the response to a step input
t0:0.1:10; % Time vector
u = ones (size(t)); % Step input
[y,t, x] = lsim(closed_loop_sys, u, t);
%Plot the response
plot(t, y);
xlabel('Time (seconds)');
ylabel('Position');
title('Response of the lid closing system');
Error using ss
The "A" and "E" matrices must be square.
Error in Final_Project (line 26)
sysss (A, B, C, D, sampling_time);
4. Implement controller
5. Simulate in Simulink
6. Analyze performance/n Candle Safe Motivation
Each year an estimated average of 5,910 home fires ignited by
candles which have resulted in 74 civilian deaths, 558 civilian
injuries, & $257 million dollars worth of property damage.
50% of candle fires ignited due to proximity to flammable décor
items, while in 21% of home structures candle fires, candles
were either left unattended improperly disposed of or misused
Realworld systems are inherently discrete in nature, especially
those controlled by digital devices. Modeling these systems in
discrete time allows for more direct translation to digital
implementation and ensures seamless integration into digital
control systems. Background
The idea for the automated candle snuffer with a candle lid
like form stemmed from personal experiences growing up
Catholic, where altar boys/girls would use a candle snuffer
to extinguish candles. Inspired by this practice, the concept
evolved when using a personal candle lid at home for the
same purpose, sparking the idea to automate the process
using a lidlike mechanism. Model
mä(t) + cx(t) + kx(t) = u(t)

x(t) − x(t − At)

At

x(t) − x(t − At)
x(t) ≈
x(t) ≈
x[k] − 2x[k – Ak] + x[k − 2Ak

m
(Ak)²

+ C
At
x[k] − x[k – Ak]
ΔΚ

+ kx[k] = u[k] Control
Efficiently extinguish the candle flame.
Prevent accidents or damage caused by uncontrolled
flames.
Provide a reliable safety measure for candle usage.
Integrate seamlessly with the lidclosing mechanism for
effective operation.