Looking for sensor in simulink to sense distance between two vehicles
11 views (last 30 days)
Show older comments
I am trying to find a sensor in the simulink library to detect distance between two vehicles. I am doing my final year project which is a fuzzy logic collision avoidance system. I am trying to model it using matlab and simulink. Can anyone point me in the right direction with respect to where i can find the sensor input in the library? Also i am looking for one to detect the rate of change in velocity of the vehicle in front of the other one.
0 Comments
Answers (2)
K E
on 27 Mar 2012
If you find it easier to code in Simulink, build your distance calculator out of blocks in the Math Operations library. For example, use the Sqrt, Product and Difference blocks to find [2D Distance between Vehicle1 and Vehicle2] = sqrt((x1 - x2)^2 + (y1 - y2)^2), where you are operating on the Cartesian coordinates of vehicle 1 and vehicle 2 (make sure they are in meters not latitude/longitude). You could use the Derivative block to calculate the vector acceleration (rate of change of velocity). If you find it easier to code in Matlab, export the time series of x1, x2, y1, and y1 to the Matlab workspace using the 'ToWorkspace' block and perform the calculation there. Then you could also perform the vector calculation of acceleration.
2 Comments
K E
on 30 Mar 2012
I had imagined two vehicles on a road, each with a GPS sensor which measures x and y coordinates. But it sounds like your have two vehicles driving along a straight track. If you have a measurement of the displacement of vehicle 1 and vehicle 2 along the track, then you would double differentiate each vehicle's displacement in time to obtain the rate of change of velocity (i.e. acceleration). If the only available measurement is the distance between the two vehicles, then I am not sure you have enough information to obtain the acceleration of vehicle 1. The closest you might be able to get is the difference in acceleration between vehicle 1 and vehicle 2, which could obtain by writing out the finite difference formula (http://en.wikipedia.org/wiki/Finite_difference) for the second derivative of position of each vehicle, subtracting one from the other, and rearranging to get the difference in acceleration in terms of the distance between vehicle 1 and vehicle 2.
saad
on 1 Jun 2025
Throughout the plastic sorting line, many physical quantities must be measured for a reliable automation of the process. Such as the existence of an item at certain positions, distance of certain objects from a reference point, speed of a motor-driven shaft and most importantly colour recognition. You proposed making an optical measurement system using a simple lightemitting diode (LED) and a light-dependent resistor (LDR), that can be used for all those tasks using a smart component, a micro-processor. The production manager requested a prototype to demonstrate the idea, and a simulation model (using MATLAB) of the design, reflected in a technical report that explains your design and procedure.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!