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

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by