trapezoidal operation in velocity-time graph

Hi guys,
I want to make trapezoidal operation in velocity-time graph. Like below.
How can i do it?

4 件のコメント

Mathieu NOE
Mathieu NOE 2021 年 1 月 12 日
hello
so the signal can be splitted in sections separated by at least one zero (or something very small)
then each section can be post processed and the results concatenated to get the entire output
now what are the "red" curve characteristics :
  • rising slope
  • falling slope
  • plateau value ( = mean of blue signal in that section ? )
have you already a code to plot those data ? can you share it with the input data ?
tx
Irfan Ahmet YILDIRIM
Irfan Ahmet YILDIRIM 2021 年 1 月 12 日
編集済み: Irfan Ahmet YILDIRIM 2021 年 1 月 12 日
Hi Mathieu,
Thanks for response,
The blue chart is a classic wltp loop. I am uploading from Excel to Matlab. You can find any wltp cycle on google.
This include just instant velocity and time datas.
I want to produce the curve that completes the same path as the average velocity (plateau value) of the vehicle and the minimum upward slope between both points in motion.
At the same time, I must be able to determine the slope of rising and falling myself.
Kind regards.
Mathieu NOE
Mathieu NOE 2021 年 1 月 12 日
OK
let me know if you need further assistance
Irfan Ahmet YILDIRIM
Irfan Ahmet YILDIRIM 2021 年 1 月 12 日
I'm trying "trapveltraj" code but unfortunately I have not solved yet.

サインインしてコメントする。

回答 (1 件)

Zuber Khan
Zuber Khan 2024 年 9 月 16 日
編集済み: Zuber Khan 2024 年 9 月 18 日

0 投票

Hi,
You can use MATLAB's "trapveltraj" function to create a trapezoidal velocity-time profile as shown. This function is typically used to generate trapezoidal velocity profiles for motion trajectories.
You can follow the below mentioned steps for same.
  • Compute the total distance travelled using the given velocity-time data. This can be done by integrating the velocity over time. One such way to calculate it is by using the "trapz" function as shown below.
totalDistance = trapz(time, velocity);
For more information on "trapz" function, you can refer to the following documentation.
  • Calculate the average velocity over the entire cycle, which will be the plateau value of your trapezoidal profile.
  • Define the acceleration and deceleration slopes based on your requirements.
  • Then, you can use "trapveltraj" to generate the velocity profile. Kindly note that you will need to specify the waypoints and the desired time for each segment (acceleration, constant velocity, deceleration). You can refer to the following code snippet as an example.
waypoints = [0,averageVelocity,averageVelocity,0];
timePoints = [0,accelerationTime,accelerationTime + constantVelocityTime, ...
accelerationTime + constantVelocityTime + decelerationTime];
[q,qd,qdd,tSamples,pp] = trapveltraj(waypoints, numel(timePoints), ...
'AccelTime', accelerationTime);
You can also specify additional name-value arguements in the "trapveltraj" function based on the available information. For better understanding on "trapveltraj" function, kindly refer to the following documentation.
Although, it is difficult to arrive at an exact solution without the given data or specific code, but I hope it helps.
Regards,
Zuber

カテゴリ

ヘルプ センター および File ExchangeGeneral Applications についてさらに検索

製品

リリース

R2020b

質問済み:

2021 年 1 月 11 日

編集済み:

2024 年 9 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by