diff --git a/docs/control-tracking.html b/docs/control-tracking.html index 4ea878b..6f71fe6 100644 --- a/docs/control-tracking.html +++ b/docs/control-tracking.html @@ -4,7 +4,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Stewart Platform - Tracking Control @@ -248,42 +248,42 @@
  • 3. Hybrid Control Architecture - HAC-LAC with relative DVF
  • -
  • 4. Position Error computation
  • +
  • 4. Comparison of all the methods
  • +
  • 5. Compute the pose error of the Stewart Platform
  • @@ -326,6 +327,10 @@ Let’s suppose the control objective is to position \(\bm{\mathcal{X}}\) of the mobile platform of the Stewart platform such that it is following some reference position \(\bm{r}_\mathcal{X}\).

    +

    +In order to compute the pose error \(\bm{\epsilon}_\mathcal{X}\) from the actual pose \(\bm{\mathcal{X}}\) and the reference position \(\bm{r}_\mathcal{X}\), some computation is required and explained in section 5. +

    +

    Depending of the measured quantity, different control architectures can be used:

    @@ -335,6 +340,10 @@ Depending of the measured quantity, different control architectures can be used:
  • If both \(\bm{\mathcal{L}}\) and \(\bm{\mathcal{X}}\) are measured, we can use an hybrid control architecture (Section 3)
  • +

    +The control configuration are compare in section 4. +

    +

    1 Decentralized Control Architecture using Strut Length

    @@ -342,8 +351,8 @@ Depending of the measured quantity, different control architectures can be used:

    -
    -

    1.1 Control Schematic

    +
    +

    1.1 Control Schematic

    The control architecture is shown in Figure 1. @@ -366,11 +375,12 @@ Then, a diagonal (decentralized) controller \(\bm{K}_\mathcal{L}\) is used such

    -
    -

    1.2 Initialize the Stewart platform

    +
    +

    1.2 Initialize the Stewart platform

    -
    stewart = initializeStewartPlatform();
    +
    % Stewart Platform
    +stewart = initializeStewartPlatform();
     stewart = initializeFramesPositions(stewart, 'H', 90e-3, 'MO_B', 45e-3);
     stewart = generateGeneralConfiguration(stewart);
     stewart = computeJointsPose(stewart);
    @@ -381,26 +391,24 @@ stewart = initializeCylindricalStruts(stewart);
     stewart = computeJacobian(stewart);
     stewart = initializeStewartPose(stewart);
     stewart = initializeInertialSensor(stewart, 'type', 'accelerometer', 'freq', 5e3);
    -
    -
    -
    -
    ground = initializeGround('type', 'rigid');
    +% Ground and Payload
    +ground = initializeGround('type', 'rigid');
     payload = initializePayload('type', 'none');
    -controller = initializeController('type', 'open-loop');
    -
    -
    -
    -
    disturbances = initializeDisturbances();
    +% Controller
    +controller = initializeController('type', 'open-loop');
    +
    +% Disturbances and References
    +disturbances = initializeDisturbances();
     references = initializeReferences(stewart);
     
    -
    -

    1.3 Identification of the plant

    +
    +

    1.3 Identification of the plant

    Let’s identify the transfer function from \(\bm{\tau}\) to \(\bm{\mathcal{L}}\). @@ -423,8 +431,8 @@ G.OutputName = {'L1', '

    -
    -

    1.4 Plant Analysis

    +
    +

    1.4 Plant Analysis

    The diagonal terms of the plant is shown in Figure 2. @@ -458,8 +466,8 @@ We see that the plant is decoupled at low frequency which indicate that decentra

    -
    -

    1.5 Controller Design

    +
    +

    1.5 Controller Design

    The controller consists of: @@ -488,54 +496,108 @@ Kl = diag(1./diag(abs(freqresp(G, wc))))

    -
    -

    1.6 Simulation

    +
    +

    1.6 Simulation

    +

    +Let’s define some reference path to follow. +

    -
    t = linspace(0, 10, 1000);
    +
    t = [0:1e-4:10];
     
     r = zeros(6, length(t));
     
    -r(1, :) = 5e-3*sin(2*pi*t);
    +r(1, :) = 1e-3.*t.*sin(2*pi*t);
    +r(2, :) = 1e-3.*t.*cos(2*pi*t);
    +r(3, :) = 1e-3.*t;
     
     references = initializeReferences(stewart, 't', t, 'r', r);
     
    +

    +The reference path is shown in Figure 5. +

    + +
    +
    figure;
    +plot3(squeeze(references.r.Data(1,1,:)), squeeze(references.r.Data(2,1,:)), squeeze(references.r.Data(3,1,:)));
    +xlabel('X [m]');
    +ylabel('Y [m]');
    +zlabel('Z [m]');
    +
    +
    + + +
    +

    tracking_control_reference_path.png +

    +

    Figure 5: Reference path used for Tracking control (png, pdf)

    +
    +
    controller = initializeController('type', 'ref-track-L');
     
    -
    sim('stewart_platform_model')
    +
    set_param('stewart_platform_model', 'StopTime', '10')
    +sim('stewart_platform_model');
     simout_D = simout;
     
    + +
    +
    save('./mat/control_tracking.mat', 'simout_D', '-append');
    +
    +

    1.7 Results

    +

    +The reference path and the position of the mobile platform are shown in Figure 6. +

    + +
    +
    figure;
    +hold on;
    +plot3(simout_D.x.Xr.Data(:, 1), simout_D.x.Xr.Data(:, 2), simout_D.x.Xr.Data(:, 3), 'k-');
    +plot3(squeeze(references.r.Data(1,1,:)), squeeze(references.r.Data(2,1,:)), squeeze(references.r.Data(3,1,:)), '--');
    +hold off;
    +xlabel('X [m]'); ylabel('Y [m]'); zlabel('Z [m]');
    +view([1,1,1])
    +zlim([0, inf]);
    +
    +
    + + +
    +

    decentralized_control_3d_pos.png +

    +

    Figure 6: Reference path and Obtained Position (png, pdf)

    +
    +

    decentralized_control_Ex.png

    -

    Figure 5: Position error \(\bm{\epsilon}_\mathcal{X}\) (png, pdf)

    +

    Figure 7: Position error \(\bm{\epsilon}_\mathcal{X}\) (png, pdf)

    decentralized_control_El.png

    -

    Figure 6: Position error \(\bm{\epsilon}_\mathcal{L}\) (png, pdf)

    +

    Figure 8: Position error \(\bm{\epsilon}_\mathcal{L}\) (png, pdf)

    -
    -

    1.8 Conclusion

    +
    +

    1.8 Conclusion

    Such control architecture is easy to implement and give good results. @@ -556,11 +618,11 @@ However, as \(\mathcal{X}\) is not directly measured, it is possible that import

    -
    -

    2.1 Control Schematic

    +
    +

    2.1 Control Schematic

    -The centralized controller takes the position error \(\bm{\epsilon}_\mathcal{X}\) as an inputs and generate actuator forces \(\bm{\tau}\) (see Figure 7). +The centralized controller takes the position error \(\bm{\epsilon}_\mathcal{X}\) as an inputs and generate actuator forces \(\bm{\tau}\) (see Figure 9). The signals are:

      @@ -574,7 +636,7 @@ The signals are:

      centralized_reference_tracking.png

      -

      Figure 7: Centralized Controller

      +

      Figure 9: Centralized Controller

      @@ -587,19 +649,20 @@ We can think of two ways to make the plant more diagonal that are described in s

      -Note here that the subtraction shown in Figure 7 is not a real subtraction. -It is indeed a more complex computation explained in section 4. +Note here that the subtraction shown in Figure 9 is not a real subtraction. +It is indeed a more complex computation explained in section 5.

    -
    -

    2.2 Initialize the Stewart platform

    +
    +

    2.2 Initialize the Stewart platform

    -
    stewart = initializeStewartPlatform();
    +
    % Stewart Platform
    +stewart = initializeStewartPlatform();
     stewart = initializeFramesPositions(stewart, 'H', 90e-3, 'MO_B', 45e-3);
     stewart = generateGeneralConfiguration(stewart);
     stewart = computeJointsPose(stewart);
    @@ -610,26 +673,24 @@ stewart = initializeCylindricalStruts(stewart);
     stewart = computeJacobian(stewart);
     stewart = initializeStewartPose(stewart);
     stewart = initializeInertialSensor(stewart, 'type', 'accelerometer', 'freq', 5e3);
    -
    -
    -
    -
    ground = initializeGround('type', 'rigid');
    +% Ground and Payload
    +ground = initializeGround('type', 'rigid');
     payload = initializePayload('type', 'none');
    -controller = initializeController('type', 'open-loop');
    -
    -
    -
    -
    disturbances = initializeDisturbances();
    +% Controller
    +controller = initializeController('type', 'open-loop');
    +
    +% Disturbances and References
    +disturbances = initializeDisturbances();
     references = initializeReferences(stewart);
     
    -
    -

    2.3 Identification of the plant

    +
    +

    2.3 Identification of the plant

    Let’s identify the transfer function from \(\bm{\tau}\) to \(\bm{\mathcal{X}}\). @@ -659,13 +720,13 @@ G.OutputName = {'Dx', '

    -
    -

    2.4.1 Control Architecture

    +
    +

    2.4.1 Control Architecture

    The pose error \(\bm{\epsilon}_\mathcal{X}\) is first converted in the frame of the leg by using the Jacobian matrix. Then a diagonal controller \(\bm{K}_\mathcal{L}\) is designed. -The final implemented controller is \(\bm{K} = \bm{K}_\mathcal{L} \cdot \bm{J}\) as shown in Figure 8 +The final implemented controller is \(\bm{K} = \bm{K}_\mathcal{L} \cdot \bm{J}\) as shown in Figure 10

    @@ -676,16 +737,16 @@ Note here that the transformation from the pose error \(\bm{\epsilon}_\mathcal{X

    centralized_reference_tracking_L.png

    -

    Figure 8: Controller in the frame of the legs

    +

    Figure 10: Controller in the frame of the legs

    -
    -

    2.4.2 Plant Analysis

    +
    +

    2.4.2 Plant Analysis

    -We now multiply the plant by the Jacobian matrix as shown in Figure 8 to obtain a more diagonal plant. +We now multiply the plant by the Jacobian matrix as shown in Figure 10 to obtain a more diagonal plant.

    @@ -698,7 +759,7 @@ Gl.OutputName = {'D1',

    plant_centralized_diagonal_L.png

    -

    Figure 9: Diagonal Elements of the plant \(\bm{J} \bm{G}\) (png, pdf)

    +

    Figure 11: Diagonal Elements of the plant \(\bm{J} \bm{G}\) (png, pdf)

    @@ -707,14 +768,14 @@ This will simplify the design of the controller as all the elements of the diago

    -The off-diagonal terms of the controller are shown in Figure 10. +The off-diagonal terms of the controller are shown in Figure 12.

    plant_centralized_off_diagonal_L.png

    -

    Figure 10: Off Diagonal Elements of the plant \(\bm{J} \bm{G}\) (png, pdf)

    +

    Figure 12: Off Diagonal Elements of the plant \(\bm{J} \bm{G}\) (png, pdf)

    @@ -732,8 +793,8 @@ Thus \(J \cdot G(\omega = 0) = J \cdot \frac{\delta\bm{\mathcal{X}}}{\delta\bm{\

    -
    -

    2.4.3 Controller Design

    +
    +

    2.4.3 Controller Design

    The controller consists of: @@ -744,7 +805,7 @@ The controller consists of:

    -The obtained loop gains corresponding to the diagonal elements are shown in Figure 11. +The obtained loop gains corresponding to the diagonal elements are shown in Figure 13.

    @@ -757,7 +818,7 @@ Kl = diag(1./diag(abs(freqresp(Gl, wc))))

    loop_gain_centralized_L.png

    -

    Figure 11: Loop Gain of the diagonal elements (png, pdf)

    +

    Figure 13: Loop Gain of the diagonal elements (png, pdf)

    @@ -770,18 +831,20 @@ The controller \(\bm{K} = \bm{K}_\mathcal{L} \bm{J}\) is computed.

    -
    -

    2.4.4 Simulation

    +
    +

    2.4.4 Simulation

    We specify the reference path to follow.

    -
    t = linspace(0, 10, 1000);
    +
    t = [0:1e-4:10];
     
     r = zeros(6, length(t));
     
    -r(1, :) = 5e-3*sin(2*pi*t);
    +r(1, :) = 1e-3.*t.*sin(2*pi*t);
    +r(2, :) = 1e-3.*t.*cos(2*pi*t);
    +r(3, :) = 1e-3.*t;
     
     references = initializeReferences(stewart, 't', t, 'r', r);
     
    @@ -796,8 +859,10 @@ references = initializeReferences(stewart, 't', We run the simulation and we save the results.

    -
    sim('stewart_platform_model')
    +
    set_param('stewart_platform_model', 'StopTime', '10')
    +sim('stewart_platform_model')
     simout_L = simout;
    +save('./mat/control_tracking.mat', 'simout_L', '-append');
     
    @@ -811,11 +876,11 @@ simout_L = simout;

    -
    -

    2.5.1 Control Architecture

    +
    +

    2.5.1 Control Architecture

    -A diagonal controller \(\bm{K}_\mathcal{X}\) take the pose error \(\bm{\epsilon}_\mathcal{X}\) and generate cartesian forces \(\bm{\mathcal{F}}\) that are then converted to actuators forces using the Jacobian as shown in Figure e 12. +A diagonal controller \(\bm{K}_\mathcal{X}\) take the pose error \(\bm{\epsilon}_\mathcal{X}\) and generate cartesian forces \(\bm{\mathcal{F}}\) that are then converted to actuators forces using the Jacobian as shown in Figure e 14.

    @@ -826,16 +891,16 @@ The final implemented controller is \(\bm{K} = \bm{J}^{-T} \cdot \bm{K}_\mathcal

    centralized_reference_tracking_X.png

    -

    Figure 12: Controller in the cartesian frame

    +

    Figure 14: Controller in the cartesian frame

    -
    -

    2.5.2 Plant Analysis

    +
    +

    2.5.2 Plant Analysis

    -We now multiply the plant by the Jacobian matrix as shown in Figure 12 to obtain a more diagonal plant. +We now multiply the plant by the Jacobian matrix as shown in Figure 14 to obtain a more diagonal plant.

    @@ -848,7 +913,7 @@ Gx.InputName = {'Fx',

    plant_centralized_diagonal_X.png

    -

    Figure 13: Diagonal Elements of the plant \(\bm{G} \bm{J}^{-T}\) (png, pdf)

    +

    Figure 15: Diagonal Elements of the plant \(\bm{G} \bm{J}^{-T}\) (png, pdf)

    @@ -861,7 +926,7 @@ For instance, the vertical resonance of the system is only present on the diagon

    plant_centralized_off_diagonal_X.png

    -

    Figure 14: Off Diagonal Elements of the plant \(\bm{G} \bm{J}^{-T}\) (png, pdf)

    +

    Figure 16: Off Diagonal Elements of the plant \(\bm{G} \bm{J}^{-T}\) (png, pdf)

    @@ -954,8 +1019,8 @@ This control architecture can also give a dynamically decoupled plant if the Cen

    -
    -

    2.5.3 Controller Design

    +
    +

    2.5.3 Controller Design

    The controller consists of: @@ -966,7 +1031,7 @@ The controller consists of:

    -The obtained loop gains corresponding to the diagonal elements are shown in Figure 15. +The obtained loop gains corresponding to the diagonal elements are shown in Figure 17.

    @@ -979,7 +1044,7 @@ Kx = diag(1./diag(abs(freqresp(Gx, wc))))

    loop_gain_centralized_X.png

    -

    Figure 15: Loop Gain of the diagonal elements (png, pdf)

    +

    Figure 17: Loop Gain of the diagonal elements (png, pdf)

    @@ -992,18 +1057,20 @@ The controller \(\bm{K} = \bm{J}^{-T} \bm{K}_\mathcal{X}\) is computed.

    -
    -

    2.5.4 Simulation

    +
    +

    2.5.4 Simulation

    We specify the reference path to follow.

    -
    t = linspace(0, 10, 1000);
    +
    t = [0:1e-4:10];
     
     r = zeros(6, length(t));
     
    -r(1, :) = 5e-3*sin(2*pi*t);
    +r(1, :) = 1e-3.*t.*sin(2*pi*t);
    +r(2, :) = 1e-3.*t.*cos(2*pi*t);
    +r(3, :) = 1e-3.*t;
     
     references = initializeReferences(stewart, 't', t, 'r', r);
     
    @@ -1018,8 +1085,10 @@ references = initializeReferences(stewart, 't', We run the simulation and we save the results.

    -
    sim('stewart_platform_model')
    +
    set_param('stewart_platform_model', 'StopTime', '10')
    +sim('stewart_platform_model')
     simout_X = simout;
    +save('./mat/control_tracking.mat', 'simout_X', '-append');
     
    @@ -1033,8 +1102,8 @@ simout_X = simout;

    -
    -

    2.6.1 Control Architecture

    +
    +

    2.6.1 Control Architecture

    The plant \(\bm{G}\) is pre-multiply by \(\bm{G}^{-1}(\omega = 0)\) such that the “shaped plant” \(\bm{G}_0 = \bm{G} \bm{G}^{-1}(\omega = 0)\) is diagonal at low frequency. @@ -1045,24 +1114,24 @@ Then a diagonal controller \(\bm{K}_0\) is designed.

    -The control architecture is shown in Figure 16. +The control architecture is shown in Figure 18.

    centralized_reference_tracking_S.png

    -

    Figure 16: Static Decoupling of the Plant

    +

    Figure 18: Static Decoupling of the Plant

    -
    -

    2.6.2 Plant Analysis

    +
    +

    2.6.2 Plant Analysis

    The plant is pre-multiplied by \(\bm{G}^{-1}(\omega = 0)\). -The diagonal elements of the shaped plant are shown in Figure 17. +The diagonal elements of the shaped plant are shown in Figure 19.

    @@ -1074,20 +1143,20 @@ The diagonal elements of the shaped plant are shown in Figure

    plant_centralized_diagonal_SD.png

    -

    Figure 17: Diagonal Elements of the plant \(\bm{G} \bm{G}^{-1}(\omega = 0)\) (png, pdf)

    +

    Figure 19: Diagonal Elements of the plant \(\bm{G} \bm{G}^{-1}(\omega = 0)\) (png, pdf)

    plant_centralized_off_diagonal_SD.png

    -

    Figure 18: Off Diagonal Elements of the plant \(\bm{G} \bm{J}^{-T}\) (png, pdf)

    +

    Figure 20: Off Diagonal Elements of the plant \(\bm{G} \bm{J}^{-T}\) (png, pdf)

    -
    -

    2.6.3 Controller Design

    +
    +

    2.6.3 Controller Design

    We have that: @@ -1119,7 +1188,7 @@ We have that \(\bm{K}_0(s)\) commutes with \(\bm{G}^{-1}(\omega = 0)\) and thus

    centralized_control_comp_K.png

    -

    Figure 19: Comparison of the MIMO controller \(\bm{K}\) for both centralized architectures (png, pdf)

    +

    Figure 21: Comparison of the MIMO controller \(\bm{K}\) for both centralized architectures (png, pdf)

    @@ -1128,12 +1197,11 @@ We have that \(\bm{K}_0(s)\) commutes with \(\bm{G}^{-1}(\omega = 0)\) and thus

    2.7.2 Simulation Results

    -The position error \(\bm{\epsilon}_\mathcal{X}\) for both centralized architecture are shown in Figure 20. -The corresponding leg’s length errors \(\bm{\epsilon}_\mathcal{L}\) are shown in Figure 21. +The position error \(\bm{\epsilon}_\mathcal{X}\) for both centralized architecture are shown in Figure 22.

    -Based on Figure 20, we can see that: +Based on Figure 22, we can see that:

    • There is some tracking error \(\epsilon_x\)
    • @@ -1148,21 +1216,14 @@ This error is much lower when using the diagonal control in the frame of the leg

      centralized_control_comp_Ex.png

      -

      Figure 20: Comparison of the position error \(\bm{\epsilon}_\mathcal{X}\) for both centralized controllers (png, pdf)

      -
      - - -
      -

      centralized_control_comp_El.png -

      -

      Figure 21: Comparison of the leg’s length error \(\bm{\epsilon}_\mathcal{L}\) for both centralized controllers (png, pdf)

      +

      Figure 22: Comparison of the position error \(\bm{\epsilon}_\mathcal{X}\) for both centralized controllers (png, pdf)

    -
    -

    2.8 Conclusion

    +
    +

    2.8 Conclusion

    Both control architecture gives similar results even tough the control in the Leg’s frame gives slightly better results. @@ -1245,11 +1306,11 @@ Thus, this method should be quite robust against parameter variation (e.g. the p

    -
    -

    3.1 Control Schematic

    +
    +

    3.1 Control Schematic

    -Let’s consider the control schematic shown in Figure 22. +Let’s consider the control schematic shown in Figure 23.

    @@ -1282,16 +1343,17 @@ This second loop is responsible for the reference tracking.

    hybrid_reference_tracking.png

    -

    Figure 22: Hybrid Control Architecture

    +

    Figure 23: Hybrid Control Architecture

    -
    -

    3.2 Initialize the Stewart platform

    +
    +

    3.2 Initialize the Stewart platform

    -
    stewart = initializeStewartPlatform();
    +
    % Stewart Platform
    +stewart = initializeStewartPlatform();
     stewart = initializeFramesPositions(stewart, 'H', 90e-3, 'MO_B', 45e-3);
     stewart = generateGeneralConfiguration(stewart);
     stewart = computeJointsPose(stewart);
    @@ -1302,18 +1364,16 @@ stewart = initializeCylindricalStruts(stewart);
     stewart = computeJacobian(stewart);
     stewart = initializeStewartPose(stewart);
     stewart = initializeInertialSensor(stewart, 'type', 'accelerometer', 'freq', 5e3);
    -
    -
    -
    -
    ground = initializeGround('type', 'rigid');
    +% Ground and Payload
    +ground = initializeGround('type', 'rigid');
     payload = initializePayload('type', 'none');
    -controller = initializeController('type', 'open-loop');
    -
    -
    -
    -
    disturbances = initializeDisturbances();
    +% Controller
    +controller = initializeController('type', 'open-loop');
    +
    +% Disturbances and References
    +disturbances = initializeDisturbances();
     references = initializeReferences(stewart);
     
    @@ -1324,8 +1384,8 @@ references = initializeReferences(stewart);

    3.3 First Control Loop - \(\bm{K}_\mathcal{L}\)

    -
    -

    3.3.1 Identification

    +
    +

    3.3.1 Identification

    Let’s identify the transfer function from \(\bm{\tau}\) to \(\bm{L}\). @@ -1348,31 +1408,31 @@ Gl.OutputName = {'L1',

    -
    -

    3.3.2 Obtained Plant

    +
    +

    3.3.2 Obtained Plant

    -The diagonal elements of the plant are shown in Figure 23 while the off diagonal terms are shown in Figure 24. +The diagonal elements of the plant are shown in Figure 24 while the off diagonal terms are shown in Figure 25.

    hybrid_control_Kl_plant_diagonal.png

    -

    Figure 23: Diagonal elements of the plant for the design of \(\bm{K}_\mathcal{L}\) (png, pdf)

    +

    Figure 24: Diagonal elements of the plant for the design of \(\bm{K}_\mathcal{L}\) (png, pdf)

    hybrid_control_Kl_plant_off_diagonal.png

    -

    Figure 24: Off-diagonal elements of the plant for the design of \(\bm{K}_\mathcal{L}\) (png, pdf)

    +

    Figure 25: Off-diagonal elements of the plant for the design of \(\bm{K}_\mathcal{L}\) (png, pdf)

    -
    -

    3.3.3 Controller Design

    +
    +

    3.3.3 Controller Design

    We apply a decentralized (diagonal) direct velocity feedback. @@ -1382,7 +1442,7 @@ The gain of the controller is chosen such that the resonances are critically dam

    -The obtain loop gain is shown in Figure 25. +The obtain loop gain is shown in Figure 26.

    @@ -1394,7 +1454,7 @@ The obtain loop gain is shown in Figure 25.

    hybrid_control_Kl_loop_gain.png

    -

    Figure 25: Obtain Loop Gain for the DVF control loop (png, pdf)

    +

    Figure 26: Obtain Loop Gain for the DVF control loop (png, pdf)

    @@ -1404,8 +1464,8 @@ The obtain loop gain is shown in Figure 25.

    3.4 Second Control Loop - \(\bm{K}_\mathcal{X}\)

    -
    -

    3.4.1 Identification

    +
    +

    3.4.1 Identification

    Kx = tf(zeros(6));
    @@ -1432,8 +1492,8 @@ G.OutputName = {'Dx', '
     
    -
    -

    3.4.2 Obtained Plant

    +
    +

    3.4.2 Obtained Plant

    We use the Jacobian matrix to apply forces in the cartesian frame. @@ -1445,19 +1505,19 @@ Gx.InputName = {'Fx',

    -The obtained plant is shown in Figure 26. +The obtained plant is shown in Figure 27.

    hybrid_control_Kx_plant.png

    -

    Figure 26: Diagonal and Off-diagonal elements of the plant for the design of \(\bm{K}_\mathcal{L}\) (png, pdf)

    +

    Figure 27: Diagonal and Off-diagonal elements of the plant for the design of \(\bm{K}_\mathcal{L}\) (png, pdf)

    -
    -

    3.4.3 Controller Design

    +
    +

    3.4.3 Controller Design

    The controller consists of: @@ -1483,7 +1543,7 @@ Kx = Kx.*diag(1./dia

    hybrid_control_Kx_loop_gain.png

    -

    Figure 27: Obtained Loop Gain for the controller \(\bm{K}_\mathcal{X}\) (png, pdf)

    +

    Figure 28: Obtained Loop Gain for the controller \(\bm{K}_\mathcal{X}\) (png, pdf)

    @@ -1504,11 +1564,13 @@ Then we include the Jacobian in the controller matrix. We specify the reference path to follow.

    -
    t = linspace(0, 10, 10000);
    +
    t = [0:1e-4:10];
     
     r = zeros(6, length(t));
     
    -r(1, :) = 5e-3*sin(2*pi*t);
    +r(1, :) = 1e-3.*t.*sin(2*pi*t);
    +r(2, :) = 1e-3.*t.*cos(2*pi*t);
    +r(3, :) = 1e-3.*t;
     
     references = initializeReferences(stewart, 't', t, 'r', r);
     
    @@ -1518,33 +1580,59 @@ references = initializeReferences(stewart, 't', We run the simulation and we save the results.

    -
    sim('stewart_platform_model')
    +
    set_param('stewart_platform_model', 'StopTime', '10')
    +sim('stewart_platform_model')
     simout_H = simout;
    +save('./mat/control_tracking.mat', 'simout_H', '-append');
     

    -The obtained position error is shown in Figure 28. +The obtained position error is shown in Figure 29.

    hybrid_control_Ex.png

    -

    Figure 28: Obtained position error \(\bm{\epsilon}_\mathcal{X}\) (png, pdf)

    +

    Figure 29: Obtained position error \(\bm{\epsilon}_\mathcal{X}\) (png, pdf)

    -
    -

    3.6 Conclusion

    +
    +

    3.6 Conclusion

    -
    -

    4 Position Error computation

    +
    +

    4 Comparison of all the methods

    + +

    + +

    +Let’s load the simulation results and compare them in Figure 30. +

    +
    +
    load('./mat/control_tracking.mat', 'simout_D', 'simout_L', 'simout_X', 'simout_H');
    +
    +
    + + +
    +

    reference_tracking_performance_comparison.png +

    +

    Figure 30: Comparison of the position errors for all the Control architecture used (png, pdf)

    +
    +
    +
    + +
    +

    5 Compute the pose error of the Stewart Platform

    +
    +

    @@ -1677,7 +1765,7 @@ Erz = atan2(-T(1, 2)/

    Author: Dehaeze Thomas

    -

    Created: 2020-03-12 jeu. 18:06

    +

    Created: 2020-03-13 ven. 13:12

    diff --git a/docs/figs/centralized_control_comp_Ex.pdf b/docs/figs/centralized_control_comp_Ex.pdf index 8742afe..1c83116 100644 Binary files a/docs/figs/centralized_control_comp_Ex.pdf and b/docs/figs/centralized_control_comp_Ex.pdf differ diff --git a/docs/figs/centralized_control_comp_Ex.png b/docs/figs/centralized_control_comp_Ex.png index 083e585..8684832 100644 Binary files a/docs/figs/centralized_control_comp_Ex.png and b/docs/figs/centralized_control_comp_Ex.png differ diff --git a/docs/figs/decentralized_control_3d_pos.pdf b/docs/figs/decentralized_control_3d_pos.pdf new file mode 100644 index 0000000..8a2f0ab Binary files /dev/null and b/docs/figs/decentralized_control_3d_pos.pdf differ diff --git a/docs/figs/decentralized_control_3d_pos.png b/docs/figs/decentralized_control_3d_pos.png new file mode 100644 index 0000000..7366943 Binary files /dev/null and b/docs/figs/decentralized_control_3d_pos.png differ diff --git a/docs/figs/decentralized_control_El.pdf b/docs/figs/decentralized_control_El.pdf index 5f12afc..7f7de11 100644 Binary files a/docs/figs/decentralized_control_El.pdf and b/docs/figs/decentralized_control_El.pdf differ diff --git a/docs/figs/decentralized_control_El.png b/docs/figs/decentralized_control_El.png index e7f310d..49c778b 100644 Binary files a/docs/figs/decentralized_control_El.png and b/docs/figs/decentralized_control_El.png differ diff --git a/docs/figs/decentralized_control_Ex.pdf b/docs/figs/decentralized_control_Ex.pdf index 9bd805b..49d2a1e 100644 Binary files a/docs/figs/decentralized_control_Ex.pdf and b/docs/figs/decentralized_control_Ex.pdf differ diff --git a/docs/figs/decentralized_control_Ex.png b/docs/figs/decentralized_control_Ex.png index e15fb46..348ff79 100644 Binary files a/docs/figs/decentralized_control_Ex.png and b/docs/figs/decentralized_control_Ex.png differ diff --git a/docs/figs/hybrid_control_Ex.pdf b/docs/figs/hybrid_control_Ex.pdf index 6f75e06..7d971c6 100644 Binary files a/docs/figs/hybrid_control_Ex.pdf and b/docs/figs/hybrid_control_Ex.pdf differ diff --git a/docs/figs/hybrid_control_Ex.png b/docs/figs/hybrid_control_Ex.png index c6ef318..43ffdf7 100644 Binary files a/docs/figs/hybrid_control_Ex.png and b/docs/figs/hybrid_control_Ex.png differ diff --git a/docs/figs/reference_tracking_performance_comparison.pdf b/docs/figs/reference_tracking_performance_comparison.pdf new file mode 100644 index 0000000..b3fec1f Binary files /dev/null and b/docs/figs/reference_tracking_performance_comparison.pdf differ diff --git a/docs/figs/reference_tracking_performance_comparison.png b/docs/figs/reference_tracking_performance_comparison.png new file mode 100644 index 0000000..752cf63 Binary files /dev/null and b/docs/figs/reference_tracking_performance_comparison.png differ diff --git a/docs/figs/tracking_control_reference_path.pdf b/docs/figs/tracking_control_reference_path.pdf new file mode 100644 index 0000000..f841ceb Binary files /dev/null and b/docs/figs/tracking_control_reference_path.pdf differ diff --git a/docs/figs/tracking_control_reference_path.png b/docs/figs/tracking_control_reference_path.png new file mode 100644 index 0000000..4b85062 Binary files /dev/null and b/docs/figs/tracking_control_reference_path.png differ diff --git a/org/control-tracking.org b/org/control-tracking.org index 180278b..0a1cb88 100644 --- a/org/control-tracking.org +++ b/org/control-tracking.org @@ -41,11 +41,15 @@ * Introduction :ignore: Let's suppose the control objective is to position $\bm{\mathcal{X}}$ of the mobile platform of the Stewart platform such that it is following some reference position $\bm{r}_\mathcal{X}$. +In order to compute the pose error $\bm{\epsilon}_\mathcal{X}$ from the actual pose $\bm{\mathcal{X}}$ and the reference position $\bm{r}_\mathcal{X}$, some computation is required and explained in section [[sec:compute_pose_error]]. + Depending of the measured quantity, different control architectures can be used: - If the struts length $\bm{\mathcal{L}}$ is measured, a decentralized control architecture can be used (Section [[sec:decentralized]]) - If the pose of the mobile platform $\bm{\mathcal{X}}$ is directly measured, a centralized control architecture can be used (Section [[sec:centralized]]) - If both $\bm{\mathcal{L}}$ and $\bm{\mathcal{X}}$ are measured, we can use an hybrid control architecture (Section [[sec:hybrid]]) +The control configuration are compare in section [[sec:comparison]]. + * Decentralized Control Architecture using Strut Length <> ** Matlab Init :noexport: @@ -95,29 +99,8 @@ Then, a diagonal (decentralized) controller $\bm{K}_\mathcal{L}$ is used such th [[file:figs/control_measure_rotating_2dof.png]] ** Initialize the Stewart platform -#+begin_src matlab - stewart = initializeStewartPlatform(); - stewart = initializeFramesPositions(stewart, 'H', 90e-3, 'MO_B', 45e-3); - stewart = generateGeneralConfiguration(stewart); - stewart = computeJointsPose(stewart); - stewart = initializeStrutDynamics(stewart); - stewart = initializeJointDynamics(stewart, 'type_F', 'universal_p', 'type_M', 'spherical_p'); - stewart = initializeCylindricalPlatforms(stewart); - stewart = initializeCylindricalStruts(stewart); - stewart = computeJacobian(stewart); - stewart = initializeStewartPose(stewart); - stewart = initializeInertialSensor(stewart, 'type', 'accelerometer', 'freq', 5e3); -#+end_src - -#+begin_src matlab - ground = initializeGround('type', 'rigid'); - payload = initializePayload('type', 'none'); - controller = initializeController('type', 'open-loop'); -#+end_src - -#+begin_src matlab - disturbances = initializeDisturbances(); - references = initializeReferences(stewart); +#+begin_src matlab :noweb yes + <> #+end_src ** Identification of the plant @@ -278,26 +261,67 @@ The obtained loop gains corresponding to the diagonal elements are shown in Figu [[file:figs/loop_gain_decentralized_L.png]] ** Simulation -#+begin_src matlab - t = linspace(0, 10, 1000); - - r = zeros(6, length(t)); - - r(1, :) = 5e-3*sin(2*pi*t); - - references = initializeReferences(stewart, 't', t, 'r', r); +Let's define some reference path to follow. +#+begin_src matlab :noweb yes + <> #+end_src +The reference path is shown in Figure [[fig:tracking_control_reference_path]]. + +#+begin_src matlab :export none + figure; + plot3(squeeze(references.r.Data(1,1,:)), squeeze(references.r.Data(2,1,:)), squeeze(references.r.Data(3,1,:))); + xlabel('X [m]'); + ylabel('Y [m]'); + zlabel('Z [m]'); +#+end_src + +#+header: :tangle no :exports results :results none :noweb yes +#+begin_src matlab :var filepath="figs/tracking_control_reference_path.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png") +<> +#+end_src + +#+name: fig:tracking_control_reference_path +#+caption: Reference path used for Tracking control ([[./figs/tracking_control_reference_path.png][png]], [[./figs/tracking_control_reference_path.pdf][pdf]]) +[[file:figs/tracking_control_reference_path.png]] + #+begin_src matlab controller = initializeController('type', 'ref-track-L'); #+end_src #+begin_src matlab - sim('stewart_platform_model') + set_param('stewart_platform_model', 'StopTime', '10') + sim('stewart_platform_model'); simout_D = simout; #+end_src +#+begin_src matlab + save('./mat/control_tracking.mat', 'simout_D', '-append'); +#+end_src + ** Results +The reference path and the position of the mobile platform are shown in Figure [[fig:decentralized_control_3d_pos]]. + +#+begin_src matlab :export none + figure; + hold on; + plot3(simout_D.x.Xr.Data(:, 1), simout_D.x.Xr.Data(:, 2), simout_D.x.Xr.Data(:, 3), 'k-'); + plot3(squeeze(references.r.Data(1,1,:)), squeeze(references.r.Data(2,1,:)), squeeze(references.r.Data(3,1,:)), '--'); + hold off; + xlabel('X [m]'); ylabel('Y [m]'); zlabel('Z [m]'); + view([1,1,1]) + zlim([0, inf]); +#+end_src + +#+header: :tangle no :exports results :results none :noweb yes +#+begin_src matlab :var filepath="figs/decentralized_control_3d_pos.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png") +<> +#+end_src + +#+name: fig:decentralized_control_3d_pos +#+caption: Reference path and Obtained Position ([[./figs/decentralized_control_3d_pos.png][png]], [[./figs/decentralized_control_3d_pos.pdf][pdf]]) +[[file:figs/decentralized_control_3d_pos.png]] + #+begin_src matlab :exports none figure; subplot(2, 3, 1); @@ -469,29 +493,8 @@ We can think of two ways to make the plant more diagonal that are described in s #+end_important ** Initialize the Stewart platform -#+begin_src matlab - stewart = initializeStewartPlatform(); - stewart = initializeFramesPositions(stewart, 'H', 90e-3, 'MO_B', 45e-3); - stewart = generateGeneralConfiguration(stewart); - stewart = computeJointsPose(stewart); - stewart = initializeStrutDynamics(stewart); - stewart = initializeJointDynamics(stewart, 'type_F', 'universal_p', 'type_M', 'spherical_p'); - stewart = initializeCylindricalPlatforms(stewart); - stewart = initializeCylindricalStruts(stewart); - stewart = computeJacobian(stewart); - stewart = initializeStewartPose(stewart); - stewart = initializeInertialSensor(stewart, 'type', 'accelerometer', 'freq', 5e3); -#+end_src - -#+begin_src matlab - ground = initializeGround('type', 'rigid'); - payload = initializePayload('type', 'none'); - controller = initializeController('type', 'open-loop'); -#+end_src - -#+begin_src matlab - disturbances = initializeDisturbances(); - references = initializeReferences(stewart); +#+begin_src matlab :noweb yes + <> #+end_src ** Identification of the plant @@ -706,14 +709,8 @@ The controller $\bm{K} = \bm{K}_\mathcal{L} \bm{J}$ is computed. *** Simulation We specify the reference path to follow. -#+begin_src matlab - t = linspace(0, 10, 1000); - - r = zeros(6, length(t)); - - r(1, :) = 5e-3*sin(2*pi*t); - - references = initializeReferences(stewart, 't', t, 'r', r); +#+begin_src matlab :noweb yes + <> #+end_src #+begin_src matlab @@ -722,8 +719,10 @@ We specify the reference path to follow. We run the simulation and we save the results. #+begin_src matlab + set_param('stewart_platform_model', 'StopTime', '10') sim('stewart_platform_model') simout_L = simout; + save('./mat/control_tracking.mat', 'simout_L', '-append'); #+end_src ** Diagonal Control - Cartesian Frame @@ -932,14 +931,8 @@ The controller $\bm{K} = \bm{J}^{-T} \bm{K}_\mathcal{X}$ is computed. *** Simulation We specify the reference path to follow. -#+begin_src matlab - t = linspace(0, 10, 1000); - - r = zeros(6, length(t)); - - r(1, :) = 5e-3*sin(2*pi*t); - - references = initializeReferences(stewart, 't', t, 'r', r); +#+begin_src matlab :noweb yes + <> #+end_src #+begin_src matlab @@ -948,8 +941,10 @@ We specify the reference path to follow. We run the simulation and we save the results. #+begin_src matlab + set_param('stewart_platform_model', 'StopTime', '10') sim('stewart_platform_model') simout_X = simout; + save('./mat/control_tracking.mat', 'simout_X', '-append'); #+end_src ** Diagonal Control - Steady State Decoupling @@ -1106,7 +1101,6 @@ We have that $\bm{K}_0(s)$ commutes with $\bm{G}^{-1}(\omega = 0)$ and thus the *** Simulation Results The position error $\bm{\epsilon}_\mathcal{X}$ for both centralized architecture are shown in Figure [[fig:centralized_control_comp_Ex]]. -The corresponding leg's length errors $\bm{\epsilon}_\mathcal{L}$ are shown in Figure [[fig:centralized_control_comp_El]]. Based on Figure [[fig:centralized_control_comp_Ex]], we can see that: - There is some tracking error $\epsilon_x$ @@ -1177,31 +1171,6 @@ Based on Figure [[fig:centralized_control_comp_Ex]], we can see that: #+caption: Comparison of the position error $\bm{\epsilon}_\mathcal{X}$ for both centralized controllers ([[./figs/centralized_control_comp_Ex.png][png]], [[./figs/centralized_control_comp_Ex.pdf][pdf]]) [[file:figs/centralized_control_comp_Ex.png]] -#+begin_src matlab :exports none - figure; - hold on; - plot(simout_L.r.r.Time, squeeze(simout_L.r.rL.Data(6, 1, :))-simout_L.y.dLm.Data(:, 6), 'DisplayName', '$K_\mathcal{L}$') - plot(simout_X.r.r.Time, squeeze(simout_X.r.rL.Data(6, 1, :))-simout_X.y.dLm.Data(:, 6), 'DisplayName', '$K_\mathcal{X}$') - for i = 2:6 - set(gca,'ColorOrderIndex',1); - plot(simout_L.r.r.Time, squeeze(simout_L.r.rL.Data(i, 1, :))-simout_L.y.dLm.Data(:, i), 'HandleVisibility', 'off') - plot(simout_X.r.r.Time, squeeze(simout_X.r.rL.Data(i, 1, :))-simout_X.y.dLm.Data(:, i), 'HandleVisibility', 'off') - end - hold off; - xlabel('Time [s]'); - ylabel('$\epsilon_\mathcal{L}$ [m]'); - legend(); -#+end_src - -#+header: :tangle no :exports results :results none :noweb yes -#+begin_src matlab :var filepath="figs/centralized_control_comp_El.pdf" :var figsize="wide-normal" :post pdf2svg(file=*this*, ext="png") -<> -#+end_src - -#+name: fig:centralized_control_comp_El -#+caption: Comparison of the leg's length error $\bm{\epsilon}_\mathcal{L}$ for both centralized controllers ([[./figs/centralized_control_comp_El.png][png]], [[./figs/centralized_control_comp_El.pdf][pdf]]) -[[file:figs/centralized_control_comp_El.png]] - ** Conclusion Both control architecture gives similar results even tough the control in the Leg's frame gives slightly better results. @@ -1304,29 +1273,8 @@ This second loop is responsible for the reference tracking. [[file:figs/hybrid_reference_tracking.png]] ** Initialize the Stewart platform -#+begin_src matlab - stewart = initializeStewartPlatform(); - stewart = initializeFramesPositions(stewart, 'H', 90e-3, 'MO_B', 45e-3); - stewart = generateGeneralConfiguration(stewart); - stewart = computeJointsPose(stewart); - stewart = initializeStrutDynamics(stewart); - stewart = initializeJointDynamics(stewart, 'type_F', 'universal_p', 'type_M', 'spherical_p'); - stewart = initializeCylindricalPlatforms(stewart); - stewart = initializeCylindricalStruts(stewart); - stewart = computeJacobian(stewart); - stewart = initializeStewartPose(stewart); - stewart = initializeInertialSensor(stewart, 'type', 'accelerometer', 'freq', 5e3); -#+end_src - -#+begin_src matlab - ground = initializeGround('type', 'rigid'); - payload = initializePayload('type', 'none'); - controller = initializeController('type', 'open-loop'); -#+end_src - -#+begin_src matlab - disturbances = initializeDisturbances(); - references = initializeReferences(stewart); +#+begin_src matlab :noweb yes + <> #+end_src ** First Control Loop - $\bm{K}_\mathcal{L}$ @@ -1638,20 +1586,16 @@ Then we include the Jacobian in the controller matrix. ** Simulations We specify the reference path to follow. -#+begin_src matlab - t = linspace(0, 10, 10000); - - r = zeros(6, length(t)); - - r(1, :) = 5e-3*sin(2*pi*t); - - references = initializeReferences(stewart, 't', t, 'r', r); +#+begin_src matlab :noweb yes + <> #+end_src We run the simulation and we save the results. #+begin_src matlab + set_param('stewart_platform_model', 'StopTime', '10') sim('stewart_platform_model') simout_H = simout; + save('./mat/control_tracking.mat', 'simout_H', '-append'); #+end_src The obtained position error is shown in Figure [[fig:hybrid_control_Ex]]. @@ -1712,7 +1656,88 @@ The obtained position error is shown in Figure [[fig:hybrid_control_Ex]]. ** Conclusion -* Position Error computation +* Comparison of all the methods +<> + +Let's load the simulation results and compare them in Figure [[fig:reference_tracking_performance_comparison]]. +#+begin_src matlab + load('./mat/control_tracking.mat', 'simout_D', 'simout_L', 'simout_X', 'simout_H'); +#+end_src + +#+begin_src matlab :exports none + figure; + subplot(2, 3, 1); + hold on; + plot(simout_D.r.r.Time, squeeze(simout_D.r.r.Data(1, 1, :))-simout_D.x.Xr.Data(:, 1)) + plot(simout_L.r.r.Time, squeeze(simout_L.r.r.Data(1, 1, :))-simout_L.x.Xr.Data(:, 1)) + plot(simout_X.r.r.Time, squeeze(simout_X.r.r.Data(1, 1, :))-simout_X.x.Xr.Data(:, 1)) + plot(simout_H.r.r.Time, squeeze(simout_H.r.r.Data(1, 1, :))-simout_H.x.Xr.Data(:, 1)) + hold off; + xlabel('Time [s]'); + ylabel('Dx [m]'); + + subplot(2, 3, 2); + hold on; + plot(simout_D.r.r.Time, squeeze(simout_D.r.r.Data(2, 1, :))-simout_D.x.Xr.Data(:, 2)) + plot(simout_L.r.r.Time, squeeze(simout_L.r.r.Data(2, 1, :))-simout_L.x.Xr.Data(:, 2)) + plot(simout_X.r.r.Time, squeeze(simout_X.r.r.Data(2, 1, :))-simout_X.x.Xr.Data(:, 2)) + plot(simout_H.r.r.Time, squeeze(simout_H.r.r.Data(2, 1, :))-simout_H.x.Xr.Data(:, 2)) + hold off; + xlabel('Time [s]'); + ylabel('Dy [m]'); + + subplot(2, 3, 3); + hold on; + plot(simout_D.r.r.Time, squeeze(simout_D.r.r.Data(3, 1, :))-simout_D.x.Xr.Data(:, 3)) + plot(simout_L.r.r.Time, squeeze(simout_L.r.r.Data(3, 1, :))-simout_L.x.Xr.Data(:, 3)) + plot(simout_X.r.r.Time, squeeze(simout_X.r.r.Data(3, 1, :))-simout_X.x.Xr.Data(:, 3)) + plot(simout_H.r.r.Time, squeeze(simout_H.r.r.Data(3, 1, :))-simout_H.x.Xr.Data(:, 3)) + hold off; + xlabel('Time [s]'); + ylabel('Dz [m]'); + + subplot(2, 3, 4); + hold on; + plot(simout_D.r.r.Time, squeeze(simout_D.r.r.Data(4, 1, :))-simout_D.x.Xr.Data(:, 4)) + plot(simout_L.r.r.Time, squeeze(simout_L.r.r.Data(4, 1, :))-simout_L.x.Xr.Data(:, 4)) + plot(simout_X.r.r.Time, squeeze(simout_X.r.r.Data(4, 1, :))-simout_X.x.Xr.Data(:, 4)) + plot(simout_H.r.r.Time, squeeze(simout_H.r.r.Data(4, 1, :))-simout_H.x.Xr.Data(:, 4)) + hold off; + xlabel('Time [s]'); + ylabel('Rx [rad]'); + + subplot(2, 3, 5); + hold on; + plot(simout_D.r.r.Time, squeeze(simout_D.r.r.Data(5, 1, :))-simout_D.x.Xr.Data(:, 5)) + plot(simout_L.r.r.Time, squeeze(simout_L.r.r.Data(5, 1, :))-simout_L.x.Xr.Data(:, 5)) + plot(simout_X.r.r.Time, squeeze(simout_X.r.r.Data(5, 1, :))-simout_X.x.Xr.Data(:, 5)) + plot(simout_H.r.r.Time, squeeze(simout_H.r.r.Data(5, 1, :))-simout_H.x.Xr.Data(:, 5)) + hold off; + xlabel('Time [s]'); + ylabel('Ry [rad]'); + + subplot(2, 3, 6); + hold on; + plot(simout_D.r.r.Time, squeeze(simout_D.r.r.Data(6, 1, :))-simout_D.x.Xr.Data(:, 6), 'DisplayName', 'Decentralized - L') + plot(simout_L.r.r.Time, squeeze(simout_L.r.r.Data(6, 1, :))-simout_L.x.Xr.Data(:, 6), 'DisplayName', 'Centralized - L') + plot(simout_X.r.r.Time, squeeze(simout_X.r.r.Data(6, 1, :))-simout_X.x.Xr.Data(:, 6), 'DisplayName', 'Centralized - X') + plot(simout_H.r.r.Time, squeeze(simout_H.r.r.Data(6, 1, :))-simout_H.x.Xr.Data(:, 6), 'DisplayName', 'Hybrid') + hold off; + xlabel('Time [s]'); + ylabel('Rz [rad]'); + legend(); +#+end_src + +#+header: :tangle no :exports results :results none :noweb yes +#+begin_src matlab :var filepath="figs/reference_tracking_performance_comparison.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png") +<> +#+end_src + +#+name: fig:reference_tracking_performance_comparison +#+caption: Comparison of the position errors for all the Control architecture used ([[./figs/reference_tracking_performance_comparison.png][png]], [[./figs/reference_tracking_performance_comparison.pdf][pdf]]) +[[file:figs/reference_tracking_performance_comparison.png]] + +* Compute the pose error of the Stewart Platform <> Let's note: @@ -1813,3 +1838,46 @@ Now we want to express ${}^VT_R$: Erx = atan2(-T(2, 3)/cos(Ery), T(3, 3)/cos(Ery)); Erz = atan2(-T(1, 2)/cos(Ery), T(1, 1)/cos(Ery)); #+end_src + +* Useful Blocks :noexport: +** Initialize Simulation +#+name: init-sim +#+begin_src matlab + % Stewart Platform + stewart = initializeStewartPlatform(); + stewart = initializeFramesPositions(stewart, 'H', 90e-3, 'MO_B', 45e-3); + stewart = generateGeneralConfiguration(stewart); + stewart = computeJointsPose(stewart); + stewart = initializeStrutDynamics(stewart); + stewart = initializeJointDynamics(stewart, 'type_F', 'universal_p', 'type_M', 'spherical_p'); + stewart = initializeCylindricalPlatforms(stewart); + stewart = initializeCylindricalStruts(stewart); + stewart = computeJacobian(stewart); + stewart = initializeStewartPose(stewart); + stewart = initializeInertialSensor(stewart, 'type', 'accelerometer', 'freq', 5e3); + + % Ground and Payload + ground = initializeGround('type', 'rigid'); + payload = initializePayload('type', 'none'); + + % Controller + controller = initializeController('type', 'open-loop'); + + % Disturbances and References + disturbances = initializeDisturbances(); + references = initializeReferences(stewart); +#+end_src + +** Initialize Reference Path +#+name: init-ref +#+begin_src matlab + t = [0:1e-4:10]; + + r = zeros(6, length(t)); + + r(1, :) = 1e-3.*t.*sin(2*pi*t); + r(2, :) = 1e-3.*t.*cos(2*pi*t); + r(3, :) = 1e-3.*t; + + references = initializeReferences(stewart, 't', t, 'r', r); +#+end_src