140 likes | 648 Views
Trajectory Generation. Cherevatsky Boris. Trajectory for single joint. Suppose we are given a simple robot We want to move the joint from to in 4 seconds and the trajectory should be a cubic polynomial . . Trajectory for single joint.
E N D
Trajectory Generation Cherevatsky Boris
Trajectory for single joint • Suppose we are given a simple robot • We want to move the joint from to in 4 seconds and the trajectory should be a cubic polynomial .
Trajectory for single joint • Let’s denote the initial velocity and the final velocity . We also know that , so if then we get that : By solving this 4 equations we can extract the coefficients of the polynomial:
Using Matlab • The function [s,sd,sdd]=tpoly(start,end,time,start_v,end_v) generates a quantic polynomial trajectory. • Example: • tpoly(0,1,50) ; this means start_v=end_v=0
Problem with polynomials • Let’s try this example:tpoly(0,1,50,0.5,0) • What is the problem?
Problem with polynomials #2 • Looking at the 1st exampletpoly(0,1,50) we see that the velocity peaks at t=25, which means that for the most of the time the velocity is far less than the maximum. The mean velocity:mean(sd)/max(sd) = 0.5231Only 52% of the peak.
Solution – Linear with bend! • S = lspb(0,1,50,0.025)Linear segment with parabolic blend • Mean(sd)/max(sd)=0.80
Multi-Dimensional Case • X=mtraj(@tpoly,[0 2] ,[1 -1], 50); • X=mtraj(@lspb,[0 2] ,[1 -1], 50);
Multi-Dimensional with via points • via = [4,1;4,4;5,2;2,5] • mstraj(via,[2,1],[],[2,1],0.05,0); • The functions takes: • Via points • A vector of maximum speeds per joint • A vector of durations for each segment • Initial axis coordinates • Sample interval • Acceleration time
Acceleration time • mstraj(via,[2,1],[],[2,1],0.05,1);