# Plotting a relation from a describing equation - optimized trapezoidal steering optimization

15 views (last 30 days)
Igor Kuszczak on 15 Oct 2019
Commented: Batuhan Yükseker on 22 Sep 2021
I am trying to write a program which will allow me to quantify how optimized trapezoidal steering differs from the exact Ackerman steering for a given set of steering parameters (). To do that I want to find the root mean square error between the outer angle in trapezoidal steering () and in Ackerman steering () for a given inner angle .
The Ackerman relation is described by the following equation (1):
Optimized trapezoidal steering steering is described by (2):
To find , I created two vectors - one corresponding to the inner angles and the one to the outer angles. Then for each inner angle (in a loop) I substituted the whole vector of outer angles into eq. 2 and looked for the outer angle which results in being minimal. Below is my code:
close all
clear all
%% Constants
W = 2400; %track width in mm
L = 4800; %wheelbase in mm
D = 400; % steering arm length
B = 8* (pi/180); % angle beta with conversion to radians
in_vec = -40:40 ; %vector of inner angles in degrees
out_vec = -50:1e-3:50; %vector of outer angles for comparisons (much wider in span)
outer_a(1,i) = acot(W/L+cot(in_vec_rad(1,i))); %ackerman outer angles
% here I look for outer angle value that makes the offset the smallest
[numt,idxt]=min(offset_t);
end
figure(1)
grid on
hold on
legend('Location','best');
The problem I am facing is that the final plots as a straight line. Is the approach generally incorrect or is there something wrong in the code?

Pranav Murali on 19 Mar 2020
Hi Igor,
I see that you’ve been trying to visualize the difference between optimized trapezoidal and Ackerman steering. Finding out the root mean square error between the outer angles of Ackerman and optimized trapezoidal steering seems to be a promising approach. The code is does exactly what you have described. However, output angle is the only parameter that changes inside the loop.
Since all the other terms inside your formula are constants, the offset depends directly on the array of output angles. The vector storing the output angles you have created is linearly spaced. This causes the result also to be a linearly increasing vector since there is no relationship between a variation in the output angle to any other term in the equation. The smallest element is always at the first position. Hence you arrive at the output that is visible, your current method will produce the same pattern as it is directly related to the smallest element in the output angle vector.

Robert Shaefer on 12 Apr 2021
there is an error in the equation (2). It should read:
....= w/d "minus" sqrt(....
Batuhan Yükseker on 22 Sep 2021
Hi can you share updating code on script? İt is not understood =w/d 'minus'sqrt(.. Where will we write in equation 2?

R2019a

### Community Treasure Hunt

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

Start Hunting!

Translated by