How to seamlessly combine the two inputs given to the prismatic joint

2 views (last 30 days)
Hello, I am currently conducting research on the 6-degree-of-freedom motion control of a Stewart platform using Simulink. I am creating the movement of the top platform by applying force input to the prismatic joints of the Stewart platform.
The algorithm conditions are as follows:
  1. 20-second simulation
  2. Raise the actuators to the neutral position of 3.52m with a heave motion until 10 seconds.
  3. Control the actuators to implement 6-degree-of-freedom motion from 10 seconds to 20 seconds.
Currently, I have completed the process of raising the actuators to the neutral position of 3.52m in step 2. However, to ensure continuity between step 2 and step 3, I need the input from step 2 and the input from step 3. I have implemented the inputs for both steps, but I am having difficulty combining the two inputs at the 10-second mark. Specifically, the actuators should rise to 3.52m until 10 seconds, and another input should be applied until 20 seconds in a continuous manner. I do not know how to make this transition smooth and continuous.
  1 Comment
Umar
Umar on 28 Jul 2024

Hi 석준 ,

To achieve a smooth and continuous transition between the inputs at the 10-second mark in your Stewart platform simulation, you need to carefully manage the changeover between the two sets of inputs. This can be done by interpolating between the initial heave motion and the subsequent 6-degree-of-freedom motion. Here is a sample code snippet that demonstrates it.

% Define parameters

total_time = 20; % Total simulation time in seconds

neutral_position = 3.52; % Neutral position in meters

time_steps = 1000; % Number of time steps

time = linspace(0, total_time, time_steps); % Time vector

% Generate input for heave motion (0 to 10 seconds)

heave_input = neutral_position * (time <= 10);

% Generate input for 6-degree-of-freedom motion (10 to 20 seconds)

dof6_input = sin(2*pi*(time-10)/10); % Example input for demonstration

% Combine inputs at the 10-second mark

transition_input = heave_input .* (time <= 10) + dof6_input .* (time > 10);

% Plot the combined input for visualization

figure;

plot(time, transition_input, 'LineWidth', 1.5);

xlabel('Time (s)');

ylabel('Position (m)');

title('Combined Input for Smooth Transition at 10-second Mark');

grid on;

So, I define the parameters such as total simulation time, neutral position, and the number of time steps, generated inputs for heave motion (0 to 10 seconds) and 6-degree-of-freedom motion (10 to 20 seconds) and then combine the inputs at the 10-second mark using element-wise multiplication and addition. As an option, plot the combined input to visualize the smooth transition at the 10-second mark. Please see attached plot for results.

Hope, this answers your question.

Sign in to comment.

Answers (0)

Tags

Products


Release

R2023b

Community Treasure Hunt

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

Start Hunting!