how can i have step input signal in signal editor?
1 Comment
Hi @elham,
You asked, “ How should I enter the time and data inputs in the Signal Editor? ”
Please see my response to your comments below.
You have three signals (x, y, z) that represent positions or movements of the SCARA robot, and you want to configure these signals in the Signal Editor with respect to specific time intervals. You also provided the time data, indicating how these signals change over time. Using the information you've given, access the Signal Editor via the command line by typing signalEditor or through the Root Inport Mapper by selecting Signals > New MAT-File. Select Insert > Signal to create a new signal. You will need to repeat this process for each of your signals (x, y, z). For each signal, you will need to enter the time (t) and the corresponding data values ( x, y, z). Here’s how to do it:
For Signal x, in the Author Signal dialog box, set: Time: [0, 1, 1.5, 2, 3, 4, 4.5, 5, 6] Data: [1.412, 0.8696, 1.412, 1.412, 1.821, 1.545, 1.8312, 2.382, 1.412]
For Signal y, Set: Time: [0, 1, 1.5, 2, 3, 4, 4.5, 5, 6] Data:[-3.142, -2.088, -3.142, -3.142, -3.142, -2.31, -3.142, -3.142, -3.142]
For Signal z,Set: Time: [0, 1, 1.5, 2, 3, 4, 4.5, 5, 6] Data: [-0.086, -0.086, -0.086, -0.186, -0.186, -0.186, -0.186, -0.386, -0.086]
After entering the data, you can modify properties such as the signal name, unit, and interpolation method. This can be done in the Signal Properties section. Once the signals are entered, you can visualize them on the plot. If the signals do not align as expected, you can adjust them using the Snap to Grid feature for better precision.
To save your work, select the Save button in the Signal Editor. This will create a MAT-file that can be used for simulations or linked to root-level ports.
For more information regarding creating and editing a signal, please refer to the following documentation at the link provided below.
https://www.mathworks.com/help/simulink/ug/insert-and-edit-signal-data.html
Hope this helps. Please let me know if you have any further questions.
Answers (2)

5 Comments
0 votes
Hi @elham,
To achieve a step input configuration, you need to make that the data values remain constant until the next specified time point. For instance:
For signal x, if you want it to rise at t = 1 and stay constant, the structure should look like: From (t = 0 ) to (t = 1 ), Constant value (e.g., 1.412). At (t = 1) Jump to a new constant value (e.g., 1.821). From here on, continue at the new value for the remaining duration.
Here’s how to arrange the data for each signal:
Rearranging Data for Step Inputs
Signal x
Time: [0, 1, 2, 3, 4, 5, 6]
Data: [1.412, 1.412, 1.821, 1.821, 1.8312, 2.382, 1.412] Signal
Time: [0, 1, 2, 3, 4, 5, 6]
Data: [-3.142, -3.142, -2.31, -2.31, -2.31, -3.142, -3.142] Signal z
Time: [0, 1, 2, 3, 4, 5, 6]
Data: [-0.086, -0.086, -0.186, -0.186, -0.186, -0.386, -0.086]Entering Data in Signal Editor
At this point, I know that you are already familiar with Signal Editor but I will provide instructions anyway like I did in my previous comments as outlined below.
Open Signal Editor via the command line by typing signalEditor or select Signals > New MAT-File through the Root Inport Mapper.
For each signal (x, y, z) Select Insert > Signal
In the Author Signal dialog box, enter the rearranged time and data values as outlined above. Modify properties like the signal name, unit, and interpolation method in the Signal Properties section.
Visualizing the Step Inputs
After entering all signals, visualize them on the plot within the Signal Editor. If necessary, use the Snap to Grid feature to fine-tune the data points for better alignment.
Saving the Configuration
Once satisfied with the setup, click the Save button to create a MAT-file for further simulations or linking to root-level ports.
Please make sure that you select the appropriate interpolation method (e.g., "Zero-Order Hold") for step inputs to maintain the desired constant value between the defined time intervals.
In case, you need more guidance or you need detailed steps on signal creation and editing, I will consider reviewing the official MathWorks documentation:
https://www.mathworks.com/help/simulink/ug/insert-and-edit-signal-data.html
Hope, at this point you should be able to configure the SCARA robot signals effectively in the Signal Editor and represent them as step inputs as required. Please let me know if this helped resolve your problem.
25 Comments

Hi @Sam Chak,
Thanks for providing clarification regarding @Elham issue. However, I did notice the screenshot and you are using signal editor but when I tried to study the documentation, it displayed the following message. Apparently it was introduced for Matlab version R2007a. Afterwards, for version R2019a, they stopped recommending it and advice to use signalEditor instead. Please see attached.

Hi @Elham,
Could you please share the link to video that involves implementing the pattern on your robot’s data, so we can match apples to apples.
Hi @Elham,
Please see my response to your comments below.
You mentioned,“ I've watched the video multiple times to implement the pattern on my robot's data, but I still haven't achieved satisfactory results. That's why this question has arisen in my mind, wondering if there are specific calculations involved. “
So, after watching the video link provided by you, the author is creating three step signals corresponding to the robot's joint angles using the Signal Builder dialog. He defined the following parameters for each step signal as
Signal 1: Step amplitude of 0.2 radians, activating at 0.5 seconds.
Signal 2: Step amplitude of 0.4 radians, activating at 1.5 seconds.
Signal 3: Step amplitude of 0.3 radians, activating at 2 seconds.
Then, he dragged the necessary blocks to represent three-degree-of-freedom (3-DOF) manipulator by including blocks for the robot's dynamics and kinematics. Afterwards, he connected the output of the Signal Builder to the inputs of the robot model to feed the joint angles and also connected the output of robot model (joint angles) to the PID Controller input. Also, using the Scope to compare the reference trajectory (from the Signal Builder) with the actual trajectory output from the robot model. The reason for your error was due to x,y, and z data not set in radians.
However, I did some research and found a video link that should help you achieve your goal using signal editor in simulink.
https://youtu.be/5494D0X7nf4?si=wfi0CNV6H4rXwEbw
Hope this answers your question.
Hi @elham,
To address your question effectively, I need to break down the process of defining step inputs for your robot's joint angles in a systematic manner. The key aspects to consider are the amplitude of the step signals, the timing of these signals, and how they relate to your specific data.
Understanding Step Inputs
In the context of control systems and robotics, step inputs are used to simulate changes in the desired state of a system—in this case, the joint angles of your robot. The step inputs you mentioned (0.2 radians at 0.5 seconds, 0.4 radians at 1.5 seconds, and 0.3 radians at 2 seconds) are designed to represent specific commands to the robot's joints over time.
Determining Amplitude Values
The amplitude values for your step inputs should be based on the operational range of your robot's joints. If your data indicates that the maximum value of signal x is 2.382, you might consider using this value as a reference point. However, it is crucial to ensure that the values you choose do not exceed the physical limits of your robot's joints. For instance, if your robot's joint can safely operate within a range of -2.5 to 2.5 radians, then using a step input of 2.382 radians is acceptable. If you want to create a more gradual response, you might opt for lower values, such as 1.5 or 2.0 radians, depending on the desired performance.
Timing Sequence
The timing of your step inputs is equally important. The times (0.5, 1.5, and 2 seconds) in the example you provided were likely chosen based on the dynamics of the robot and the desired response time. To determine appropriate timing for your signals, consider the following:
Response Time: How quickly do you want your robot to respond to changes in joint angles? If your robot has a fast response time, you may want to use shorter intervals between step inputs.
Data Analysis: Analyze your data to identify key moments where changes in joint angles occur. For example, if your data shows significant changes at specific timestamps, you can align your step inputs with these moments.
Simulation Testing: It may be beneficial to run simulations with various timing sequences to observe how your robot responds. This iterative approach allows you to fine-tune the timing based on performance.
Here’s a structured guide to help you effectively utilize the Signal Editor in Simulink for robot control based on the video link that I shared with you.
https://youtu.be/5494D0X7nf4?si=wfi0CNV6H4rXwEbw
Configure Signal Editor
Double-click on the Signal Editor block to open its properties. In the Signal Properties settings, click the button to create new signals. A new window will open displaying the scenario for your signals.
Create Signals for Each Joint
You will need to create three signals corresponding to the three joints of your robot:
For Joint 1:
Click on the checkbox to reveal the existing signal (it will be blank initially).
Double-click on the signal name and rename it to Joint 1.
Add rows by clicking the appropriate button and enter the time values:
Time: 0, 0.5, 1, 1.5, 2, 4 Data: 0, 50, 110, 110, 60, 0
Right-click on the plot area and select Zoom and Pan > Fit to View to visualize the signal.
For Joint 2:
Right-click in the Signal Editor and select Insert > Blank Signal Rename this signal to Joint 2.
Enter the time and data values: Time: 0, 0.5, 1, 1.5, 2, 4 Data: 0, 45, 60, 60, 20, 0
Hide this signal by unchecking the checkbox next to it.
For Joint 3:
Insert another blank signal and rename it to Joint 3. Enter the time and data values:
Time: 0, 1.5, 2, 3, 4 Data: 0, 4, 0, 0, 0
Make sure this signal is checked to display.
Define Signal Units and Interpolation
Click on each signal and specify their units:
Joint 1: Degrees Joint 2: Degrees Joint 3: Meters
Check the Interpolate Data option for each signal to ensure smooth transitions between data points. Click Apply after setting units and interpolation for each joint.
Save Your Configuration
Before closing the Signal Editor, save your configuration by clicking on the save icon or using File > Save. Name your signal file appropriately for future reference.
Connect to the Robot Model
Use appropriate blocks (like the PS Converter) to convert the degrees to radians if necessary, ensuring that the robot receives the correct input format. Connect the outputs of the Signal Editor to the inputs of your robot model.
Run the Simulation
Click on the Run button in Simulink to start the simulation. Observe the robot’s movements according to the defined trajectories
Hopefully, following these instructions should help you get started with project now.
Hi @Elham,
After observing the plots you provided shows minor oscillations and watching the YouTube video which was shared by you does not show any oscillations as shown attached.


So, based on these observations, I am drawing the following conclusions due to the oscillations on your plot:
*The PID gains (P, I, D) may not be set optimally, leading to excessive overshoot and oscillations.
*The initial values of the integrator or other states in the PID controller might be causing transient behavior.
*If the system is using a discrete-time controller, the sampling time may not be configured properly, leading to aliasing or instability.
*The system may be improperly configured regarding the PID block and its parameters, such as external reset or tracking mode.
To mitigate these oscillations, consider the following approaches:
Damping Adjustment: Check the parameters of your system, particularly the damping ratio. Increasing the damping ratio can help reduce oscillations.
Input Smoothing: Instead of a step change, you might want to implement a smoother transition using a ramp or a sigmoid function to gradually increase the input value.
Simulation Settings: Make sure that your simulation settings, such as the solver type and step size, are appropriate for the dynamics of your system. A smaller step size may yield more accurate results.
Here’s a simple example of how to implement a smoother input using a ramp function:
time = [0 0.5 10]; data = [0 2.382 2.382]; ramp_time = linspace(0, 0.5, 100); ramp_data = linspace(0, 2.382, 100);
If the problem still persists after following above mentioned steps, review the PID controller documentation
https://www.mathworks.com/help/simulink/slref/pidcontroller.html
Also, review the YouTube video shared by you.
*Make sure feedback loop is correctly configured to prevent unexpected oscillations.
*When making adjustments, change one parameter at a time to isolate effects and understand their contributions to the oscillation behavior.
Hope, this should help resolve your problem.
- Rearranging Data for Step Inputs
- Entering Data in Signal Editor
- Visualizing the Step Inputs
- Saving the Configuration
- Understanding Step Inputs
- Determining Amplitude Values
- Timing Sequence
- Response Time
- Data Analysis
- Simulation Testing
- Configure Signal Editor
- Create Signals for Each Joint
- Save Your Configuration
- Connect to the Robot Model
- Run the Simulation
- Damping Adjustment
- Input Smoothing
- Simulation Settings
Categories
Find more on ROS Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
