![]() |
calculating position using follower wheels
A certain robot with a 3 degree-of-freedom drivetrain (FWD, STR, RCW) is on a flat level floor. At time T=0, its center of geometry (CoG) is located at the origin of an XY coordinate system fixed with respect to the floor; it is facing 15 degrees clockwise from the +Y axis; and it has the the following robot-centric constant motions: forward = 5 ft/sQuestion 1: What are the coordinates 3 seconds later, and what direction is the robot facing? Students, Mentors, engineers, and professors welcome. |
Re: calculating position using follower wheels
It is at the origin, facing 15 degrees clockwise from the +Y axis.
EDIT: 120 deg/sec * 3 sec = 360 degrees -- it just goes in a circle. |
Re: calculating position using follower wheels
Quote:
Question 2: What's the radius of the circle? |
Re: calculating position using follower wheels
Spoiler for solution:
EDIT: Perfectly matched text color w/ background color. EDIT2: Oops, it's 5 ft/s forward and 4 ft/s strafing, not 4 ft/s and 3 ft/s EDIT3: Changed colored text to a spoiler -- thank you EricH |
Re: calculating position using follower wheels
Quote:
This one is quite a bit more difficult: Question 3: Exactly the same as Question 1, except the FWD speed is a function of time, as follows: FWD = 5.0 + 1.0*T. In other words, FWD starts with the value 5.0 at T=0, and increases smoothly and linearly at a rate of 1 ft/sec/sec. The STR and RCW remain constant at 4 ft/sec and 120 deg/sec respectively. |
Re: calculating position using follower wheels
Spoiler for Solution:
Can this be done without integrals? |
Re: calculating position using follower wheels
Not answering the math questions... just this one.
Quote:
Spoiler for This is a spoiler:
And now back to the math... |
Re: calculating position using follower wheels
Quote:
Spoiler for Question 3:
Quote:
|
Re: calculating position using follower wheels
Quote:
|
Re: calculating position using follower wheels
I did have it rotate counter-clockwise (oops). Corrected answer is the same, with both coordinates their opposites.
|
Re: calculating position using follower wheels
2 Attachment(s)
Great work, Jacob and Ryan. Reps to you both. Ryan: what CAS did you use for that? The syntax you used was rejected by Maxima, Octave, and SciLab. (I got it to work in Maxima by changing the syntax a bit) Jacob: You got the right answer, but didn't show your work. How did you solve it? This has a potential practical application for FRC. If you put 3 omni follower wheels -- in the the correct configuration -- on a robot, you can get FWD, STR, and RCW information from them. Then you can use something like the attached C code to get the position and orientation of the robot. |
Re: calculating position using follower wheels
I used Microsoft mathematics, which only allows radians in calculus functions:
X: integral((5+1t)cos((90-15)(pi/180)-120pi/180t)+3sin((90-15)(pi/180)-120pi/180t), t, 0, 3) Y: integral((5+1t)sin((90-15)(pi/180)-120pi/180t)+3cos((90-15)(pi/180)-120pi/180t), t, 0, 3) |
Re: calculating position using follower wheels
Question 4: In the code block highlighted in blue at the bottom of post 11 the following code appears for calculating position and heading: Code:
Code:
|
Re: calculating position using follower wheels
Spoiler for Justification:
It is not the best proof, but it explains the general reasoning. |
Re: calculating position using follower wheels
1 Attachment(s)
Quote:
See attachment for additional explanation using geometry and a bit of calculus. |
Re: calculating position using follower wheels
Quote:
|
Re: calculating position using follower wheels
5 Attachment(s)
Just for fun. |
Re: calculating position using follower wheels
Quote:
forward = 5*sin(t/2) ft/s5a) What are the XY coordinates 30 seconds later? 5b) What is the path length traveled during that 30 seconds? |
Re: calculating position using follower wheels
Spoiler for solution:
MATLAB: Spoiler for code:
|
Re: calculating position using follower wheels
Quote:
|
Re: calculating position using follower wheels
Quote:
Spoiler for 5a:
Quote:
Spoiler for 5b:
|
Re: calculating position using follower wheels
Quote:
|
Re: calculating position using follower wheels
In one hour from the time of this post, I will post Question 6. |
Re: calculating position using follower wheels
1 Attachment(s)
I've refactored my code to be much faster (using basic manual Euler integration instead of MATLAB's integral() function) and plotted the robot's position for problem 5. The plot is attached.
Here is the code. I would have done this in C++, but MATLAB lets me plot much more easily :rolleyes: Spoiler for code:
|
Re: calculating position using follower wheels
Quote:
Code:
Maxima 5.27.0 http://maxima.sourceforge.netQuote:
Also see Post 13 for a simple change to improve accuracy so you can use fewer steps and run even faster. Post 15 explains why. Quote:
|
Re: calculating position using follower wheels
Quote:
Where it was painfully slow was plotting the position trajectory, where it needed to run the numerical integration inside a numerical integration over and over (plenty of redundant calculations). To get a high-quality plot would have taken over an hour of execution time. Quote:
Another good technique would be to use an ODE solver rather than pure integration -- if I were to do this, I'd probably use MATLAB's built in 4th/5th order adaptive Runge-Kutta solver (ode45). This would probably be plenty fast as well. Quote:
Quote:
|
Re: calculating position using follower wheels
Quote:
Quote:
|
Re: calculating position using follower wheels
Quote:
Quote:
Here's code that solves it using one of MATLAB's adaptive ODE solvers (4/5th-order Runge-Kutta (I don't recall which formulation it is)): Spoiler for more code:
|
Re: calculating position using follower wheels
Question 6: Same as Question 5, except: 15 seconds instead of 30 and rotate_CW = (e^T-1)^(1/17) radians/sec |
Re: calculating position using follower wheels
Question 6 solution:
Spoiler for solution:
Code (slightly modified from my last script): Spoiler for code:
Perhaps I should stop and give someone else a chance to answer first -- this is way too easy when all I need to do is change a script I already wrote. |
Re: calculating position using follower wheels
Quote:
Question 6 solution: Spoiler for solution:
Can someone else weigh in with their numbers for this? |
Re: calculating position using follower wheels
Quote:
Quote:
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:
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 |
Re: calculating position using follower wheels
Quote:
Spoiler for solution:
|
Re: calculating position using follower wheels
Quote:
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:
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. |
Re: calculating position using follower wheels
Quote:
Bleary-eyed, time to call it quits for the night. |
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. |
Re: calculating position using follower wheels
Spoiler for Question 7:
|
Re: calculating position using follower wheels
Quote:
|
| 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