Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Math and Science (http://www.chiefdelphi.com/forums/forumdisplay.php?f=70)
-   -   calculating position using follower wheels (http://www.chiefdelphi.com/forums/showthread.php?t=120022)

Ether 07-10-2013 22:12

Re: calculating position using follower wheels
 
Quote:

Originally Posted by flameout (Post 1295177)
this is way too easy when all I need to do is change a script I already wrote.

Yeah; I had already prepared Question 6 back when everyone was using a closed-form analytical solution for Q(t). You beat me to the punch by setting up your numerical integration script.


Question 6 solution:
Spoiler for solution:
Position: ( -3.7271, -4.0749)
Distance: 60.8613
I think you are showing more decimal places than are warranted for the accuracy of your solution method. I'm differing from you in the third decimal place for X and Y. Compiled C on 8-year-old 32-bit Windows XP machine takes roughly 40ms to compute.

Can someone else weigh in with their numbers for this?



flameout 07-10-2013 22:28

Re: calculating position using follower wheels
 
Quote:

Originally Posted by Ether (Post 1295185)
Yeah; I had already prepared Question 6 back when everyone was using a closed-form analytical solution for Q(t). You beat me to the punch by setting up your numerical integration script.

Makes sense.

Quote:

Originally Posted by Ether
Question 6 solution:
Spoiler for solution:
Position: ( -3.7271, -4.0749)
Distance: 60.8613
I think you are showing more decimal places than are warranted for the accuracy of your solution method.

I never bothered to do any accuracy analysis, so that's probably the case.

After lowering the tolerances and calculating bounds for the error (total error should be less than 1e-7), I got the following revised figures:
Spoiler for solution:
Position: (-3.7350, -4.0685)
Distance: 60.8668

New parameters and error analysis:
Relative and absolute tolerances set to 10^-12 (previously 10^-6): The error at each step should not exceed max(10^-12, |x * 10^-12|), where x is the current value of the ODE solution
Number of ODE solver steps: 1022
Maximum element of the state: 60.8668
Upper bound for error: max(10^-12, |60.8668 * 10^-12|) * 1022 = 6.2267e-08

Ether 07-10-2013 23:10

Re: calculating position using follower wheels
 
Quote:

Originally Posted by flameout (Post 1295191)
After lowering the tolerances and calculating bounds for the error (total error should be less than 1e-7), I got the following revised figures...

Spoiler for solution:
Position: (-3.7350, -4.0685)
Distance: 60.8668
That matches my results out to the number of decimal places shown, except I'm getting a 6 instead of a 5 in the fourth decimal place of the Y value.



flameout 08-10-2013 00:10

Re: calculating position using follower wheels
 
Quote:

Originally Posted by Ether (Post 1295199)
That matches my results out to the number of decimal places shown, except I'm getting a 6 instead of a 5 in the fourth decimal place of the Y value

I re-ran my script once for each of MATLAB's ODE solvers, adjusting the tolerances as necessary to get a reasonable solve time.

Every solver agreed through the fifth decimal place (for the Y value). The stiff solvers needed significantly larger error tolerances and took more steps; their predicted error was much higher.

The nonstiff solvers all agreed through the seventh decimal place.

The lowest predicted error was obtained through the ode113 solver, using a relative tolerance of 100 * epsilon and an absolute tolerance of 10^-12. According to my error estimate, all of the following digits are correct:

Spoiler for solution:
Position: (-3.73497544, -4.06852591)
Distance: 60.86682701


It was interesting going through all the solvers -- many of the stiff solvers had error estimates in excess of 10^-4. I guess this shows that the choice of solver really can have an effect on the error, and not just the solution time.

Ether 08-10-2013 00:50

Re: calculating position using follower wheels
 
Quote:

Originally Posted by flameout (Post 1295205)
Every solver agreed through the fifth decimal place (for the Y value).

The rotate_CW function has some nasty behavior near zero. So I tried replacing the numerical integration of that function in the region T<0.01 with an analytic solution of a 3rd order Taylor expansion. I'm now matching your results with a time step of 1 microsecond.

Bleary-eyed, time to call it quits for the night.



Ether 01-11-2013 17:53

Re: calculating position using follower wheels
 
1 Attachment(s)

The large black rectangle in the attached sketch represents a top view of a robot.

The forward direction of the robot is upwards in the sketch.

The 4 red arrows represent 4 unpowered instrumented (with encoders) omni follower wheels. For each of the wheels, the arrow points in the + direction for that wheel.


Question7

Find the formula for the FWD (forward), STR (strafe right), and RCW (rotate clockwise) robot motions in terms of the X1, Y1, X2, and Y2 wheel speeds.



RyanCahoon 01-11-2013 18:39

Re: calculating position using follower wheels
 
Spoiler for Question 7:
FWD=(Y1+Y2)/2
STR=(X1+X2)/2
RCW=(X1-X2)/L=(Y2-Y1)/W

Ether 01-11-2013 19:51

Re: calculating position using follower wheels
 
Quote:

Originally Posted by RyanCahoon (Post 1299724)
Spoiler for Question 7:
FWD=(Y1+Y2)/2
STR=(X1+X2)/2
RCW=(X1-X2)/L=(Y2-Y1)/W

Looks good to me. Anybody disagree or have questions?




All times are GMT -5. The time now is 07:44.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi