Varying weight of a ball with time in a Maglev system

조회 수: 2 (최근 30일)
Tyler Mudge
Tyler Mudge 2020년 12월 12일
댓글: Sam Chak 2024년 7월 10일
Hello, I'm trying to vary the weight of a magnetically levitated ball with time. Namely, the balls weight is supposed to suddenly chand at time t=20s by 15%. Here is the code I have so far including the initial mass of the ball (0.06 kg):
clc
clear
%% Define knowns
g = 9.81; % gravity [m/s^2]
k = 1.32435*10^-4; % Magnet force constant, [N/amp]
x_0 = 0.015; % steady state position [m]
m_0 = 0.06; % initial ball's weight [kg]
i_0 = 1; % Steady state amps, assumed from NYU experiment [amp]
%% Define variable parameters
i = 1;
R = 10; % From NYU experiment [Ohm]
L = 0.4125; % Inductance from NYU experiment [Henry]
%% Checking Current System Stability
a = (2*k*i_0)/(m_0*x_0^2); % num of TF
b = (2*k*i_0^2)/(m_0*x_0^3); % part of den for TF
num = [a];
den = [1 0 b];
sys = tf(num,den)
% step(sys,t)
%% Simulate Model
maglev_sim = sim('Maglev_Model.slx');
%% Plotting m = 0.06 kg response
figure(1)
plot(maglev_sim.maglev,'LineWidth',2)
title('Position Response for m = 0.06kg')
ylabel('Position (m)')
xlabel('Time (s)')
%% Changing mass with time
The Simulink model is attached. So far I have been able to achieve the desired output of the ball's position being 0.015 m away with the original mass of 0.06 kg but now I need to change the mass with time and have the system still keep the ball at that position.
Any help is appreciated!
  댓글 수: 2
Gebretsadkan Fissha
Gebretsadkan Fissha 2024년 7월 10일
Hello, can you help me for solving sliding mode controller nonlinear odes of Maglev system?
Sam Chak
Sam Chak 2024년 7월 10일
Suggest you to post a new question (click on the ASK button) and show the nonlinear ODEs of the Maglev system.

댓글을 달려면 로그인하십시오.

답변 (1개)

Kyle Rawding
Kyle Rawding 2021년 3월 17일
Hi -
It sounds like you're interested in updating your transfer function as the simulation runs to account for the changing mass, rather than defining static 'a' and 'b' constants.
I'd recommend taking a look at the accepted answer to this question:
Hope that helps!
-Kyle

제품


릴리스

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by