[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
From: |
anvilus9-at-comcast.net |
|
Subject: |
Re: track channel mixing [TANKS] |
|
Date: |
Fri, 19 Oct 2007 23:52:08 +0000 |
|
Reply-To: |
tanks-at-rctankcombat.com |
-------------- Original message ----------------------
From: "Doug Conn" <dwconn404-at-comcast.net>
> When I build my tank, I'll need to write some code to handle the mixing of a
> single stick input into two separate channels for the speed controls. I'd
> like to be consistent with other vehicles out there. I bet the writers of
> the C6C firmware have already solved this problem, and I bet others have,
> too. Care to share your algorithms ? How do you convert a stick's X and Y
> positions into two track's direction and speed ?
It is easiest describe using servo signal values
measured in microseconds (usec). Standard signals
are bounded within 1000 to 2000 usec.
X stick value
full left = 1000
half left = 1250
middle = 1500
half right = 1750
full right = 2000
Y stick value
full up = 2000
half up = 1750
middle = 1500
half down = 1250
full down = 1000
measure X,Y signals and compute R,L signals
R track value
full forward = 2000
half forward = 1750
off = 1500
half reverse = 1250
reverse = 1000
L track value
full forward = 2000
half forward = 1750
off = 1500
half reverse = 1250
reverse = 1000
++++++++++++++++++++++++++++++++++++++++++++++++++++++
linear mixing
R = (Y - X)/2 + 1500
L = (Y + X - 3000)/2 + 1500 = (Y + X)/2
This is a linear map over the entire stick motion.
It provides full speed for one track in the corners
of the stick and half speed for both tracks at the
sides, top and bottom of the stick.
++++++++++++++++++++++++++++++++++++++++++++++++++++++
add-and-clamp mixing
R* = (Y - X)
if R* > 500 then R* = 500
if R* < -500 then R* = -500
R = R* + 1500
L* = (Y + X - 3000)
if L* > 500 then L* = 500
if L* < -500 then L* = -500
L = L* + 1500
This provides full speed for both tracks at the
sides, top, and bottom of the stick. However,
it is only a linear mapping within an inscribed
diamond of stick motion. It causes the track
signals to clamp to their max/min values outside
the inscribed diamond
++++++++++++++++++++++++++++++++++++++++++++++++++++++
RobotLogic provides an improved algortihm
over add-and-clamp according to their users manual.
http://www.robotlogic.com/product_imx1.html
However, in my testing It does not provide full speed
for both tracks at the sides, top, and bottom of the stick.
++++++++++++++++++++++++++++++++++++++++++++++++++++++
Anvilus mixing
A 15x15 look-up table is used for non-linear mapping
to avoid add-and-clamp. It provides full speed for
both tracks at the sides, top and bottom of the stick
and can be customized to provide wider deadband in
the center of stick motion.
See Appendix B of the user manual for the Anvilus RC
Relay SSR Motor Controller at
http://www.anvilus.com/relay_ssr.html
I will send you my M-BASIC code in a private message.
Joe
--
Joe Sommer, Anvilus Machine Works
2378 Nantucket Circle, State College, PA 16803
814.234.4773 anvilus9-at-comcast.net
http://www.anvilus.com
|
From: |
anvilus9-at-comcast.net |
|
Subject: |
Re: track channel mixing [TANKS] |
|
Date: |
Fri, 19 Oct 2007 23:51:17 +0000 |
|
From: |
anvilus9-at-comcast.net |
|
Subject: |
Re: track channel mixing [TANKS] |
|
Date: |
Fri, 19 Oct 2007 21:43:03 +0000 |
|
From: |
anvilus9-at-comcast.net |
|
Subject: |
Re: track channel mixing [TANKS] |
|
Date: |
Fri, 19 Oct 2007 21:39:05 +0000 |
|
From: |
"Doug Conn" <dwconn404-at-comcast.net> |
|
Subject: |
track channel mixing [TANKS] |
|
Date: |
Fri, 19 Oct 2007 19:24:17 +0000 |
When I build my tank, I'll need to write some code to handle the mixing of a
single stick input into two separate channels for the speed controls. I'd
like to be consistent with other vehicles out there. I bet the writers of
the C6C firmware have already solved this problem, and I bet others have,
too. Care to share your algorithms ? How do you convert a stick's X and Y
positions into two track's direction and speed ?
Thanks,
Doug