stewart-simscape/docs/control-vibration-isolation.html

1222 lines
60 KiB
HTML
Raw Normal View History

2020-01-22 16:31:44 +01:00
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
2021-01-08 15:54:58 +01:00
<!-- 2021-01-08 ven. 15:52 -->
2020-01-22 16:31:44 +01:00
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
2020-02-28 17:35:44 +01:00
<title>Stewart Platform - Vibration Isolation</title>
2020-01-22 16:31:44 +01:00
<meta name="generator" content="Org mode" />
<meta name="author" content="Dehaeze Thomas" />
2021-01-08 15:34:53 +01:00
<link rel="stylesheet" type="text/css" href="https://research.tdehaeze.xyz/css/style.css"/>
<script type="text/javascript" src="https://research.tdehaeze.xyz/js/script.js"></script>
<script>
MathJax = {
svg: {
scale: 1,
fontCache: "global"
},
tex: {
tags: "ams",
multlineWidth: "%MULTLINEWIDTH",
tagSide: "right",
macros: {bm: ["\\boldsymbol{#1}",1],},
tagIndent: ".8em"
}
};
</script>
<script id="MathJax-script" async
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js"></script>
2020-01-22 16:31:44 +01:00
</head>
<body>
<div id="org-div-home-and-up">
<a accesskey="h" href="./index.html"> UP </a>
|
<a accesskey="H" href="./index.html"> HOME </a>
</div><div id="content">
2020-02-28 17:35:44 +01:00
<h1 class="title">Stewart Platform - Vibration Isolation</h1>
2020-01-22 16:31:44 +01:00
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
2021-01-08 15:34:53 +01:00
<li><a href="#org4b4dce5">1. HAC-LAC (Cascade) Control - Integral Control</a>
2020-01-22 16:31:44 +01:00
<ul>
2021-01-08 15:34:53 +01:00
<li><a href="#org9a6463e">1.1. Introduction</a></li>
2021-01-08 15:54:58 +01:00
<li><a href="#org2308492">1.2. Initialization</a></li>
<li><a href="#orgb5e88a6">1.3. Identification</a>
2020-02-28 17:35:44 +01:00
<ul>
2021-01-08 15:54:58 +01:00
<li><a href="#org7e602f6">1.3.1. HAC - Without LAC</a></li>
<li><a href="#org49dd47c">1.3.2. HAC - IFF</a></li>
<li><a href="#orgc4bf514">1.3.3. HAC - DVF</a></li>
2020-02-28 17:35:44 +01:00
</ul>
</li>
2021-01-08 15:34:53 +01:00
<li><a href="#org68ac3ce">1.4. Control Architecture</a></li>
<li><a href="#org668a952">1.5. 6x6 Plant Comparison</a></li>
2021-01-08 15:54:58 +01:00
<li><a href="#orgc2cdba3">1.6. HAC - DVF</a>
2020-02-28 17:35:44 +01:00
<ul>
2021-01-08 15:54:58 +01:00
<li><a href="#orgff953e4">1.6.1. Plant</a></li>
<li><a href="#orgbd635c1">1.6.2. Controller Design</a></li>
<li><a href="#org83c15a9">1.6.3. Obtained Performance</a></li>
2020-02-28 17:35:44 +01:00
</ul>
</li>
2021-01-08 15:54:58 +01:00
<li><a href="#org5dfa0fd">1.7. HAC - IFF</a>
2020-02-28 17:35:44 +01:00
<ul>
2021-01-08 15:54:58 +01:00
<li><a href="#orgeedcb6b">1.7.1. Plant</a></li>
<li><a href="#orgd723b75">1.7.2. Controller Design</a></li>
<li><a href="#org54813bf">1.7.3. Obtained Performance</a></li>
2020-01-22 16:31:44 +01:00
</ul>
</li>
2021-01-08 15:34:53 +01:00
<li><a href="#org8e15485">1.8. Comparison</a></li>
2020-02-28 17:35:44 +01:00
</ul>
</li>
2021-01-08 15:34:53 +01:00
<li><a href="#orgdc1bcf2">2. MIMO Analysis</a>
<ul>
2021-01-08 15:54:58 +01:00
<li><a href="#org7fd66be">2.1. Initialization</a></li>
<li><a href="#org06a70cd">2.2. Identification</a>
2020-02-28 17:35:44 +01:00
<ul>
2021-01-08 15:54:58 +01:00
<li><a href="#org88e17f4">2.2.1. HAC - Without LAC</a></li>
<li><a href="#orgb75c6b7">2.2.2. HAC - DVF</a></li>
2021-01-08 15:34:53 +01:00
<li><a href="#orgba8c7bf">2.2.3. Cartesian Frame</a></li>
2020-02-28 17:35:44 +01:00
</ul>
</li>
2021-01-08 15:34:53 +01:00
<li><a href="#orgf9d0420">2.3. Singular Value Decomposition</a></li>
2020-02-28 17:35:44 +01:00
</ul>
</li>
2021-01-08 15:34:53 +01:00
<li><a href="#orga095fa8">3. Diagonal Control based on the damped plant</a>
2020-02-28 17:35:44 +01:00
<ul>
2021-01-08 15:54:58 +01:00
<li><a href="#orge901603">3.1. Initialization</a></li>
<li><a href="#orgce73f0c">3.2. Identification</a></li>
2021-01-08 15:34:53 +01:00
<li><a href="#orgb5a063b">3.3. Steady State Decoupling</a>
2020-02-28 17:35:44 +01:00
<ul>
2021-01-08 15:34:53 +01:00
<li><a href="#orgd0ce552">3.3.1. Pre-Compensator Design</a></li>
<li><a href="#org41b76c6">3.3.2. Diagonal Control Design</a></li>
2021-01-08 15:54:58 +01:00
<li><a href="#org3228759">3.3.3. Results</a></li>
2020-02-28 17:35:44 +01:00
</ul>
</li>
2021-01-08 15:34:53 +01:00
<li><a href="#orgb53dd48">3.4. Decoupling at Crossover</a></li>
2020-02-28 17:35:44 +01:00
</ul>
</li>
2021-01-08 15:34:53 +01:00
<li><a href="#org639412c">4. Time Domain Simulation</a>
2020-02-28 17:35:44 +01:00
<ul>
2021-01-08 15:54:58 +01:00
<li><a href="#orgc332811">4.1. Initialization</a></li>
2021-01-08 15:34:53 +01:00
<li><a href="#orgc72e6b5">4.2. HAC IFF</a></li>
<li><a href="#org757f9e9">4.3. HAC-DVF</a></li>
2021-01-08 15:54:58 +01:00
<li><a href="#org620278d">4.4. Results</a></li>
2020-03-11 19:00:22 +01:00
</ul>
</li>
2021-01-08 15:34:53 +01:00
<li><a href="#org6a9c87c">5. Functions</a>
2020-03-11 19:00:22 +01:00
<ul>
2021-01-08 15:34:53 +01:00
<li><a href="#orgd1492e7">5.1. <code>initializeController</code>: Initialize the Controller</a>
<ul>
2021-01-08 15:34:53 +01:00
<li><a href="#orgae5eed0">Function description</a></li>
<li><a href="#orgda07b57">Optional Parameters</a></li>
<li><a href="#orgdb009ab">Structure initialization</a></li>
<li><a href="#org056c578">Add Type</a></li>
</ul>
</li>
</ul>
</li>
2020-01-22 16:31:44 +01:00
</ul>
</div>
</div>
2021-01-08 15:34:53 +01:00
<div id="outline-container-org4b4dce5" class="outline-2">
<h2 id="org4b4dce5"><span class="section-number-2">1</span> HAC-LAC (Cascade) Control - Integral Control</h2>
2020-02-11 15:50:52 +01:00
<div class="outline-text-2" id="text-1">
2020-01-22 16:31:44 +01:00
</div>
2021-01-08 15:34:53 +01:00
<div id="outline-container-org9a6463e" class="outline-3">
<h3 id="org9a6463e"><span class="section-number-3">1.1</span> Introduction</h3>
2020-02-11 15:50:52 +01:00
<div class="outline-text-3" id="text-1-1">
2020-02-28 17:35:44 +01:00
<p>
In this section, we wish to study the use of the High Authority Control - Low Authority Control (HAC-LAC) architecture on the Stewart platform.
</p>
<p>
2021-01-08 15:34:53 +01:00
The control architectures are shown in Figures <a href="#org000f34d">1</a> and <a href="#orgeaed076">2</a>.
2020-02-28 17:35:44 +01:00
</p>
2020-01-22 16:31:44 +01:00
2020-02-28 17:35:44 +01:00
<p>
First, the LAC loop is closed (the LAC control is described <a href="active-damping.html">here</a>), and then the HAC controller is designed and the outer loop is closed.
2020-01-22 16:31:44 +01:00
</p>
2020-02-28 17:35:44 +01:00
2021-01-08 15:34:53 +01:00
<div id="org000f34d" class="figure">
2020-02-28 17:35:44 +01:00
<p><img src="figs/control_arch_hac_iff.png" alt="control_arch_hac_iff.png" />
</p>
<p><span class="figure-number">Figure 1: </span>HAC-LAC architecture with IFF</p>
</div>
2021-01-08 15:34:53 +01:00
<div id="orgeaed076" class="figure">
2020-02-28 17:35:44 +01:00
<p><img src="figs/control_arch_hac_dvf.png" alt="control_arch_hac_dvf.png" />
</p>
<p><span class="figure-number">Figure 2: </span>HAC-LAC architecture with DVF</p>
2020-01-22 16:31:44 +01:00
</div>
</div>
</div>
2021-01-08 15:54:58 +01:00
<div id="outline-container-org2308492" class="outline-3">
<h3 id="org2308492"><span class="section-number-3">1.2</span> Initialization</h3>
2020-02-11 15:50:52 +01:00
<div class="outline-text-3" id="text-1-2">
2020-02-28 17:35:44 +01:00
<p>
We first initialize the Stewart platform.
</p>
2020-01-22 16:31:44 +01:00
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">stewart = initializeStewartPlatform();
stewart = initializeFramesPositions(stewart, <span class="org-string">'H'</span>, 90e<span class="org-type">-</span>3, <span class="org-string">'MO_B'</span>, 45e<span class="org-type">-</span>3);
stewart = generateGeneralConfiguration(stewart);
stewart = computeJointsPose(stewart);
stewart = initializeStrutDynamics(stewart);
stewart = initializeJointDynamics(stewart, <span class="org-string">'type_F'</span>, <span class="org-string">'universal'</span>, <span class="org-string">'type_M'</span>, <span class="org-string">'spherical'</span>);
stewart = initializeCylindricalPlatforms(stewart);
stewart = initializeCylindricalStruts(stewart);
stewart = computeJacobian(stewart);
stewart = initializeStewartPose(stewart);
stewart = initializeInertialSensor(stewart, <span class="org-string">'type'</span>, <span class="org-string">'none'</span>);
2020-02-13 14:51:49 +01:00
</pre>
</div>
2020-02-28 17:35:44 +01:00
<p>
The rotation point of the ground is located at the origin of frame \(\{A\}\).
</p>
2020-02-13 14:51:49 +01:00
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">ground = initializeGround(<span class="org-string">'type'</span>, <span class="org-string">'rigid'</span>, <span class="org-string">'rot_point'</span>, stewart.platform_F.FO_A);
payload = initializePayload(<span class="org-string">'type'</span>, <span class="org-string">'none'</span>);
2020-01-22 16:31:44 +01:00
</pre>
</div>
</div>
</div>
2021-01-08 15:54:58 +01:00
<div id="outline-container-orgb5e88a6" class="outline-3">
<h3 id="orgb5e88a6"><span class="section-number-3">1.3</span> Identification</h3>
2020-02-11 15:50:52 +01:00
<div class="outline-text-3" id="text-1-3">
2020-01-22 16:31:44 +01:00
<p>
2020-02-28 17:35:44 +01:00
We identify the transfer function from the actuator forces \(\bm{\tau}\) to the absolute displacement of the mobile platform \(\bm{\mathcal{X}}\) in three different cases:
2020-01-22 16:31:44 +01:00
</p>
2020-02-28 17:35:44 +01:00
<ul class="org-ul">
<li>Open Loop plant</li>
<li>Already damped plant using Integral Force Feedback</li>
<li>Already damped plant using Direct velocity feedback</li>
</ul>
</div>
2021-01-08 15:54:58 +01:00
<div id="outline-container-org7e602f6" class="outline-4">
<h4 id="org7e602f6"><span class="section-number-4">1.3.1</span> HAC - Without LAC</h4>
2020-02-28 17:35:44 +01:00
<div class="outline-text-4" id="text-1-3-1">
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">controller = initializeController(<span class="org-string">'type'</span>, <span class="org-string">'open-loop'</span>);
2020-02-28 17:35:44 +01:00
</pre>
</div>
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Name of the Simulink File</span></span>
mdl = <span class="org-string">'stewart_platform_model'</span>;
<span class="org-matlab-cellbreak"><span class="org-comment">%% Input/Output definition</span></span>
clear io; io_i = 1;
io(io_i) = linio([mdl, <span class="org-string">'/Controller'</span>], 1, <span class="org-string">'input'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Actuator Force Inputs [N]</span>
io(io_i) = linio([mdl, <span class="org-string">'/Absolute Motion Sensor'</span>], 1, <span class="org-string">'openoutput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Absolute Sensor [m, rad]</span>
<span class="org-matlab-cellbreak"><span class="org-comment">%% Run the linearization</span></span>
G_ol = linearize(mdl, io);
G_ol.InputName = {<span class="org-string">'F1'</span>, <span class="org-string">'F2'</span>, <span class="org-string">'F3'</span>, <span class="org-string">'F4'</span>, <span class="org-string">'F5'</span>, <span class="org-string">'F6'</span>};
G_ol.OutputName = {<span class="org-string">'Dx'</span>, <span class="org-string">'Dy'</span>, <span class="org-string">'Dz'</span>, <span class="org-string">'Rx'</span>, <span class="org-string">'Ry'</span>, <span class="org-string">'Rz'</span>};
2020-02-28 17:35:44 +01:00
</pre>
</div>
</div>
</div>
2021-01-08 15:54:58 +01:00
<div id="outline-container-org49dd47c" class="outline-4">
<h4 id="org49dd47c"><span class="section-number-4">1.3.2</span> HAC - IFF</h4>
2020-02-28 17:35:44 +01:00
<div class="outline-text-4" id="text-1-3-2">
2020-01-22 16:31:44 +01:00
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">controller = initializeController(<span class="org-string">'type'</span>, <span class="org-string">'iff'</span>);
K_iff = <span class="org-type">-</span>(1e4<span class="org-type">/</span>s)<span class="org-type">*</span>eye(6);
2020-02-28 17:35:44 +01:00
</pre>
</div>
2020-01-22 16:31:44 +01:00
2020-02-28 17:35:44 +01:00
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Name of the Simulink File</span></span>
mdl = <span class="org-string">'stewart_platform_model'</span>;
<span class="org-matlab-cellbreak"><span class="org-comment">%% Input/Output definition</span></span>
clear io; io_i = 1;
io(io_i) = linio([mdl, <span class="org-string">'/Controller'</span>], 1, <span class="org-string">'input'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Actuator Force Inputs [N]</span>
io(io_i) = linio([mdl, <span class="org-string">'/Absolute Motion Sensor'</span>], 1, <span class="org-string">'openoutput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Absolute Sensor [m, rad]</span>
<span class="org-matlab-cellbreak"><span class="org-comment">%% Run the linearization</span></span>
G_iff = linearize(mdl, io);
G_iff.InputName = {<span class="org-string">'F1'</span>, <span class="org-string">'F2'</span>, <span class="org-string">'F3'</span>, <span class="org-string">'F4'</span>, <span class="org-string">'F5'</span>, <span class="org-string">'F6'</span>};
G_iff.OutputName = {<span class="org-string">'Dx'</span>, <span class="org-string">'Dy'</span>, <span class="org-string">'Dz'</span>, <span class="org-string">'Rx'</span>, <span class="org-string">'Ry'</span>, <span class="org-string">'Rz'</span>};
2020-01-22 16:31:44 +01:00
</pre>
</div>
</div>
</div>
2021-01-08 15:54:58 +01:00
<div id="outline-container-orgc4bf514" class="outline-4">
<h4 id="orgc4bf514"><span class="section-number-4">1.3.3</span> HAC - DVF</h4>
2020-02-28 17:35:44 +01:00
<div class="outline-text-4" id="text-1-3-3">
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">controller = initializeController(<span class="org-string">'type'</span>, <span class="org-string">'dvf'</span>);
K_dvf = <span class="org-type">-</span>1e4<span class="org-type">*</span>s<span class="org-type">/</span>(1<span class="org-type">+</span>s<span class="org-type">/</span>2<span class="org-type">/</span><span class="org-constant">pi</span><span class="org-type">/</span>5000)<span class="org-type">*</span>eye(6);
2020-02-28 17:35:44 +01:00
</pre>
</div>
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Name of the Simulink File</span></span>
mdl = <span class="org-string">'stewart_platform_model'</span>;
<span class="org-matlab-cellbreak"><span class="org-comment">%% Input/Output definition</span></span>
clear io; io_i = 1;
io(io_i) = linio([mdl, <span class="org-string">'/Controller'</span>], 1, <span class="org-string">'input'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Actuator Force Inputs [N]</span>
io(io_i) = linio([mdl, <span class="org-string">'/Absolute Motion Sensor'</span>], 1, <span class="org-string">'openoutput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Absolute Sensor [m, rad]</span>
<span class="org-matlab-cellbreak"><span class="org-comment">%% Run the linearization</span></span>
G_dvf = linearize(mdl, io);
G_dvf.InputName = {<span class="org-string">'F1'</span>, <span class="org-string">'F2'</span>, <span class="org-string">'F3'</span>, <span class="org-string">'F4'</span>, <span class="org-string">'F5'</span>, <span class="org-string">'F6'</span>};
G_dvf.OutputName = {<span class="org-string">'Dx'</span>, <span class="org-string">'Dy'</span>, <span class="org-string">'Dz'</span>, <span class="org-string">'Rx'</span>, <span class="org-string">'Ry'</span>, <span class="org-string">'Rz'</span>};
2020-02-28 17:35:44 +01:00
</pre>
</div>
</div>
</div>
</div>
2021-01-08 15:34:53 +01:00
<div id="outline-container-org68ac3ce" class="outline-3">
<h3 id="org68ac3ce"><span class="section-number-3">1.4</span> Control Architecture</h3>
2020-02-11 15:50:52 +01:00
<div class="outline-text-3" id="text-1-4">
2020-01-22 16:31:44 +01:00
<p>
2020-02-28 17:35:44 +01:00
We use the Jacobian to express the actuator forces in the cartesian frame, and thus we obtain the transfer functions from \(\bm{\mathcal{F}}\) to \(\bm{\mathcal{X}}\).
</p>
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">Gc_ol = minreal(G_ol)<span class="org-type">/</span>stewart.kinematics.J<span class="org-type">'</span>;
Gc_ol.InputName = {<span class="org-string">'Fx'</span>, <span class="org-string">'Fy'</span>, <span class="org-string">'Fz'</span>, <span class="org-string">'Mx'</span>, <span class="org-string">'My'</span>, <span class="org-string">'Mz'</span>};
2020-02-28 17:35:44 +01:00
2021-01-08 15:54:58 +01:00
Gc_iff = minreal(G_iff)<span class="org-type">/</span>stewart.kinematics.J<span class="org-type">'</span>;
Gc_iff.InputName = {<span class="org-string">'Fx'</span>, <span class="org-string">'Fy'</span>, <span class="org-string">'Fz'</span>, <span class="org-string">'Mx'</span>, <span class="org-string">'My'</span>, <span class="org-string">'Mz'</span>};
2020-02-28 17:35:44 +01:00
2021-01-08 15:54:58 +01:00
Gc_dvf = minreal(G_dvf)<span class="org-type">/</span>stewart.kinematics.J<span class="org-type">'</span>;
Gc_dvf.InputName = {<span class="org-string">'Fx'</span>, <span class="org-string">'Fy'</span>, <span class="org-string">'Fz'</span>, <span class="org-string">'Mx'</span>, <span class="org-string">'My'</span>, <span class="org-string">'Mz'</span>};
2020-02-28 17:35:44 +01:00
</pre>
</div>
<p>
We then design a controller based on the transfer functions from \(\bm{\mathcal{F}}\) to \(\bm{\mathcal{X}}\), finally, we will pre-multiply the controller by \(\bm{J}^{-T}\).
2020-01-22 16:31:44 +01:00
</p>
</div>
</div>
2020-02-28 17:35:44 +01:00
2021-01-08 15:34:53 +01:00
<div id="outline-container-org668a952" class="outline-3">
<h3 id="org668a952"><span class="section-number-3">1.5</span> 6x6 Plant Comparison</h3>
2020-02-11 15:50:52 +01:00
<div class="outline-text-3" id="text-1-5">
2020-02-28 17:35:44 +01:00
2021-01-08 15:34:53 +01:00
<div id="orgcf3a190" class="figure">
2020-02-28 17:35:44 +01:00
<p><img src="figs/hac_lac_coupling_jacobian.png" alt="hac_lac_coupling_jacobian.png" />
</p>
<p><span class="figure-number">Figure 3: </span>Norm of the transfer functions from \(\bm{\mathcal{F}}\) to \(\bm{\mathcal{X}}\) (<a href="./figs/hac_lac_coupling_jacobian.png">png</a>, <a href="./figs/hac_lac_coupling_jacobian.pdf">pdf</a>)</p>
</div>
</div>
</div>
2021-01-08 15:54:58 +01:00
<div id="outline-container-orgc2cdba3" class="outline-3">
<h3 id="orgc2cdba3"><span class="section-number-3">1.6</span> HAC - DVF</h3>
2020-02-28 17:35:44 +01:00
<div class="outline-text-3" id="text-1-6">
</div>
2021-01-08 15:54:58 +01:00
<div id="outline-container-orgff953e4" class="outline-4">
<h4 id="orgff953e4"><span class="section-number-4">1.6.1</span> Plant</h4>
2020-02-28 17:35:44 +01:00
<div class="outline-text-4" id="text-1-6-1">
2021-01-08 15:34:53 +01:00
<div id="orgc08547a" class="figure">
2020-02-28 17:35:44 +01:00
<p><img src="figs/hac_lac_plant_dvf.png" alt="hac_lac_plant_dvf.png" />
</p>
<p><span class="figure-number">Figure 4: </span>Diagonal elements of the plant for HAC control when DVF is previously applied (<a href="./figs/hac_lac_plant_dvf.png">png</a>, <a href="./figs/hac_lac_plant_dvf.pdf">pdf</a>)</p>
</div>
</div>
</div>
2021-01-08 15:54:58 +01:00
<div id="outline-container-orgbd635c1" class="outline-4">
<h4 id="orgbd635c1"><span class="section-number-4">1.6.2</span> Controller Design</h4>
2020-02-28 17:35:44 +01:00
<div class="outline-text-4" id="text-1-6-2">
2020-01-22 16:31:44 +01:00
<p>
2020-02-28 17:35:44 +01:00
We design a diagonal controller with equal bandwidth for the 6 terms.
The controller is a pure integrator with a small lead near the crossover.
2020-01-22 16:31:44 +01:00
</p>
2020-02-28 17:35:44 +01:00
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">wc = 2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>300; <span class="org-comment">% Wanted Bandwidth [rad/s]</span>
2020-02-28 17:35:44 +01:00
2021-01-08 15:54:58 +01:00
h = 1.2;
H_lead = 1<span class="org-type">/</span>h<span class="org-type">*</span>(1 <span class="org-type">+</span> s<span class="org-type">/</span>(wc<span class="org-type">/</span>h))<span class="org-type">/</span>(1 <span class="org-type">+</span> s<span class="org-type">/</span>(wc<span class="org-type">*</span>h));
2020-02-28 17:35:44 +01:00
2021-01-08 15:54:58 +01:00
Kd_dvf = diag(1<span class="org-type">./</span>abs(diag(freqresp(1<span class="org-type">/</span>s<span class="org-type">*</span>Gc_dvf, wc)))) <span class="org-type">.*</span> H_lead <span class="org-type">.*</span> 1<span class="org-type">/</span>s;
2020-02-28 17:35:44 +01:00
</pre>
</div>
2021-01-08 15:34:53 +01:00
<div id="org8108913" class="figure">
2020-02-28 17:35:44 +01:00
<p><img src="figs/hac_lac_loop_gain_dvf.png" alt="hac_lac_loop_gain_dvf.png" />
</p>
<p><span class="figure-number">Figure 5: </span>Diagonal elements of the Loop Gain for the HAC control (<a href="./figs/hac_lac_loop_gain_dvf.png">png</a>, <a href="./figs/hac_lac_loop_gain_dvf.pdf">pdf</a>)</p>
</div>
<p>
Finally, we pre-multiply the diagonal controller by \(\bm{J}^{-T}\) prior implementation.
</p>
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">K_hac_dvf = inv(stewart.kinematics.J<span class="org-type">'</span>)<span class="org-type">*</span>Kd_dvf;
2020-02-28 17:35:44 +01:00
</pre>
</div>
</div>
</div>
2021-01-08 15:54:58 +01:00
<div id="outline-container-org83c15a9" class="outline-4">
<h4 id="org83c15a9"><span class="section-number-4">1.6.3</span> Obtained Performance</h4>
2020-02-28 17:35:44 +01:00
<div class="outline-text-4" id="text-1-6-3">
2020-01-22 16:31:44 +01:00
<p>
2020-02-28 17:35:44 +01:00
We identify the transmissibility and compliance of the system.
2020-01-22 16:31:44 +01:00
</p>
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">controller = initializeController(<span class="org-string">'type'</span>, <span class="org-string">'open-loop'</span>);
[T_ol, T_norm_ol, freqs] = computeTransmissibility();
[C_ol, C_norm_ol, <span class="org-type">~</span>] = computeCompliance();
2020-02-28 17:35:44 +01:00
</pre>
</div>
2020-01-22 16:31:44 +01:00
2020-02-28 17:35:44 +01:00
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">controller = initializeController(<span class="org-string">'type'</span>, <span class="org-string">'dvf'</span>);
[T_dvf, T_norm_dvf, <span class="org-type">~</span>] = computeTransmissibility();
[C_dvf, C_norm_dvf, <span class="org-type">~</span>] = computeCompliance();
2020-02-28 17:35:44 +01:00
</pre>
</div>
2020-01-22 16:31:44 +01:00
2020-02-28 17:35:44 +01:00
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">controller = initializeController(<span class="org-string">'type'</span>, <span class="org-string">'hac-dvf'</span>);
[T_hac_dvf, T_norm_hac_dvf, <span class="org-type">~</span>] = computeTransmissibility();
[C_hac_dvf, C_norm_hac_dvf, <span class="org-type">~</span>] = computeCompliance();
2020-01-22 16:31:44 +01:00
</pre>
</div>
2020-02-28 17:35:44 +01:00
2021-01-08 15:34:53 +01:00
<div id="orgf16f5f2" class="figure">
2020-02-28 17:35:44 +01:00
<p><img src="figs/hac_lac_C_T_dvf.png" alt="hac_lac_C_T_dvf.png" />
</p>
<p><span class="figure-number">Figure 6: </span>Obtained Compliance and Transmissibility (<a href="./figs/hac_lac_C_T_dvf.png">png</a>, <a href="./figs/hac_lac_C_T_dvf.pdf">pdf</a>)</p>
</div>
2020-01-22 16:31:44 +01:00
</div>
</div>
</div>
2021-01-08 15:54:58 +01:00
<div id="outline-container-org5dfa0fd" class="outline-3">
<h3 id="org5dfa0fd"><span class="section-number-3">1.7</span> HAC - IFF</h3>
2020-02-28 17:35:44 +01:00
<div class="outline-text-3" id="text-1-7">
</div>
2021-01-08 15:54:58 +01:00
<div id="outline-container-orgeedcb6b" class="outline-4">
<h4 id="orgeedcb6b"><span class="section-number-4">1.7.1</span> Plant</h4>
2020-02-28 17:35:44 +01:00
<div class="outline-text-4" id="text-1-7-1">
2021-01-08 15:34:53 +01:00
<div id="org66710a7" class="figure">
2020-02-28 17:35:44 +01:00
<p><img src="figs/hac_lac_plant_iff.png" alt="hac_lac_plant_iff.png" />
</p>
<p><span class="figure-number">Figure 7: </span>Diagonal elements of the plant for HAC control when IFF is previously applied (<a href="./figs/hac_lac_plant_iff.png">png</a>, <a href="./figs/hac_lac_plant_iff.pdf">pdf</a>)</p>
</div>
</div>
</div>
2021-01-08 15:54:58 +01:00
<div id="outline-container-orgd723b75" class="outline-4">
<h4 id="orgd723b75"><span class="section-number-4">1.7.2</span> Controller Design</h4>
2020-02-28 17:35:44 +01:00
<div class="outline-text-4" id="text-1-7-2">
<p>
We design a diagonal controller with equal bandwidth for the 6 terms.
The controller is a pure integrator with a small lead near the crossover.
</p>
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">wc = 2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>300; <span class="org-comment">% Wanted Bandwidth [rad/s]</span>
2020-02-28 17:35:44 +01:00
2021-01-08 15:54:58 +01:00
h = 1.2;
H_lead = 1<span class="org-type">/</span>h<span class="org-type">*</span>(1 <span class="org-type">+</span> s<span class="org-type">/</span>(wc<span class="org-type">/</span>h))<span class="org-type">/</span>(1 <span class="org-type">+</span> s<span class="org-type">/</span>(wc<span class="org-type">*</span>h));
2020-02-28 17:35:44 +01:00
2021-01-08 15:54:58 +01:00
Kd_iff = diag(1<span class="org-type">./</span>abs(diag(freqresp(1<span class="org-type">/</span>s<span class="org-type">*</span>Gc_iff, wc)))) <span class="org-type">.*</span> H_lead <span class="org-type">.*</span> 1<span class="org-type">/</span>s;
2020-02-28 17:35:44 +01:00
</pre>
</div>
2021-01-08 15:34:53 +01:00
<div id="org0b7f4f2" class="figure">
2020-02-28 17:35:44 +01:00
<p><img src="figs/hac_lac_loop_gain_iff.png" alt="hac_lac_loop_gain_iff.png" />
</p>
<p><span class="figure-number">Figure 8: </span>Diagonal elements of the Loop Gain for the HAC control (<a href="./figs/hac_lac_loop_gain_iff.png">png</a>, <a href="./figs/hac_lac_loop_gain_iff.pdf">pdf</a>)</p>
</div>
<p>
Finally, we pre-multiply the diagonal controller by \(\bm{J}^{-T}\) prior implementation.
</p>
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">K_hac_iff = inv(stewart.kinematics.J<span class="org-type">'</span>)<span class="org-type">*</span>Kd_iff;
2020-02-28 17:35:44 +01:00
</pre>
</div>
</div>
</div>
2021-01-08 15:54:58 +01:00
<div id="outline-container-org54813bf" class="outline-4">
<h4 id="org54813bf"><span class="section-number-4">1.7.3</span> Obtained Performance</h4>
2020-02-28 17:35:44 +01:00
<div class="outline-text-4" id="text-1-7-3">
<p>
We identify the transmissibility and compliance of the system.
</p>
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">controller = initializeController(<span class="org-string">'type'</span>, <span class="org-string">'open-loop'</span>);
[T_ol, T_norm_ol, freqs] = computeTransmissibility();
[C_ol, C_norm_ol, <span class="org-type">~</span>] = computeCompliance();
2020-02-28 17:35:44 +01:00
</pre>
</div>
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">controller = initializeController(<span class="org-string">'type'</span>, <span class="org-string">'iff'</span>);
[T_iff, T_norm_iff, <span class="org-type">~</span>] = computeTransmissibility();
[C_iff, C_norm_iff, <span class="org-type">~</span>] = computeCompliance();
2020-02-28 17:35:44 +01:00
</pre>
</div>
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">controller = initializeController(<span class="org-string">'type'</span>, <span class="org-string">'hac-iff'</span>);
[T_hac_iff, T_norm_hac_iff, <span class="org-type">~</span>] = computeTransmissibility();
[C_hac_iff, C_norm_hac_iff, <span class="org-type">~</span>] = computeCompliance();
2020-02-28 17:35:44 +01:00
</pre>
</div>
2021-01-08 15:34:53 +01:00
<div id="org6c57f46" class="figure">
2020-02-28 17:35:44 +01:00
<p><img src="figs/hac_lac_C_T_iff.png" alt="hac_lac_C_T_iff.png" />
</p>
<p><span class="figure-number">Figure 9: </span>Obtained Compliance and Transmissibility (<a href="./figs/hac_lac_C_T_iff.png">png</a>, <a href="./figs/hac_lac_C_T_iff.pdf">pdf</a>)</p>
</div>
</div>
</div>
</div>
2021-01-08 15:34:53 +01:00
<div id="outline-container-org8e15485" class="outline-3">
<h3 id="org8e15485"><span class="section-number-3">1.8</span> Comparison</h3>
2020-02-28 17:35:44 +01:00
<div class="outline-text-3" id="text-1-8">
2021-01-08 15:34:53 +01:00
<div id="org34035be" class="figure">
2020-02-28 17:35:44 +01:00
<p><img src="figs/hac_lac_C_full_comparison.png" alt="hac_lac_C_full_comparison.png" />
</p>
<p><span class="figure-number">Figure 10: </span>Comparison of the norm of the Compliance matrices for the HAC-LAC architecture (<a href="./figs/hac_lac_C_full_comparison.png">png</a>, <a href="./figs/hac_lac_C_full_comparison.pdf">pdf</a>)</p>
</div>
2021-01-08 15:34:53 +01:00
<div id="org6db2ceb" class="figure">
2020-02-28 17:35:44 +01:00
<p><img src="figs/hac_lac_T_full_comparison.png" alt="hac_lac_T_full_comparison.png" />
</p>
<p><span class="figure-number">Figure 11: </span>Comparison of the norm of the Transmissibility matrices for the HAC-LAC architecture (<a href="./figs/hac_lac_T_full_comparison.png">png</a>, <a href="./figs/hac_lac_T_full_comparison.pdf">pdf</a>)</p>
</div>
2021-01-08 15:34:53 +01:00
<div id="orga195621" class="figure">
2020-02-28 17:35:44 +01:00
<p><img src="figs/hac_lac_C_T_comparison.png" alt="hac_lac_C_T_comparison.png" />
</p>
<p><span class="figure-number">Figure 12: </span>Comparison of the Frobenius norm of the Compliance and Transmissibility for the HAC-LAC architecture with both IFF and DVF (<a href="./figs/hac_lac_C_T_comparison.png">png</a>, <a href="./figs/hac_lac_C_T_comparison.pdf">pdf</a>)</p>
</div>
</div>
</div>
</div>
2021-01-08 15:34:53 +01:00
<div id="outline-container-orgdc1bcf2" class="outline-2">
<h2 id="orgdc1bcf2"><span class="section-number-2">2</span> MIMO Analysis</h2>
<div class="outline-text-2" id="text-2">
2020-02-28 17:35:44 +01:00
<p>
2021-01-08 15:34:53 +01:00
Let&rsquo;s define the system as shown in figure <a href="#org6f95566">13</a>.
2020-02-28 17:35:44 +01:00
</p>
2021-01-08 15:34:53 +01:00
<div id="org6f95566" class="figure">
2020-02-28 17:35:44 +01:00
<p><img src="figs/general_control_names.png" alt="general_control_names.png" />
</p>
<p><span class="figure-number">Figure 13: </span>General Control Architecture</p>
</div>
2020-02-28 17:35:44 +01:00
2021-01-08 15:34:53 +01:00
<table id="org8568d41" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
2020-02-28 17:35:44 +01:00
<caption class="t-above"><span class="table-number">Table 1:</span> Signals definition for the generalized plant</caption>
<colgroup>
<col class="org-left" />
<col class="org-left" />
<col class="org-left" />
</colgroup>
<thead>
<tr>
2020-03-11 19:00:22 +01:00
<th scope="col" class="org-left">&#xa0;</th>
<th scope="col" class="org-left"><b>Symbol</b></th>
<th scope="col" class="org-left"><b>Meaning</b></th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left"><b>Exogenous Inputs</b></td>
<td class="org-left">\(\bm{\mathcal{X}}_w\)</td>
<td class="org-left">Ground motion</td>
2020-02-28 17:35:44 +01:00
</tr>
<tr>
2020-03-11 19:00:22 +01:00
<td class="org-left">&#xa0;</td>
<td class="org-left">\(\bm{\mathcal{F}}_d\)</td>
<td class="org-left">External Forces applied to the Payload</td>
2020-02-28 17:35:44 +01:00
</tr>
<tr>
2020-03-11 19:00:22 +01:00
<td class="org-left">&#xa0;</td>
<td class="org-left">\(\bm{r}\)</td>
<td class="org-left">Reference signal for tracking</td>
2020-02-28 17:35:44 +01:00
</tr>
2020-03-11 19:00:22 +01:00
</tbody>
2020-02-28 17:35:44 +01:00
<tbody>
<tr>
<td class="org-left"><b>Exogenous Outputs</b></td>
<td class="org-left">\(\bm{\mathcal{X}}\)</td>
<td class="org-left">Absolute Motion of the Payload</td>
</tr>
<tr>
<td class="org-left">&#xa0;</td>
<td class="org-left">\(\bm{\tau}\)</td>
<td class="org-left">Actuator Rate</td>
</tr>
</tbody>
<tbody>
<tr>
<td class="org-left"><b>Sensed Outputs</b></td>
<td class="org-left">\(\bm{\tau}_m\)</td>
<td class="org-left">Force Sensors in each leg</td>
</tr>
<tr>
<td class="org-left">&#xa0;</td>
<td class="org-left">\(\delta \bm{\mathcal{L}}_m\)</td>
<td class="org-left">Measured displacement of each leg</td>
</tr>
<tr>
<td class="org-left">&#xa0;</td>
<td class="org-left">\(\bm{\mathcal{X}}\)</td>
<td class="org-left">Absolute Motion of the Payload</td>
</tr>
</tbody>
<tbody>
<tr>
<td class="org-left"><b>Control Signals</b></td>
<td class="org-left">\(\bm{\tau}\)</td>
<td class="org-left">Actuator Inputs</td>
</tr>
</tbody>
</table>
</div>
2021-01-08 15:54:58 +01:00
<div id="outline-container-org7fd66be" class="outline-3">
<h3 id="org7fd66be"><span class="section-number-3">2.1</span> Initialization</h3>
<div class="outline-text-3" id="text-2-1">
<p>
2020-02-28 17:35:44 +01:00
We first initialize the Stewart platform.
</p>
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">stewart = initializeStewartPlatform();
stewart = initializeFramesPositions(stewart, <span class="org-string">'H'</span>, 90e<span class="org-type">-</span>3, <span class="org-string">'MO_B'</span>, 45e<span class="org-type">-</span>3);
stewart = generateGeneralConfiguration(stewart);
stewart = computeJointsPose(stewart);
stewart = initializeStrutDynamics(stewart);
stewart = initializeJointDynamics(stewart, <span class="org-string">'type_F'</span>, <span class="org-string">'universal'</span>, <span class="org-string">'type_M'</span>, <span class="org-string">'spherical'</span>);
stewart = initializeCylindricalPlatforms(stewart);
stewart = initializeCylindricalStruts(stewart);
stewart = computeJacobian(stewart);
stewart = initializeStewartPose(stewart);
stewart = initializeInertialSensor(stewart, <span class="org-string">'type'</span>, <span class="org-string">'none'</span>);
2020-02-28 17:35:44 +01:00
</pre>
</div>
<p>
The rotation point of the ground is located at the origin of frame \(\{A\}\).
</p>
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">ground = initializeGround(<span class="org-string">'type'</span>, <span class="org-string">'rigid'</span>, <span class="org-string">'rot_point'</span>, stewart.platform_F.FO_A);
payload = initializePayload(<span class="org-string">'type'</span>, <span class="org-string">'none'</span>);
2020-02-28 17:35:44 +01:00
</pre>
</div>
</div>
</div>
2021-01-08 15:54:58 +01:00
<div id="outline-container-org06a70cd" class="outline-3">
<h3 id="org06a70cd"><span class="section-number-3">2.2</span> Identification</h3>
2020-02-28 17:35:44 +01:00
<div class="outline-text-3" id="text-2-2">
</div>
2021-01-08 15:54:58 +01:00
<div id="outline-container-org88e17f4" class="outline-4">
<h4 id="org88e17f4"><span class="section-number-4">2.2.1</span> HAC - Without LAC</h4>
2020-02-28 17:35:44 +01:00
<div class="outline-text-4" id="text-2-2-1">
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">controller = initializeController(<span class="org-string">'type'</span>, <span class="org-string">'open-loop'</span>);
2020-02-28 17:35:44 +01:00
</pre>
</div>
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Name of the Simulink File</span></span>
mdl = <span class="org-string">'stewart_platform_model'</span>;
<span class="org-matlab-cellbreak"><span class="org-comment">%% Input/Output definition</span></span>
clear io; io_i = 1;
io(io_i) = linio([mdl, <span class="org-string">'/Controller'</span>], 1, <span class="org-string">'input'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Actuator Force Inputs [N]</span>
io(io_i) = linio([mdl, <span class="org-string">'/Absolute Motion Sensor'</span>], 1, <span class="org-string">'openoutput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Absolute Sensor [m, rad]</span>
<span class="org-matlab-cellbreak"><span class="org-comment">%% Run the linearization</span></span>
G_ol = linearize(mdl, io);
G_ol.InputName = {<span class="org-string">'F1'</span>, <span class="org-string">'F2'</span>, <span class="org-string">'F3'</span>, <span class="org-string">'F4'</span>, <span class="org-string">'F5'</span>, <span class="org-string">'F6'</span>};
G_ol.OutputName = {<span class="org-string">'Dx'</span>, <span class="org-string">'Dy'</span>, <span class="org-string">'Dz'</span>, <span class="org-string">'Rx'</span>, <span class="org-string">'Ry'</span>, <span class="org-string">'Rz'</span>};
2020-02-28 17:35:44 +01:00
</pre>
</div>
</div>
</div>
2021-01-08 15:54:58 +01:00
<div id="outline-container-orgb75c6b7" class="outline-4">
<h4 id="orgb75c6b7"><span class="section-number-4">2.2.2</span> HAC - DVF</h4>
2020-02-28 17:35:44 +01:00
<div class="outline-text-4" id="text-2-2-2">
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">controller = initializeController(<span class="org-string">'type'</span>, <span class="org-string">'dvf'</span>);
K_dvf = <span class="org-type">-</span>1e4<span class="org-type">*</span>s<span class="org-type">/</span>(1<span class="org-type">+</span>s<span class="org-type">/</span>2<span class="org-type">/</span><span class="org-constant">pi</span><span class="org-type">/</span>5000)<span class="org-type">*</span>eye(6);
2020-02-28 17:35:44 +01:00
</pre>
</div>
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Name of the Simulink File</span></span>
mdl = <span class="org-string">'stewart_platform_model'</span>;
<span class="org-matlab-cellbreak"><span class="org-comment">%% Input/Output definition</span></span>
clear io; io_i = 1;
io(io_i) = linio([mdl, <span class="org-string">'/Controller'</span>], 1, <span class="org-string">'input'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Actuator Force Inputs [N]</span>
io(io_i) = linio([mdl, <span class="org-string">'/Absolute Motion Sensor'</span>], 1, <span class="org-string">'openoutput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Absolute Sensor [m, rad]</span>
<span class="org-matlab-cellbreak"><span class="org-comment">%% Run the linearization</span></span>
G_dvf = linearize(mdl, io);
G_dvf.InputName = {<span class="org-string">'F1'</span>, <span class="org-string">'F2'</span>, <span class="org-string">'F3'</span>, <span class="org-string">'F4'</span>, <span class="org-string">'F5'</span>, <span class="org-string">'F6'</span>};
G_dvf.OutputName = {<span class="org-string">'Dx'</span>, <span class="org-string">'Dy'</span>, <span class="org-string">'Dz'</span>, <span class="org-string">'Rx'</span>, <span class="org-string">'Ry'</span>, <span class="org-string">'Rz'</span>};
2020-02-28 17:35:44 +01:00
</pre>
</div>
</div>
</div>
2021-01-08 15:34:53 +01:00
<div id="outline-container-orgba8c7bf" class="outline-4">
<h4 id="orgba8c7bf"><span class="section-number-4">2.2.3</span> Cartesian Frame</h4>
2020-02-28 17:35:44 +01:00
<div class="outline-text-4" id="text-2-2-3">
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">Gc_ol = minreal(G_ol)<span class="org-type">/</span>stewart.kinematics.J<span class="org-type">'</span>;
Gc_ol.InputName = {<span class="org-string">'Fx'</span>, <span class="org-string">'Fy'</span>, <span class="org-string">'Fz'</span>, <span class="org-string">'Mx'</span>, <span class="org-string">'My'</span>, <span class="org-string">'Mz'</span>};
2020-02-28 17:35:44 +01:00
2021-01-08 15:54:58 +01:00
Gc_dvf = minreal(G_dvf)<span class="org-type">/</span>stewart.kinematics.J<span class="org-type">'</span>;
Gc_dvf.InputName = {<span class="org-string">'Fx'</span>, <span class="org-string">'Fy'</span>, <span class="org-string">'Fz'</span>, <span class="org-string">'Mx'</span>, <span class="org-string">'My'</span>, <span class="org-string">'Mz'</span>};
2020-02-28 17:35:44 +01:00
</pre>
</div>
</div>
</div>
</div>
2021-01-08 15:34:53 +01:00
<div id="outline-container-orgf9d0420" class="outline-3">
<h3 id="orgf9d0420"><span class="section-number-3">2.3</span> Singular Value Decomposition</h3>
2020-02-28 17:35:44 +01:00
<div class="outline-text-3" id="text-2-3">
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">freqs = logspace(1, 4, 1000);
2021-01-08 15:34:53 +01:00
2021-01-08 15:54:58 +01:00
U_ol = zeros(6,6,length(freqs));
S_ol = zeros(6,length(freqs));
V_ol = zeros(6,6,length(freqs));
2021-01-08 15:34:53 +01:00
2021-01-08 15:54:58 +01:00
U_dvf = zeros(6,6,length(freqs));
S_dvf = zeros(6,length(freqs));
V_dvf = zeros(6,6,length(freqs));
2021-01-08 15:34:53 +01:00
2021-01-08 15:54:58 +01:00
<span class="org-keyword">for</span> <span class="org-variable-name"><span class="org-constant">i</span></span> = <span class="org-constant">1:length(freqs)</span>
2021-01-08 15:34:53 +01:00
[U,S,V] = svd(freqresp(Gc_ol, freqs(<span class="org-constant">i</span>), <span class="org-string">'Hz'</span>));
U_ol(<span class="org-type">:</span>,<span class="org-type">:</span>,<span class="org-constant">i</span>) = U;
S_ol(<span class="org-type">:</span>,<span class="org-constant">i</span>) = diag(S);
V_ol(<span class="org-type">:</span>,<span class="org-type">:</span>,<span class="org-constant">i</span>) = V;
[U,S,V] = svd(freqresp(Gc_dvf, freqs(<span class="org-constant">i</span>), <span class="org-string">'Hz'</span>));
U_dvf(<span class="org-type">:</span>,<span class="org-type">:</span>,<span class="org-constant">i</span>) = U;
S_dvf(<span class="org-type">:</span>,<span class="org-constant">i</span>) = diag(S);
V_dvf(<span class="org-type">:</span>,<span class="org-type">:</span>,<span class="org-constant">i</span>) = V;
2021-01-08 15:54:58 +01:00
<span class="org-keyword">end</span>
2020-02-28 17:35:44 +01:00
</pre>
</div>
</div>
</div>
</div>
2021-01-08 15:34:53 +01:00
<div id="outline-container-orga095fa8" class="outline-2">
<h2 id="orga095fa8"><span class="section-number-2">3</span> Diagonal Control based on the damped plant</h2>
2020-02-28 17:35:44 +01:00
<div class="outline-text-2" id="text-3">
<p>
2020-08-05 13:28:14 +02:00
From (<a href="#citeproc_bib_item_1">Skogestad and Postlethwaite 2007</a>), a simple approach to multivariable control is the following two-step procedure:
2020-02-28 17:35:44 +01:00
</p>
<ol class="org-ol">
<li><b>Design a pre-compensator</b> \(W_1\), which counteracts the interactions in the plant and results in a new <b>shaped plant</b> \(G_S(s) = G(s) W_1(s)\) which is <b>more diagonal and easier to control</b> than the original plant \(G(s)\).</li>
<li><b>Design a diagonal controller</b> \(K_S(s)\) for the shaped plant using methods similar to those for SISO systems.</li>
</ol>
<p>
The overall controller is then:
\[ K(s) = W_1(s)K_s(s) \]
</p>
<p>
There are mainly three different cases:
</p>
<ol class="org-ol">
<li><b>Dynamic decoupling</b>: \(G_S(s)\) is diagonal at all frequencies. For that we can choose \(W_1(s) = G^{-1}(s)\) and this is an inverse-based controller.</li>
<li><b>Steady-state decoupling</b>: \(G_S(0)\) is diagonal. This can be obtained by selecting \(W_1(s) = G^{-1}(0)\).</li>
<li><b>Approximate decoupling at frequency \(\w_0\)</b>: \(G_S(j\w_0)\) is as diagonal as possible. Decoupling the system at \(\w_0\) is a good choice because the effect on performance of reducing interaction is normally greatest at this frequency.</li>
</ol>
</div>
2021-01-08 15:54:58 +01:00
<div id="outline-container-orge901603" class="outline-3">
<h3 id="orge901603"><span class="section-number-3">3.1</span> Initialization</h3>
2020-02-28 17:35:44 +01:00
<div class="outline-text-3" id="text-3-1">
<p>
We first initialize the Stewart platform.
</p>
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">stewart = initializeStewartPlatform();
stewart = initializeFramesPositions(stewart, <span class="org-string">'H'</span>, 90e<span class="org-type">-</span>3, <span class="org-string">'MO_B'</span>, 45e<span class="org-type">-</span>3);
stewart = generateGeneralConfiguration(stewart);
stewart = computeJointsPose(stewart);
stewart = initializeStrutDynamics(stewart);
stewart = initializeJointDynamics(stewart, <span class="org-string">'type_F'</span>, <span class="org-string">'universal'</span>, <span class="org-string">'type_M'</span>, <span class="org-string">'spherical'</span>);
stewart = initializeCylindricalPlatforms(stewart);
stewart = initializeCylindricalStruts(stewart);
stewart = computeJacobian(stewart);
stewart = initializeStewartPose(stewart);
stewart = initializeInertialSensor(stewart, <span class="org-string">'type'</span>, <span class="org-string">'none'</span>);
2020-02-28 17:35:44 +01:00
</pre>
</div>
<p>
The rotation point of the ground is located at the origin of frame \(\{A\}\).
</p>
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">ground = initializeGround(<span class="org-string">'type'</span>, <span class="org-string">'rigid'</span>, <span class="org-string">'rot_point'</span>, stewart.platform_F.FO_A);
payload = initializePayload(<span class="org-string">'type'</span>, <span class="org-string">'none'</span>);
2020-02-28 17:35:44 +01:00
</pre>
</div>
</div>
</div>
2021-01-08 15:54:58 +01:00
<div id="outline-container-orgce73f0c" class="outline-3">
<h3 id="orgce73f0c"><span class="section-number-3">3.2</span> Identification</h3>
2020-02-28 17:35:44 +01:00
<div class="outline-text-3" id="text-3-2">
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">controller = initializeController(<span class="org-string">'type'</span>, <span class="org-string">'dvf'</span>);
K_dvf = <span class="org-type">-</span>1e4<span class="org-type">*</span>s<span class="org-type">/</span>(1<span class="org-type">+</span>s<span class="org-type">/</span>2<span class="org-type">/</span><span class="org-constant">pi</span><span class="org-type">/</span>5000)<span class="org-type">*</span>eye(6);
2020-02-28 17:35:44 +01:00
</pre>
</div>
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab"><span class="org-matlab-cellbreak"><span class="org-comment">%% Name of the Simulink File</span></span>
mdl = <span class="org-string">'stewart_platform_model'</span>;
<span class="org-matlab-cellbreak"><span class="org-comment">%% Input/Output definition</span></span>
clear io; io_i = 1;
io(io_i) = linio([mdl, <span class="org-string">'/Controller'</span>], 1, <span class="org-string">'input'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Actuator Force Inputs [N]</span>
io(io_i) = linio([mdl, <span class="org-string">'/Absolute Motion Sensor'</span>], 1, <span class="org-string">'openoutput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Absolute Sensor [m, rad]</span>
<span class="org-matlab-cellbreak"><span class="org-comment">%% Run the linearization</span></span>
G_dvf = linearize(mdl, io);
G_dvf.InputName = {<span class="org-string">'F1'</span>, <span class="org-string">'F2'</span>, <span class="org-string">'F3'</span>, <span class="org-string">'F4'</span>, <span class="org-string">'F5'</span>, <span class="org-string">'F6'</span>};
G_dvf.OutputName = {<span class="org-string">'Dx'</span>, <span class="org-string">'Dy'</span>, <span class="org-string">'Dz'</span>, <span class="org-string">'Rx'</span>, <span class="org-string">'Ry'</span>, <span class="org-string">'Rz'</span>};
2020-02-28 17:35:44 +01:00
</pre>
</div>
</div>
</div>
2021-01-08 15:34:53 +01:00
<div id="outline-container-orgb5a063b" class="outline-3">
<h3 id="orgb5a063b"><span class="section-number-3">3.3</span> Steady State Decoupling</h3>
2020-02-28 17:35:44 +01:00
<div class="outline-text-3" id="text-3-3">
</div>
2021-01-08 15:34:53 +01:00
<div id="outline-container-orgd0ce552" class="outline-4">
<h4 id="orgd0ce552"><span class="section-number-4">3.3.1</span> Pre-Compensator Design</h4>
2020-02-28 17:35:44 +01:00
<div class="outline-text-4" id="text-3-3-1">
<p>
We choose \(W_1 = G^{-1}(0)\).
</p>
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">W1 = inv(freqresp(G_dvf, 0));
2020-02-28 17:35:44 +01:00
</pre>
</div>
<p>
The (static) decoupled plant is \(G_s(s) = G(s) W_1\).
</p>
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">Gs = G_dvf<span class="org-type">*</span>W1;
2020-02-28 17:35:44 +01:00
</pre>
</div>
<p>
In the case of the Stewart platform, the pre-compensator for static decoupling is equal to \(\mathcal{K} \bm{J}\):
</p>
\begin{align*}
W_1 &= \left( \frac{\bm{\mathcal{X}}}{\bm{\tau}}(s=0) \right)^{-1}\\
&= \left( \frac{\bm{\mathcal{X}}}{\bm{\tau}}(s=0) \bm{J}^T \right)^{-1}\\
&= \left( \bm{C} \bm{J}^T \right)^{-1}\\
&= \left( \bm{J}^{-1} \mathcal{K}^{-1} \right)^{-1}\\
&= \mathcal{K} \bm{J}
\end{align*}
<p>
2021-01-08 15:34:53 +01:00
The static decoupled plant is schematic shown in Figure <a href="#org6f0c40d">14</a> and the bode plots of its diagonal elements are shown in Figure <a href="#orgd6f1b1d">15</a>.
2020-02-28 17:35:44 +01:00
</p>
2021-01-08 15:34:53 +01:00
<div id="org6f0c40d" class="figure">
2020-02-28 17:35:44 +01:00
<p><img src="figs/control_arch_static_decoupling.png" alt="control_arch_static_decoupling.png" />
</p>
<p><span class="figure-number">Figure 14: </span>Static Decoupling of the Stewart platform</p>
</div>
2021-01-08 15:34:53 +01:00
<div id="orgd6f1b1d" class="figure">
2020-02-28 17:35:44 +01:00
<p><img src="figs/static_decoupling_diagonal_plant.png" alt="static_decoupling_diagonal_plant.png" />
</p>
<p><span class="figure-number">Figure 15: </span>Bode plot of the diagonal elements of \(G_s(s)\) (<a href="./figs/static_decoupling_diagonal_plant.png">png</a>, <a href="./figs/static_decoupling_diagonal_plant.pdf">pdf</a>)</p>
</div>
</div>
</div>
2021-01-08 15:34:53 +01:00
<div id="outline-container-org41b76c6" class="outline-4">
<h4 id="org41b76c6"><span class="section-number-4">3.3.2</span> Diagonal Control Design</h4>
2020-02-28 17:35:44 +01:00
<div class="outline-text-4" id="text-3-3-2">
<p>
We design a diagonal controller \(K_s(s)\) that consist of a pure integrator and a lead around the crossover.
</p>
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">wc = 2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>300; <span class="org-comment">% Wanted Bandwidth [rad/s]</span>
2020-02-28 17:35:44 +01:00
2021-01-08 15:54:58 +01:00
h = 1.5;
H_lead = 1<span class="org-type">/</span>h<span class="org-type">*</span>(1 <span class="org-type">+</span> s<span class="org-type">/</span>(wc<span class="org-type">/</span>h))<span class="org-type">/</span>(1 <span class="org-type">+</span> s<span class="org-type">/</span>(wc<span class="org-type">*</span>h));
2020-02-28 17:35:44 +01:00
2021-01-08 15:54:58 +01:00
Ks_dvf = diag(1<span class="org-type">./</span>abs(diag(freqresp(1<span class="org-type">/</span>s<span class="org-type">*</span>Gs, wc)))) <span class="org-type">.*</span> H_lead <span class="org-type">.*</span> 1<span class="org-type">/</span>s;
2020-02-28 17:35:44 +01:00
</pre>
</div>
<p>
2021-01-08 15:34:53 +01:00
The overall controller is then \(K(s) = W_1 K_s(s)\) as shown in Figure <a href="#org2d2d9e8">16</a>.
2020-02-28 17:35:44 +01:00
</p>
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">K_hac_dvf = W1 <span class="org-type">*</span> Ks_dvf;
2020-02-28 17:35:44 +01:00
</pre>
</div>
2021-01-08 15:34:53 +01:00
<div id="org2d2d9e8" class="figure">
2020-02-28 17:35:44 +01:00
<p><img src="figs/control_arch_static_decoupling_K.png" alt="control_arch_static_decoupling_K.png" />
</p>
<p><span class="figure-number">Figure 16: </span>Controller including the static decoupling matrix</p>
</div>
</div>
</div>
2021-01-08 15:54:58 +01:00
<div id="outline-container-org3228759" class="outline-4">
<h4 id="org3228759"><span class="section-number-4">3.3.3</span> Results</h4>
2020-02-28 17:35:44 +01:00
<div class="outline-text-4" id="text-3-3-3">
<p>
We identify the transmissibility and compliance of the Stewart platform under open-loop and closed-loop control.
</p>
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">controller = initializeController(<span class="org-string">'type'</span>, <span class="org-string">'open-loop'</span>);
[T_ol, T_norm_ol, freqs] = computeTransmissibility();
[C_ol, C_norm_ol, <span class="org-type">~</span>] = computeCompliance();
2020-02-28 17:35:44 +01:00
</pre>
</div>
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">controller = initializeController(<span class="org-string">'type'</span>, <span class="org-string">'hac-dvf'</span>);
[T_hac_dvf, T_norm_hac_dvf, <span class="org-type">~</span>] = computeTransmissibility();
[C_hac_dvf, C_norm_hac_dvf, <span class="org-type">~</span>] = computeCompliance();
2020-02-28 17:35:44 +01:00
</pre>
</div>
<p>
The results are shown in figure
</p>
2021-01-08 15:34:53 +01:00
<div id="orgb6c4828" class="figure">
2020-02-28 17:35:44 +01:00
<p><img src="figs/static_decoupling_C_T_frobenius_norm.png" alt="static_decoupling_C_T_frobenius_norm.png" />
</p>
<p><span class="figure-number">Figure 17: </span>Frobenius norm of the Compliance and transmissibility matrices (<a href="./figs/static_decoupling_C_T_frobenius_norm.png">png</a>, <a href="./figs/static_decoupling_C_T_frobenius_norm.pdf">pdf</a>)</p>
</div>
</div>
</div>
</div>
2021-01-08 15:34:53 +01:00
<div id="outline-container-orgb53dd48" class="outline-3">
<h3 id="orgb53dd48"><span class="section-number-3">3.4</span> Decoupling at Crossover</h3>
2020-02-28 17:35:44 +01:00
<div class="outline-text-3" id="text-3-4">
<ul class="org-ul">
<li class="off"><code>[&#xa0;]</code> Find a method for real approximation of a complex matrix</li>
</ul>
</div>
</div>
</div>
2021-01-08 15:34:53 +01:00
<div id="outline-container-org639412c" class="outline-2">
<h2 id="org639412c"><span class="section-number-2">4</span> Time Domain Simulation</h2>
2020-02-28 17:35:44 +01:00
<div class="outline-text-2" id="text-4">
</div>
2021-01-08 15:54:58 +01:00
<div id="outline-container-orgc332811" class="outline-3">
<h3 id="orgc332811"><span class="section-number-3">4.1</span> Initialization</h3>
2020-02-28 17:35:44 +01:00
<div class="outline-text-3" id="text-4-1">
<p>
2020-03-11 19:00:22 +01:00
We first initialize the Stewart platform.
</p>
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">stewart = initializeStewartPlatform();
stewart = initializeFramesPositions(stewart, <span class="org-string">'H'</span>, 90e<span class="org-type">-</span>3, <span class="org-string">'MO_B'</span>, 45e<span class="org-type">-</span>3);
stewart = generateGeneralConfiguration(stewart);
stewart = computeJointsPose(stewart);
stewart = initializeStrutDynamics(stewart);
stewart = initializeJointDynamics(stewart, <span class="org-string">'type_F'</span>, <span class="org-string">'universal'</span>, <span class="org-string">'type_M'</span>, <span class="org-string">'spherical'</span>);
stewart = initializeCylindricalPlatforms(stewart);
stewart = initializeCylindricalStruts(stewart);
stewart = computeJacobian(stewart);
stewart = initializeStewartPose(stewart);
stewart = initializeInertialSensor(stewart, <span class="org-string">'type'</span>, <span class="org-string">'none'</span>);
2020-03-11 19:00:22 +01:00
</pre>
</div>
<p>
The rotation point of the ground is located at the origin of frame \(\{A\}\).
</p>
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">ground = initializeGround(<span class="org-string">'type'</span>, <span class="org-string">'rigid'</span>, <span class="org-string">'rot_point'</span>, stewart.platform_F.FO_A);
payload = initializePayload(<span class="org-string">'type'</span>, <span class="org-string">'none'</span>);
2020-03-11 19:00:22 +01:00
</pre>
</div>
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">load(<span class="org-string">'./mat/motion_error_ol.mat'</span>, <span class="org-string">'Eg'</span>)
2020-03-11 19:00:22 +01:00
</pre>
</div>
</div>
</div>
2021-01-08 15:34:53 +01:00
<div id="outline-container-orgc72e6b5" class="outline-3">
<h3 id="orgc72e6b5"><span class="section-number-3">4.2</span> HAC IFF</h3>
2020-03-11 19:00:22 +01:00
<div class="outline-text-3" id="text-4-2">
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">controller = initializeController(<span class="org-string">'type'</span>, <span class="org-string">'iff'</span>);
K_iff = <span class="org-type">-</span>(1e4<span class="org-type">/</span>s)<span class="org-type">*</span>eye(6);
2020-03-11 19:00:22 +01:00
2021-01-08 15:54:58 +01:00
<span class="org-matlab-cellbreak"><span class="org-comment">%% Name of the Simulink File</span></span>
mdl = <span class="org-string">'stewart_platform_model'</span>;
2020-03-11 19:00:22 +01:00
2021-01-08 15:54:58 +01:00
<span class="org-matlab-cellbreak"><span class="org-comment">%% Input/Output definition</span></span>
clear io; io_i = 1;
io(io_i) = linio([mdl, <span class="org-string">'/Controller'</span>], 1, <span class="org-string">'input'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Actuator Force Inputs [N]</span>
io(io_i) = linio([mdl, <span class="org-string">'/Absolute Motion Sensor'</span>], 1, <span class="org-string">'openoutput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Absolute Sensor [m, rad]</span>
2020-03-11 19:00:22 +01:00
2021-01-08 15:54:58 +01:00
<span class="org-matlab-cellbreak"><span class="org-comment">%% Run the linearization</span></span>
G_iff = linearize(mdl, io);
G_iff.InputName = {<span class="org-string">'F1'</span>, <span class="org-string">'F2'</span>, <span class="org-string">'F3'</span>, <span class="org-string">'F4'</span>, <span class="org-string">'F5'</span>, <span class="org-string">'F6'</span>};
G_iff.OutputName = {<span class="org-string">'Dx'</span>, <span class="org-string">'Dy'</span>, <span class="org-string">'Dz'</span>, <span class="org-string">'Rx'</span>, <span class="org-string">'Ry'</span>, <span class="org-string">'Rz'</span>};
2020-03-11 19:00:22 +01:00
2021-01-08 15:54:58 +01:00
Gc_iff = minreal(G_iff)<span class="org-type">/</span>stewart.kinematics.J<span class="org-type">'</span>;
Gc_iff.InputName = {<span class="org-string">'Fx'</span>, <span class="org-string">'Fy'</span>, <span class="org-string">'Fz'</span>, <span class="org-string">'Mx'</span>, <span class="org-string">'My'</span>, <span class="org-string">'Mz'</span>};
2020-03-11 19:00:22 +01:00
</pre>
</div>
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">wc = 2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>100; <span class="org-comment">% Wanted Bandwidth [rad/s]</span>
2020-03-11 19:00:22 +01:00
2021-01-08 15:54:58 +01:00
h = 1.2;
H_lead = 1<span class="org-type">/</span>h<span class="org-type">*</span>(1 <span class="org-type">+</span> s<span class="org-type">/</span>(wc<span class="org-type">/</span>h))<span class="org-type">/</span>(1 <span class="org-type">+</span> s<span class="org-type">/</span>(wc<span class="org-type">*</span>h));
2020-03-11 19:00:22 +01:00
2021-01-08 15:54:58 +01:00
Kd_iff = diag(1<span class="org-type">./</span>abs(diag(freqresp(1<span class="org-type">/</span>s<span class="org-type">*</span>Gc_iff, wc)))) <span class="org-type">.*</span> H_lead <span class="org-type">.*</span> 1<span class="org-type">/</span>s;
K_hac_iff = inv(stewart.kinematics.J<span class="org-type">'</span>)<span class="org-type">*</span>Kd_iff;
2020-03-11 19:00:22 +01:00
</pre>
</div>
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">controller = initializeController(<span class="org-string">'type'</span>, <span class="org-string">'hac-iff'</span>);
2020-03-11 19:00:22 +01:00
</pre>
</div>
</div>
</div>
2021-01-08 15:34:53 +01:00
<div id="outline-container-org757f9e9" class="outline-3">
<h3 id="org757f9e9"><span class="section-number-3">4.3</span> HAC-DVF</h3>
2020-03-11 19:00:22 +01:00
<div class="outline-text-3" id="text-4-3">
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">controller = initializeController(<span class="org-string">'type'</span>, <span class="org-string">'dvf'</span>);
K_dvf = <span class="org-type">-</span>1e4<span class="org-type">*</span>s<span class="org-type">/</span>(1<span class="org-type">+</span>s<span class="org-type">/</span>2<span class="org-type">/</span><span class="org-constant">pi</span><span class="org-type">/</span>5000)<span class="org-type">*</span>eye(6);
2020-03-11 19:00:22 +01:00
2021-01-08 15:54:58 +01:00
<span class="org-matlab-cellbreak"><span class="org-comment">%% Name of the Simulink File</span></span>
mdl = <span class="org-string">'stewart_platform_model'</span>;
2020-03-11 19:00:22 +01:00
2021-01-08 15:54:58 +01:00
<span class="org-matlab-cellbreak"><span class="org-comment">%% Input/Output definition</span></span>
clear io; io_i = 1;
io(io_i) = linio([mdl, <span class="org-string">'/Controller'</span>], 1, <span class="org-string">'input'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Actuator Force Inputs [N]</span>
io(io_i) = linio([mdl, <span class="org-string">'/Absolute Motion Sensor'</span>], 1, <span class="org-string">'openoutput'</span>); io_i = io_i <span class="org-type">+</span> 1; <span class="org-comment">% Absolute Sensor [m, rad]</span>
2020-03-11 19:00:22 +01:00
2021-01-08 15:54:58 +01:00
<span class="org-matlab-cellbreak"><span class="org-comment">%% Run the linearization</span></span>
G_dvf = linearize(mdl, io);
G_dvf.InputName = {<span class="org-string">'F1'</span>, <span class="org-string">'F2'</span>, <span class="org-string">'F3'</span>, <span class="org-string">'F4'</span>, <span class="org-string">'F5'</span>, <span class="org-string">'F6'</span>};
G_dvf.OutputName = {<span class="org-string">'Dx'</span>, <span class="org-string">'Dy'</span>, <span class="org-string">'Dz'</span>, <span class="org-string">'Rx'</span>, <span class="org-string">'Ry'</span>, <span class="org-string">'Rz'</span>};
2020-03-11 19:00:22 +01:00
2021-01-08 15:54:58 +01:00
Gc_dvf = minreal(G_dvf)<span class="org-type">/</span>stewart.kinematics.J<span class="org-type">'</span>;
Gc_dvf.InputName = {<span class="org-string">'Fx'</span>, <span class="org-string">'Fy'</span>, <span class="org-string">'Fz'</span>, <span class="org-string">'Mx'</span>, <span class="org-string">'My'</span>, <span class="org-string">'Mz'</span>};
2020-03-11 19:00:22 +01:00
</pre>
</div>
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">wc = 2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>100; <span class="org-comment">% Wanted Bandwidth [rad/s]</span>
2020-03-11 19:00:22 +01:00
2021-01-08 15:54:58 +01:00
h = 1.2;
H_lead = 1<span class="org-type">/</span>h<span class="org-type">*</span>(1 <span class="org-type">+</span> s<span class="org-type">/</span>(wc<span class="org-type">/</span>h))<span class="org-type">/</span>(1 <span class="org-type">+</span> s<span class="org-type">/</span>(wc<span class="org-type">*</span>h));
2020-03-11 19:00:22 +01:00
2021-01-08 15:54:58 +01:00
Kd_dvf = diag(1<span class="org-type">./</span>abs(diag(freqresp(1<span class="org-type">/</span>s<span class="org-type">*</span>Gc_dvf, wc)))) <span class="org-type">.*</span> H_lead <span class="org-type">.*</span> 1<span class="org-type">/</span>s;
2020-03-11 19:00:22 +01:00
2021-01-08 15:54:58 +01:00
K_hac_dvf = inv(stewart.kinematics.J<span class="org-type">'</span>)<span class="org-type">*</span>Kd_dvf;
2020-03-11 19:00:22 +01:00
</pre>
</div>
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">controller = initializeController(<span class="org-string">'type'</span>, <span class="org-string">'hac-dvf'</span>);
2020-03-11 19:00:22 +01:00
</pre>
</div>
</div>
</div>
2021-01-08 15:54:58 +01:00
<div id="outline-container-org620278d" class="outline-3">
<h3 id="org620278d"><span class="section-number-3">4.4</span> Results</h3>
2020-03-11 19:00:22 +01:00
<div class="outline-text-3" id="text-4-4">
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab"><span class="org-type">figure</span>;
subplot(1, 2, 1);
hold on;
plot(Eg.Time, Eg.Data(<span class="org-type">:</span>, 1), <span class="org-string">'DisplayName'</span>, <span class="org-string">'X'</span>);
plot(Eg.Time, Eg.Data(<span class="org-type">:</span>, 2), <span class="org-string">'DisplayName'</span>, <span class="org-string">'Y'</span>);
plot(Eg.Time, Eg.Data(<span class="org-type">:</span>, 3), <span class="org-string">'DisplayName'</span>, <span class="org-string">'Z'</span>);
hold off;
xlabel(<span class="org-string">'Time [s]'</span>);
ylabel(<span class="org-string">'Position error [m]'</span>);
legend();
subplot(1, 2, 2);
hold on;
plot(simout.Xa.Time, simout.Xa.Data(<span class="org-type">:</span>, 1));
plot(simout.Xa.Time, simout.Xa.Data(<span class="org-type">:</span>, 2));
plot(simout.Xa.Time, simout.Xa.Data(<span class="org-type">:</span>, 3));
hold off;
xlabel(<span class="org-string">'Time [s]'</span>);
ylabel(<span class="org-string">'Orientation error [rad]'</span>);
2020-03-11 19:00:22 +01:00
</pre>
</div>
</div>
</div>
</div>
2021-01-08 15:34:53 +01:00
<div id="outline-container-org6a9c87c" class="outline-2">
<h2 id="org6a9c87c"><span class="section-number-2">5</span> Functions</h2>
2020-03-11 19:00:22 +01:00
<div class="outline-text-2" id="text-5">
</div>
2021-01-08 15:34:53 +01:00
<div id="outline-container-orgd1492e7" class="outline-3">
<h3 id="orgd1492e7"><span class="section-number-3">5.1</span> <code>initializeController</code>: Initialize the Controller</h3>
2020-03-11 19:00:22 +01:00
<div class="outline-text-3" id="text-5-1">
<p>
2021-01-08 15:34:53 +01:00
<a id="orgc575d0d"></a>
</p>
</div>
2021-01-08 15:34:53 +01:00
<div id="outline-container-orgae5eed0" class="outline-4">
<h4 id="orgae5eed0">Function description</h4>
<div class="outline-text-4" id="text-orgae5eed0">
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab"><span class="org-keyword">function</span> <span class="org-variable-name">[controller]</span> = <span class="org-function-name">initializeController</span>(<span class="org-variable-name">args</span>)
<span class="org-comment">% initializeController - Initialize the Controller</span>
<span class="org-comment">%</span>
<span class="org-comment">% Syntax: [] = initializeController(args)</span>
<span class="org-comment">%</span>
<span class="org-comment">% Inputs:</span>
<span class="org-comment">% - args - Can have the following fields:</span>
</pre>
</div>
</div>
</div>
2021-01-08 15:34:53 +01:00
<div id="outline-container-orgda07b57" class="outline-4">
<h4 id="orgda07b57">Optional Parameters</h4>
<div class="outline-text-4" id="text-orgda07b57">
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab"><span class="org-keyword">arguments</span>
2021-01-08 15:34:53 +01:00
<span class="org-variable-name">args</span>.type char {mustBeMember(args.type, {<span class="org-string">'open-loop'</span>, <span class="org-string">'iff'</span>, <span class="org-string">'dvf'</span>, <span class="org-string">'hac-iff'</span>, <span class="org-string">'hac-dvf'</span>, <span class="org-string">'ref-track-L'</span>, <span class="org-string">'ref-track-X'</span>, <span class="org-string">'ref-track-hac-dvf'</span>})} = <span class="org-string">'open-loop'</span>
2021-01-08 15:54:58 +01:00
<span class="org-keyword">end</span>
</pre>
</div>
</div>
</div>
2021-01-08 15:34:53 +01:00
<div id="outline-container-orgdb009ab" class="outline-4">
<h4 id="orgdb009ab">Structure initialization</h4>
<div class="outline-text-4" id="text-orgdb009ab">
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab">controller = struct();
</pre>
</div>
</div>
</div>
2021-01-08 15:34:53 +01:00
<div id="outline-container-org056c578" class="outline-4">
<h4 id="org056c578">Add Type</h4>
<div class="outline-text-4" id="text-org056c578">
<div class="org-src-container">
2021-01-08 15:54:58 +01:00
<pre class="src src-matlab"><span class="org-keyword">switch</span> <span class="org-constant">args.type</span>
<span class="org-keyword">case</span> <span class="org-string">'open-loop'</span>
controller.type = 0;
<span class="org-keyword">case</span> <span class="org-string">'iff'</span>
controller.type = 1;
<span class="org-keyword">case</span> <span class="org-string">'dvf'</span>
controller.type = 2;
<span class="org-keyword">case</span> <span class="org-string">'hac-iff'</span>
controller.type = 3;
<span class="org-keyword">case</span> <span class="org-string">'hac-dvf'</span>
controller.type = 4;
<span class="org-keyword">case</span> <span class="org-string">'ref-track-L'</span>
controller.type = 5;
<span class="org-keyword">case</span> <span class="org-string">'ref-track-X'</span>
controller.type = 6;
<span class="org-keyword">case</span> <span class="org-string">'ref-track-hac-dvf'</span>
controller.type = 7;
<span class="org-keyword">end</span>
</pre>
</div>
2020-08-05 13:28:14 +02:00
<style>.csl-entry{text-indent: -1.5em; margin-left: 1.5em;}</style><h2 class='citeproc-org-bib-h2'>Bibliography</h2>
<div class="csl-bib-body">
<div class="csl-entry"><a name="citeproc_bib_item_1"></a>Skogestad, Sigurd, and Ian Postlethwaite. 2007. <i>Multivariable Feedback Control: Analysis and Design</i>. John Wiley.</div>
</div>
</div>
</div>
</div>
</div>
2020-01-22 16:31:44 +01:00
</div>
<div id="postamble" class="status">
<p class="author">Author: Dehaeze Thomas</p>
2021-01-08 15:54:58 +01:00
<p class="date">Created: 2021-01-08 ven. 15:52</p>
2020-01-22 16:31:44 +01:00
</div>
</body>
</html>