New and need to represent (1,1) using simulink?

5 views (last 30 days)
Hello everyone,
I am new to the world of simulation and i'm trying to get my 'foot' through the door. I have been creating little models here and there but nothing major. I want to challenge myself and do something more complex.
I thought about simulating a car moving on an X,Y plane and wnated to see its 'location' changes over time.
the first issue I faced is how to represent both X,Y in simulink? say I need to make the intial location of the object/ car to be (0,0) then moves over time based on the configs of a PID then I would need to visually see what happens after like 10 second. Where is the new location of the car be?
How can I do that? Which blocks would allow me to do that?
Thanks again!

Answers (1)

Animesh
Animesh on 21 Aug 2023
Hello Ahmed,
You can use the XY Graph block in Simulink to visualize the movement of a car on an X, Y plane. The XY Graph block is an alternative configuration of the Record block that plots two input signals on an XY plot. The first input port provides the x data for the XY plot, and the second input port provides the y data. You can use this block to plot the X and Y coordinates of your car over time.
You can also use a combination of other blocks to simulate the movement of your car based on the configurations of a PID controller. For example, you can use a PID Controller block to control the movement of your car and feed its output into an Integrator block to obtain the position of your car over time. You can then feed the output of the Integrator block into the XY Graph block to visualize the movement of your car on an X, Y plane.
Thanks,
Animesh Jha
  1 Comment
Ahmed Alhamadah
Ahmed Alhamadah on 21 Aug 2023
I express my sincere gratitude for your invaluable assistance.
The guidance you have provided is of immense value, particularly as I find myself relatively new to this domain. The intricacies of comprehending the software's functionalities can be quite daunting, especially when tasked with undertaking a major project right from the outset. Nonetheless, I am genuinely appreciative of your assistance.
Allow me to pose another inquiry. The system at hand is composed of various sections or blocks that necessitate creation. I am seeking your expert insight regarding a plausible approach to be employed within this system.
Here is a comprehensive breakdown of the system:
The system in question pertains to an autonomous vehicle that relies on GPS for location determination. Due to the complexities involved, I have chosen to employ a 'step' block exclusively for this purpose.
Subsequently, the output generated from this initial step is channeled into a Proportional-Integral-Derivative (PID) controller and then into a state space model. This choice is influenced by the specific configurations inherent to the physical counterpart of the system.
Ultimately, the information furnished by the state space model or the PID controller interfaces with a simplistic motor or an equivalent component capable of fulfilling such a function. It's important to note that I am currently in the process of refining this component selection.
Furthermore, the positional data undergoes updates and is looped back to the PID controller, thereby accounting for positional changes over time.
The desired outputs encompass the vehicle's heading angle, cross-track error, yaw angle, acceleration, as well as the positional coordinates (both x and y) as they evolve over time.
It is pertinent to acknowledge that I have not delved into the specifics of the integrator block, as my understanding of which specific block(s) might yield the desired outputs is still evolving.
I am cognizant of the fact that the complexity of this inquiry surpasses that of my previous question. Nevertheless, I earnestly welcome any insights or feedback you may impart, which would undoubtedly facilitate a more refined and methodical approach to my endeavors.

Sign in to comment.

Products


Release

R2023a

Community Treasure Hunt

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

Start Hunting!