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)

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


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