pulse disturbance signal generator

Hi Please can anyone help on how to generate a pulse disturbance to test the robustness of my second order sliding mode control system. My system runs fine for 10,000 seconds. I need to apply pulse distrubance to test the robusteness. However, I could only add pulse disturbace that run the entire time of the simulation time which is 10,000 seconds. I believe disturbance should just run a fraction of the entire simulation time. for instance for 100s out of the 10,000s simulation time. Please how do i generate such pusle disturbance that would not run the entire simulation time. I want it to run for may be 100 seconds or 200s of the 10,000 seconds of the simulation time.
thank you

 Accepted Answer

Jon
Jon on 15 Sep 2020
How are you running your simulation? Is it in Simulink?
In Simulink you can use a From Workspace block to create an arbitrary signal. Use this to create your desired disturbance and connect it appropriately in your diagram to apply the disturbance.

6 Comments

I am runing my simulation on simulink with function blocks as attached. Sorry I dont seem to get how to use the 'from Workspace block' as you explained. I want an input pulse disturbance into the system. However, not to run the entire druration of the simulation but a fraction like 100 seconds. Thank you for your response. I would be glad for detailed explanation
Jon
Jon on 15 Sep 2020
Edited: Jon on 15 Sep 2020
You would replace the pulse generator block with the From Workspace block.
You would generate your desired pulse sequence and assign it to a variable (for example by typing on the command line or in a script that runs before the simulation starts)
The pulse signal you define would be set to zero up to the time you want the pulses to start, then you would have some number of pulses, in which you would make the signal go up and down and then finally be zero again up to the stop time of your simulation (e.g. 10,000 sec).
You could also use the signal editor block to edit an arbitrary pulse sequence graphically
While you could do it as I described above, here is another, maybe more straightforward approach.
The idea is that you switch your pulse inputs on and off during some selected time window. So you connect your standard pulse generator block to a switch block which switches between the pulse signal and a zero signal. You then put some logic so the switch is set to the pulse during the desired short duration sometime in the middle (or whenever) in your simulation. I have attached a model which illustrates the idea. Note you will have to use the horizontal zoom on the scope to see the details of when the pulses occcur.
Thank you I have figured it based on your recomendations
Thank you so much. I will figue this as well. I really appreciate the answers . Thank Thank Thank you
Glad you were able to make progress. Good luck going ahead

Sign in to comment.

More Answers (0)

Categories

Find more on Simulink in Help Center and File Exchange

Products

Release

R2020a

Asked:

on 15 Sep 2020

Commented:

Jon
on 16 Sep 2020

Community Treasure Hunt

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

Start Hunting!