|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#7
|
|||
|
|||
|
Polar . . . Killough???
For the Question of the Killough the first thing you need to realize is that the
formula is not all that complex. ill just discuess the simple one. w = abs ( V ) / ( R ) * ( SIN ( theda ) ) + ( Torque * Length ) / R for my example i can remove the end and multiply by R to just work in speed. Velocity = abs ( SYS_Velocity ) * ( SIN ( Theda ) ) to work around the sin think of it in terms of only the ratio of Opp / Hyp verables working with are X and Y on the joy stick POLAR: THE R VALUE (Hyp) to get the R value of from the X and Y is easy 'step 1 get the values in 2's complement Y = ABS ( ( 127 - Y ) ) MIN 0 MAX 254 X = ABS ( ( 127 - X ) ) MIN 0 MAX 254 'step 2 a^2 + b^2 = c^2 SYS_Velocity = SQR ( ( X * X ) + ( Y * Y ) ) MIN 0 MAX 254 Simple eh Finally sin ( angle ) = Opp / Hyp So to bring the value to equal to that returned by a sin in PBASIC i did is took the equation and replaced it with 254 * Y / SYS_Velocity Velocity = abs ( SYS_Velocity ) * ( ( 254 * Y ) / SYS_Velocity ) there is my $.02 have fun and see what you can do |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PBASIC ARCTAN function | Greg Ross | Programming | 14 | 11-05-2003 12:28 |
| Obscure PBASIC for RoboEmu | rbayer | Programming | 1 | 28-03-2003 23:57 |
| PBasic 2.5 vs. 2.0 | Anthony Kesich | Programming | 6 | 09-02-2003 22:06 |
| RoboEmu 1.09 (supports PBASIC 2.5) | rbayer | Programming | 22 | 21-01-2003 17:22 |
| PBASIC Loop Speed? | archiver | 2001 | 3 | 23-06-2002 23:46 |