1D Angular Motion with different velocity stages

In summary: Plotting the theta valuesplot(t,theta);xlabel('Time (s)');ylabel('Theta (rad/s^2)');In summary, the author attempted to solve a kinematic problem involving a rotational joint by using 1) to calculate the acceleration and deceleration at
  • #1
Darkbound
22
0

Homework Statement


I am solving a kinematic problem, where I have a link that is attached to a rotational joint. I need to find the position of the joint for t=0..8, and I need to do it for every 0.01s. The problem comes from the fact that I have three stages for the velocity, during t = 0..0.1 it is accelerating, during t = 0.1..7.7 it maintains a constant velocity, and in t = 7.7..8 it is decelerating until it reaches 0.
I know:
initial θ = 20° = 0.3491 rad
The constant velocity for the second interval which is 0.1666667 rad/s

Homework Equations


1) a = v/t
2) x = x0 + vt + 1/2 * a * t^2
3) v = v0 + a*t
I will use x instead of theta in the equations bellow

The Attempt at a Solution


I used 1) to find the acceleration at the end point of the first time interval and the acceleration at the end point of the 3rd interval.
The way I approached it is, I know that in 0.1 seconds I need to reach the given velocity, so I just divided the velocity by the time
a_t1 = v/t = 1.6666667 rad/s^2
And the same for the deceleration, a_t3 = v/t = 0.55556 rad/s^2
Then I used these three equations to find the final angle:
x1(t) = x0 + v * t1 + 1/2 * a * t1^2 = 0.3491 + 0 * 0.1 + 1/2 * 1.666667 * 0.1^2 = 0.3574 rad
x2(t) = x1 + v * (t2 - t1) + 1/2 * a * (t2 - t1)^2 = 0.3574 + 0.166667 * (7.7 - 0.1) + 1 / 2 *0 * (7.7 - 0.1)^2 = 1.6241 rad
x3(t) = x2 + v * (t3 - t2) + 1/2 * a * (t3 - t2)^2 = 1.6241 + 0.166667 * (8 - 7.7) - 1/2 * 0.55556 * (8 - 7.7)^2 = 1.6491 rad
Or in degrees 94.485 degrees (I am calculating it with matlab, so allow for a tiny rounding error)

My first question is if that number is correct.

My second issue is, as I mentioned in the beginning, I need to be able to do it for a given time delta for the full motion, like every 0.01 second, and I should still arrive at the same number in the end, its after all the same motion just broken down into many tiny motions.
The way I tried to approach this is to again use three equations for the three time periods, but I also recalculated the velocity for every moment, since after the initial t=0 I have initial and final velocities, so the equations I used are:
v1(tnew) = v1(tnew - told) + a * (tnew - told)
x1(tnew) = x1(told) + v1old*(tnew - told) + 1/2 * acc * (tnew - told)^2

x2(tnew) = x2(told) + v2*(tnew - told)

v3(tnew) = v3(tnew - told) - 1/2 * acc * (tnew - told)^2
x3(tnew) = x3(told) + v3old*(tnew - told) - 1/2 * acc * (tnew - told)^2

The angle that I get after these calculations is 1.6474 radians or 94.387 degrees, which is very close to my other calculation. I am doing these calculations with MATLAB, so I don't know if there's simply some rounding error that adds up and causes the answer to be off by a little, theta is being recalculated 800 times, or if there is some issue with my formulas.
If I compare the results for both of my calculations I get:

x1 with t = 0.1 and my x1(tnew) when it reaches t=0.1, they both are the same
x2 with t = 7.7 and x2(tnew) when it reaches t = 7.7, I get 1.62406585... vs 1.62403807... or 93.052111 vs 93.0505273... degrees
x3 with t = 8 and x3(tnew) when it reaches t = 8, 1.6473714... vs 1.6490658... or 94.48451... vs 94.387482...
And most of the calculations happen with x2, so i am suspecting that mostly the error is in my final equation for x3

This is my MATLAB code
w2real = 0.1/6;
theta0 = deg2rad(20); % Initial angle of joint 2
t = [0 0.01:0.01:8]; % Time vector for the full motion
a2acc = w2real / 0.1; % Acceleration of joint 2
a2dec = w2real / 0.3; % Deceleration of joint 2

theta = zeros(size(t));
w2theta = zeros(size(t));
% Populating the first elements of d and theta with the initial conditions
theta(1) = theta0;

% Calculating theta at 3 points - t = 0:0.1, t = 0.1:7.7, t = 7.7:8
ntheta1 = theta0 + a2acc * tacc^2 / 2;
ntheta2 = ntheta1 + w2real * tnorm;
ntheta3 = ntheta2 + w2real * tdec - 1/2 * a2dec * (tdec)^2;

for n = 2:size(t, 2)
m = n - 1;
if (t(n) >= 0 && t(n) <= 0.1)
% acceleration
w2theta(n) = w2theta(n - 1) + a2acc * (t(n) - t(m));
theta(n) = theta(m) + (w2theta(m))*(t(n) - t(m)) + (1 / 2) * a2acc * (t(n) - t(m))^2;
elseif (t(n) > 0.1 && t(n) <= 7.7)
% no acceleration
w2theta(n) = w2real;
theta(n) = theta(m) + w2real * (t(n) - t(m));
elseif (t(n) > 7.7 && t(n) <= t(end))
% deceleration
w2theta(n) = w2theta(m) - a2dec * (t(n) - t(m));
theta(n) = theta(m) + (w2theta(m))*(t(n) - t(m)) - (1 / 2) * a2dec * (t(n) - t(m))^2;
end
end

disp('Ntheta1 vs Discrete theta1')
[ntheta1 theta(11)]
disp('Ntheta2 vs Discrete theta2')
[ntheta2 theta(771)]
disp('Ntheta3 vs Discrete theta3')
[ntheta3 theta(end)]

Is my approach and signs correct and is this simply a rounding error that builds up, or is there something that I am doing wrong?

EDIT: I have tried with different times, 1s acceleration, 5s maintaining, 2s deceleration and the error for the final value was much, much smaller, so I am guessing that the differences that I get are simply due to the rounding that MATLAB does on each of the iterations.
1.432399183732219
vs
1.432399183732199
 
Last edited:
Physics news on Phys.org
  • #2
Darkbound said:
My first question is if that number is correct.
Looks ok if the two accelerations are constant, but I do not see that given.
Darkbound said:
v1(tnew) = v1(tnew - told) + a * (tnew - told)
This looks weird. Are you confusing factors with subscripts? On the face of it, you are multiplying velocities by times (to produce displacements), then adding acceleration x time (so a velocity). Similarly the next line.
I guess you mean v1new=v1old+ a * (tnew - told). That seems to match the code.
Correcting that:
Darkbound said:
v1new=v1old + a * (tnew - told)
x1new=x1old + v1old*(tnew - told) + 1/2 * acc * (tnew - told)^2
I think you'll find that what this comes down to is calculating the change in displacement as time interval times average speed: (tnew - told)(v1old+v1new)/2.
Darkbound said:
if (t(n) >= 0 && t(n) <= 0.1)
So how many times will it execute this case?
 
  • Like
Likes midoriya
  • #3
Thanks! And yes, this is what I mean about the velocity.

The first if will execute 11 times, starting from 0 until 0.1 at every 0.01 second, the second interval is 770 times and the final interval is 30 times. When I changed it to 1s, 5s, 2s which is 101, 500, 200 times for the intervals that is when I got the negligible error.

As for the average speed equation, you're saying that I can use it instead of my x(t) equations after I recalculate the velocity? I did not think of that :)
 
  • #4
Darkbound said:
The first if will execute 11 times, starting from 0 until 0.1
That seems once too often. There should only be 10 intervals, no?
But I am unfamiliar with Matlab, so I am not sure what the initialiser for t[] does.
Darkbound said:
t = [0 0.01:0.01:8]
At a guess, t[0]=0.01, t[10]=0.11.
If so, the 10th iteration has wandered into the constant speed domain.
 

1. What is 1D angular motion with different velocity stages?

1D angular motion with different velocity stages is a type of motion where an object moves in a circular path with varying speeds. This type of motion can occur when an object is rotating at a constant rate and encounters regions of different velocities, such as when a car is driving on a curved track at different speeds.

2. How does the velocity of an object affect its angular motion?

The velocity of an object affects its angular motion by determining how quickly it moves along its circular path. If an object has a higher velocity, it will cover a larger distance in a shorter amount of time, resulting in a faster angular motion. On the other hand, a lower velocity will result in a slower angular motion.

3. What is the difference between constant and variable angular velocity?

Constant angular velocity is when an object moves along its circular path at a steady rate, covering equal angles in equal amounts of time. Variable angular velocity is when the object's speed changes along its circular path, resulting in unequal angles being covered in equal amounts of time.

4. How is angular velocity measured?

Angular velocity is typically measured in radians per second (rad/s), which represents the change in angular displacement over time. It can also be measured in degrees per second (deg/s), where one full revolution around a circle is equal to 360 degrees.

5. What is the relationship between linear and angular velocity?

The relationship between linear and angular velocity is that linear velocity is equal to the product of angular velocity and the radius of the circular path. This means that the faster an object rotates around its circular path, the greater its linear velocity will be.

Similar threads

  • Introductory Physics Homework Help
Replies
2
Views
1K
  • Introductory Physics Homework Help
Replies
3
Views
793
  • Introductory Physics Homework Help
Replies
2
Views
679
  • Introductory Physics Homework Help
Replies
17
Views
2K
  • Introductory Physics Homework Help
Replies
3
Views
2K
  • Introductory Physics Homework Help
Replies
6
Views
964
  • Introductory Physics Homework Help
Replies
7
Views
2K
  • Introductory Physics Homework Help
Replies
3
Views
634
  • Introductory Physics Homework Help
Replies
6
Views
965
  • Introductory Physics Homework Help
Replies
2
Views
3K
Back
Top