% init.m
% Script for initializing lab 3, ball and beam system
clear all
% Ball and beam system parameters
m = 0.050; % mass of ball
Rball = 0.02; % radius of ball
JB = 8e-6; % inertia of beam
Lbeam = 1; % length of beam
JR = 0.049; % thickness of beam
Fr = 0.07; % Coefficient of friction for the ball
Km = 7.35; % Motor and gearbox constant
g = 9.8; % gravitational constant
% Linearized Plant
A =
B =
C =
D =
% State-feedback vector K
K =
% Observer matrix L
L =
% Set pauseFrame for Animation
pauseFrame = 0;
% Simulation initial conditions
x_init_plant = [0 0 0 0];
x_init_observer = [0 0 0 0];