Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   swerve math quiz (http://www.chiefdelphi.com/forums/showthread.php?t=129185)

Ether 28-04-2014 16:04

swerve math quiz
 
2 Attachment(s)


Given:

* 4-wheel Unicorn swerve robot

* wheels located at corners of the rectangle shown in attached Figure 2

* robot is rotating clockwise around center of rotation (red dot) at omega radians/sec as shown in attached Figures 1 and 2


Problem:

Find the steering angle and tangential speed of each of the 4 wheels in terms of omega, a, b, c, and d.

Show your work.




Chowmaster4695 28-04-2014 16:15

Re: swerve math quiz
 
Aware

brennonbrimhall 28-04-2014 16:25

Re: swerve math quiz
 
Quote:

Originally Posted by Ether (Post 1379902)


* 4-wheel Unicorn swerve robot

What differentiates a unicorn swerve drive from a standard swerve drive?

barn34 28-04-2014 16:28

Re: swerve math quiz
 
Quote:

Originally Posted by brennonbrimhall (Post 1379928)
What differentiates a unicorn swerve drive from a standard swerve drive?

it can honk as it's swerving past a defender? :D

Chris Endres 28-04-2014 16:30

Re: swerve math quiz
 
Quote:

Originally Posted by brennonbrimhall (Post 1379928)
What differentiates a unicorn swerve drive from a standard swerve drive?

Because it's magical, duh.

Jon Stratis 28-04-2014 16:30

Re: swerve math quiz
 
Quote:

Originally Posted by brennonbrimhall (Post 1379928)
What differentiates a unicorn swerve drive from a standard swerve drive?


Define "standard" swerve... :D

Unicorn is "4-wheel independent-steering and independent-driven drivetrain, with unlimited rotation of the wheels and sensors, and no gaps in the sensor feedback?" http://www.chiefdelphi.com/forums/sh...07&postcount=9 Oh, and it was so named by none other than JVN!

You might also call it an idealized swerve drive. A more common approach is coaxial swerve, where each side rotates together, and has a limited range of rotation (usually no more than 360 degrees). Another approach might be to have all 4 swerve modules rotate together.

Nate Laverdure 28-04-2014 16:37

Re: swerve math quiz
 
Quote:

Originally Posted by Jon Stratis (Post 1379934)
Define "standard" swerve... :D

In a fit of boredom, I once defined 27 different types of swerve configurations :)

brennonbrimhall 28-04-2014 16:49

Re: swerve math quiz
 
Quote:

Originally Posted by Jon Stratis (Post 1379934)
Define "standard" swerve... :D

Either http://www.andymark.com/product-p/am-0537.htm or http://www.andymark.com/product-p/am-0760.htm. ;)

My definition of a standard swerve drive are four independently controlled modules, such that each can have its own velocity vectors (i.e., independent direction AND magnitude). Anything less than that is not a swerve (or so I've gathered from CD searching and speaking with mentors) -- my understanding is that a crab drive is a derivative of a swerve drive where the vectors must all be parallel (and most always have the same velocity magnitude too, though this is not a mechanical limitation).


Quote:

Originally Posted by Jon Stratis (Post 1379934)
Unicorn is "4-wheel independent-steering and independent-driven drivetrain, with unlimited rotation of the wheels and sensors, and no gaps in the sensor feedback?" http://www.chiefdelphi.com/forums/sh...07&postcount=9 Oh, and it was so named by none other than JVN!

You might also call it an idealized swerve drive.

Gotcha. A true, pure swerve.

Quote:

Originally Posted by Jon Stratis (Post 1379934)
A more common approach is coaxial swerve, where each side rotates together, and has a limited range of rotation (usually no more than 360 degrees).

Quote:

Originally Posted by Jon Stratis (Post 1379934)
Another approach might be to have all 4 swerve modules rotate together.

I'm a little confused here -- I don't really understand what you're trying to convey with your examples, unless you're just mentioning common implementations of what are commonly referred to as swerve drives.

Assuming you're using continuous potentiometers or some other sort of continuous sensor solution and have independent direction and magnitude control of each module, how is a coaxial swerve drive like 118's Revolution design NOT a unicorn swerve drive?

Per Nate Laverdure's paper (page 2, available here), wouldn't the proper term for what you describe in quote 2 be a crab drive? That's most certainly not a unicorn swerve drive.

EDIT: Nate beat me to his paper. :(

Nate Laverdure 28-04-2014 16:57

Re: swerve math quiz
 
Quote:

Originally Posted by brennonbrimhall (Post 1379956)
I'm a little confused here -- I don't really understand what you're trying to convey with your examples, unless you're just mentioning common implementations of what are commonly referred to as swerve drives.

He's saying that one's definition of "standard" is couched in their social context and their personal experience. These names-- even "crab drive"-- are all invented, and they mean different things to different people.

Jon Stratis 28-04-2014 16:58

Re: swerve math quiz
 
I was simply listing common implementations that student's/teams call swerve, even though there may be more accurate terms. To me, swerve is a general concept of physically changing the direction the wheels point in order to implement an omni-directional drive system. Unicorn, crab, and coaxial could be considered to be three subsets or implementations of a swerve drive system.

julianpowell 28-04-2014 18:15

Re: swerve math quiz
 
I believe 'coaxial' simply refers to how the drive motor transmits its rotation to the wheel. On a coaxial module the wheel is driven by a shaft that is coaxial with the rotation axis of the module. This allows you to mount your drive motor away from the module and have unlimited rotation.

Based on this definition you could create either a unicorn drive or a crab drive with coaxial modules.

Cyan 28-04-2014 20:35

Re: swerve math quiz
 
Lets say a, b, c, and d are in meters (because I personally like meters).

Corner 1 has a speed of ω√(b²+c²) in meters per second and angle of arctan(c/b)+π/2 in radians.
Corner 2 has a speed of ω√(a²+c²) in meters per second and angle of arctan(c/a)+π/2 in radians.
Corner 3 has a speed of ω√(a²+d²) in meters per second and angle of arctan(d/a)+π/2 in radians.
Corner 4 has a speed of ω√(b²+d²) in meters per second and angle of arctan(d/b)+π/2 in radians.


Work: (Yes I'm lazy)
http://i.imgur.com/xCsYXzw.jpg?1

For the sake of simplicity, we'll call "n" the line segment that ends at any corner of the robot and the point of rotation. Create a right triangle with n as its hypotenuse. We can call the angle in the right triangle closest to the robot, the arctangent of the opposite leg divided by the adjacent leg. Then we add pi/2 radians to find the angle of the ray perpendicular to n.

Finding the rotational speed, we first create a circle with its center at the point of rotation and n as its radius. With the right triangle from the last paragraph, n can be found with the Pythagorean Theorem, where n is the square root of the sum of the squares of the two legs. Because n is the radius of the triangle, and we want the speed of the robot in ω radians per second, we can multiply ω by the radius to get the tangential speed.

Ether 28-04-2014 20:52

Re: swerve math quiz
 
Quote:

Originally Posted by Cyan (Post 1380135)
Corner 1 has a speed of ω√(b²+c²) in meters per second and angle of arctan(c/b)+π/2 in radians.
Corner 2 has a speed of ω√(a²+c²) in meters per second and angle of arctan(c/a)+π/2 in radians.
Corner 3 has a speed of ω√(a²+d²) in meters per second and angle of arctan(d/a)+π/2 in radians.
Corner 4 has a speed of ω√(b²+d²) in meters per second and angle of arctan(d/b)+π/2 in radians.


nice start. speeds are correct but angles are wrong.

do you want a hint about the angles, or would you prefer to work it yourself?



Cyan 28-04-2014 21:02

Re: swerve math quiz
 
Quote:

Originally Posted by Ether (Post 1380146)
nice start. speeds are correct but angles are wrong.

do you want a hint about the angles, or would you prefer to work it yourself?



Would you use the reciprocal rule for arctan to simplify it?

Then,
Corner 1 has an angle of -arctan(b/c) in radians.
Corner 2 has an angle of -arctan(a/c) in radians.
Corner 3 has an angle of -arctan(a/d) in radians.
Corner 4 has an angle of -arctan(b/c) in radians.

Ether 28-04-2014 21:08

Re: swerve math quiz
 
Quote:

Originally Posted by Cyan (Post 1380149)
Would you use the reciprocal rule for arctan to simplify it?

Then,
Corner 1 has an angle of -arctan(b/c) in radians.
Corner 2 has an angle of -arctan(a/c) in radians.
Corner 3 has an angle of -arctan(a/d) in radians.
Corner 4 has an angle of -arctan(b/c) in radians.

Still no joy.



julianpowell 29-04-2014 01:13

Re: swerve math quiz
 
Here is my attempt at the angles, I'm not sure if it's fully simplified. I assumed the zero angle to be when the wheel is pointing upward, and that it has an angular range of -pi to pi.

Corner 1: 2*arctan(-cot(ωt/2+arctan(b/c)))
Corner 2: 2*arctan(-cot(ωt/2+arctan(a/c)))
Corner 3: 2*arctan(-cot(ωt/2+arctan(a/d)))
Corner 4: 2*arctan(-cot(ωt/2+arctan(b/d)))

GeeTwo 29-04-2014 08:09

Re: swerve math quiz
 
I'm headed out the door to work, so no time to do the math. One clue though, is that once you've found an answer that will work, there are 15 others that will also work. Each wheel can be rotated in azimuth by pi (180 degrees) and the spin rate can be inverted, producing the same physical result. That's four independent binary decisions, for 16 results.

G2

Ether 29-04-2014 09:25

Re: swerve math quiz
 
Quote:

Originally Posted by GeeTwo (Post 1380318)
I'm headed out the door to work, so no time to do the math. One clue though, is that once you've found an answer that will work, there are 15 others that will also work. Each wheel can be rotated in azimuth by pi (180 degrees) and the spin rate can be inverted, producing the same physical result. That's four independent binary decisions, for 16 results.

For the sake of simplicity then, let me make the problem statement more explicit: I am looking for the solution where all the wheel speeds are positive, i.e. none of the spin rates are inverted. In post#12, Cyan has the correct solution for wheel speeds.

The corresponding formulas for the wheel steering angles for that set of positive wheel speeds can be derived and expressed quite simply if the right trig function is used.

The wheel steering angles should all be 0 when the wheel is steered to the "straight forward" (with respect to the robot) direction. The angle range should be +/- pi radians, where positive angles are steering to the right (clockwise as viewed from above) and negative angles are steering to the left (counterclockwise as viewed from above).




Ether 29-04-2014 09:27

Re: swerve math quiz
 
Quote:

Originally Posted by julianpowell (Post 1380267)
Here is my attempt at the angles, I'm not sure if it's fully simplified. I assumed the zero angle to be when the wheel is pointing upward, and that it has an angular range of -pi to pi.

Corner 1: 2*arctan(-cot(ωt/2+arctan(b/c)))
Corner 2: 2*arctan(-cot(ωt/2+arctan(a/c)))
Corner 3: 2*arctan(-cot(ωt/2+arctan(a/d)))
Corner 4: 2*arctan(-cot(ωt/2+arctan(b/d)))

What is "t" ??

Also: only the wheel speeds are a function of ω, not the steering angles.




Sparkyshires 29-04-2014 11:51

Re: swerve math quiz
 
How are angles measured by? for ex, is 0 in standard forward facing configuration, or is 0 supposed to be zero on the unit circle?

Also any bonus points for including time into the calculation to give the angle at any given second after 0? :P

EDIT: ignore the first part of this post, forgot to read the whole thread xD

Ether 29-04-2014 12:18

Re: swerve math quiz
 
Quote:

Originally Posted by Sparkyshires (Post 1380418)
any bonus points for including time into the calculation to give the angle at any given second after 0? :P

The steering angles of the wheels are constant for the motion illustrated in Figure1.



Ether 29-04-2014 13:36

Re: swerve math quiz
 
Quote:

Originally Posted by Cyan (Post 1380135)
Corner 1 has a speed of ω√(b²+c²) in meters per second and angle of arctan(c/b)+π/2 in radians.
Corner 2 has a speed of ω√(a²+c²) in meters per second and angle of arctan(c/a)+π/2 in radians.
Corner 3 has a speed of ω√(a²+d²) in meters per second and angle of arctan(d/a)+π/2 in radians.
Corner 4 has a speed of ω√(b²+d²) in meters per second and angle of arctan(d/b)+π/2 in radians.

Work: (Yes I'm lazy)
http://i.imgur.com/xCsYXzw.jpg?1

On closer inspection, if your angles are interpreted to be measured CCW with a value of +90 degrees in the straight forward direction, they are correct. If that is the interpretation you intended (I cannot tell because I cannot read the JPG you posted), then your answer is correct for the quadrant as shown in Figure1



julianpowell 29-04-2014 15:05

Re: swerve math quiz
 
Quote:

Originally Posted by Ether (Post 1380333)
What is "t" ??

Also: only the wheel speeds are a function of ω, not the steering angles.




Oh I see what I did wrong, I was thinking of the wheel angles in relation to the 'field' and not the robot. That's why I had them all as functions of time.

Cyan 29-04-2014 17:00

Re: swerve math quiz
 
Quote:

Originally Posted by Ether (Post 1380332)
The wheel steering angles should all be 0 when the wheel is steered to the "straight forward" (with respect to the robot) direction. The angle range should be +/- pi radians, where positive angles are steering to the right (clockwise as viewed from above) and negative angles are steering to the left (counterclockwise as viewed from above).


Quote:

Originally Posted by Ether (Post 1380462)
On closer inspection, if your angles are interpreted to be measured CCW with a value of +90 degrees in the straight forward direction, they are correct. If that is the interpretation you intended (I cannot tell because I cannot read the JPG you posted), then your answer is correct for the quadrant as shown in Figure1


After reading this first post I think I understood what I did wrong. I thought that the side of the robot with corners 1 and 4 would be the front, so I left the answer I got working out as is. Now all I need to do is subtract each measurement from pi/2.

Therefore,
Corner 1 has an angle of -arctan(c/b) in radians.
Corner 2 has an angle of -arctan(c/a) in radians.
Corner 3 has an angle of -arctan(d/a) in radians.
Corner 4 has an angle of -arctan(d/b) in radians.


If the wheels were inverted (if they were moving backwards and facing the opposite direction),
Corner 1 has a speed of -ω√(b²+c²) in meters per second and angle of arctan(c/b)+π/2 in radians.
Corner 2 has a speed of -ω√(a²+c²) in meters per second and angle of arctan(c/a)+π/2 in radians.
Corner 3 has a speed of -ω√(a²+d²) in meters per second and angle of arctan(d/a)+π/2 in radians.
Corner 4 has a speed of -ω√(b²+d²) in meters per second and angle of arctan(d/b)+π/2 in radians.

GeeTwo 30-04-2014 00:32

Re: swerve math quiz
 
OK, I’m going to work this through from the beginning, with the later conventions Ether established It turns out my "symbol" fonts didn't work, so I'll use w for omega (angular speed), and f for phi (steering angle).

To simplify, I’m going to think about the problem in pathologically robot-centric terms. That is, I’ll imagine that the robot is stationary and we’re rotating the floor in the opposite direction. (I also sometimes imagine I’m pushing the whole earth down when I climb the stairs, so maybe it’s just me.) The only real difference comes in when you actually try to figure forces and torques and such – as long as we stick to speeds and lengths, all is good.
SO, I’m a unicorn swerve drive robot that wants to spin the floor counterclockwise from above (widdershins) about a point located at (b,c) referenced from my right front wheel’s pivot, (b,d) from my right rear, (a,c) from my left front, and (a, d) from my left rear. First, let’s just think about a one-wheeled problem, say the right front, which Ether has called wheel number one; subscript 1 on f and w refer to the azimuth angle and angular speed of this wheel, likewise for the other three corners.
Here, I am imagining the floor as a crown gear with infinitely small teeth, and my wheel as a spur gear engaging it with infinitely small teeth. When I rotate my wheels in the positive direction with speed w1 which is oriented at angle f1, the floor could be rotating around any point on the line of bearing w1 (out to the right, along my axle) with angular speed w0 = hw1/r1, where h is the height of my axle of the floor (or equivalenly, the radius of my wheel), r1 is the horizontal distance to the point, that is √(b2+c2), so w1 = w0√(b2+c2)/h. Actually, Ether has asked for the answer in tangential speed, which is hw1, and which I’ll call s1. Then, s1 = w0√(b2+c2). One down.
Since the bearing of the axis of rotation is at angle f1, and it’s location is at (b,c), we know that atan2(b,c) = f1. Since Ether defined angles in the “nautical” convention (positive to the right), and I’m using Euclidean coordinates so far [and me an Navy Oceanographer in my day job!], or positive angles to the left, this becomes f1 = -atan2(b,c).
Going through the same motions for the other three corners, we have
f1 =-atan2(b,c) ; s1 = w0√(b2+c2)
f2 =-atan2(a,c) ; s2 = w0√(a2+c2)
f3 =-atan2(a,d) ; s3 = w0√(a2+d2)
f4 =-atan2(b,d) ; s4 = w0√(b2+d2)
Going back, I see my speeds do agree with Cyan View. My angles all seem to give correct values in each quadrant. The only value that is weird is when the turn point is to the left of the wheel, and I get –pi instead of pi, which does not actually violate Ether’s rules. I’m calling this a solution.
G2

Ether 30-04-2014 08:39

Re: swerve math quiz
 
1 Attachment(s)
Quote:

Originally Posted by GeeTwo (Post 1380827)
f1 =-atan2(b,c) ; s1 = w0√(b2+c2)
f2 =-atan2(a,c) ; s2 = w0√(a2+c2)
f3 =-atan2(a,d) ; s3 = w0√(a2+d2)
f4 =-atan2(b,d) ; s4 = w0√(b2+d2)

Thank you for the detailed post.

You have the arguments of atan2 interchanged. (See Figure3 attached).


Quote:

My angles all seem to give correct values in each quadrant.
That's the beauty of using atan2, instead of atan with an offset correction.



ajlapp 30-04-2014 11:03

Re: swerve math quiz
 
FYI...the usually infallible JVN made a misstep in my opinion when he coined the term "unicorn drive."

4 wheel independent steered and driven swerve drive was around long before he attempted to coin this term.

These drives were commonly referred to as "King Crab."

IIRC FRC47 was the first to do this with 4 wheels in 2001...though they had done it with two wheels in 2000. IMHO this was much harder to achieve in 2001 because of the strange motors variety available...to ice the cake, it wasn't even wheels. It had tri-treads for climbing!!!

FRC79 continued the 4 wheel version for some time and has published some white papers on their controls concepts. This helps explain the name as well...King Krab.

http://www.chiefdelphi.com/media/papers/download/1596

Just saying. It's not new and it's not "unicorn drive."

Perhaps I've missed some subtle distinction here, but I don't think so. :)

#FRCHISTORY

Ether 30-04-2014 11:19

Re: swerve math quiz
 
Quote:

Originally Posted by ajlapp (Post 1380933)
4 wheel independent steered and driven swerve drive was around long before he attempted to coin this term.

Perhaps I've missed some subtle distinction here, but I don't think so.

You left off the last part:

4-wheel independent-steering and independent-driven drivetrain, with unlimited rotation of the wheels and sensors, and no gaps in the sensor feedback

http://www.chiefdelphi.com/forums/sh...07&postcount=9

Quote:

Just saying. It's not new and it's not "unicorn drive."
It was new at the time. There was no name for a swerve with all those qualities.



ajlapp 30-04-2014 11:41

Re: swerve math quiz
 
I concede that by this strict definition the FRC47 robots from 2000 and 2001 probably didn't qualify as they likely didn't have gapless sensor data....they could of had infinite rotation but it ultimately would have been limited by wire twist at some point.

They likely used potentiometers.

I stand down.

Thinking through the history was fun nonetheless.

GeeTwo 01-05-2014 07:34

Re: swerve math quiz
 
Quote:

Originally Posted by Ether (Post 1380886)
You have the arguments of atan2 interchanged.
[/i]

I know it's bad form to blame the tools, but that's what happened here. I never noticed before that MS Excel defines atan2 with swapped arguments from programming languages.

G2

Ether 01-05-2014 10:00

Re: swerve math quiz
 
Quote:

Originally Posted by Ether (Post 1380886)
That's the beauty of using atan2, instead of atan with an offset correction.

Generalizing this exercise for any number of wheels N in any configuration:

Let XYrobot be a standard Cartesian coordinate system fixed with respect to the robot, with +Y axis pointing in the robot "forward" direction, and origin located at point C (which can be anywhere within the robot frame, or even outside the frame of the robot).

Let (Xi,Yi), i=1..N, be the coordinates of the robot's N wheels in the XYrobot coordinate system.

Then, the wheel tangential speeds and steering angles for clockwise rotation of the robot about the point C at ω radians/sec are given by:

speedi = ω√(Xi2+Yi2)

anglei = atan2(Yi,-Xi)

...where anglei is zero at the "straight forward" position and is measured clockwise therefrom with range ±π





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

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