Shop OBEX P1 Docs P2 Docs Learn Events
Radio Control and DC motors — Parallax Forums

Radio Control and DC motors

ArchiverArchiver Posts: 46,084
edited 2004-04-26 14:11 in General Discussion
Hello,
I'm trying to radio control my robot using a Futaba Radio Control
system (6EXA).
The problem is that I have to control two DC motors separately and
not one motor for direction and another for movement (Like an Army
Tank).
I think that the solution might be to use a BS (BS2SX) to translate
the PWM of the futaba receiver for the Left-Right Channel and the PWM
for the speed to two different outputs each for a DC motor. What do
you think? Have you any better idea.
Thanks in advance.


+
+
| |
| FUTABA RECEIVER |
| |
+
+
+----+
| |
|LEFT-RIGHT |SPEED
|CHANNEL |
| |
+
+
+
+
| |
| BS2SX |
| |
+
*
*
+
LEFT MOTOR * * RIGHT MOTOR
* *
+---*
*----+
| H-BRIDGE |
+-+
+-+
| |
| |
--+-- --+--
// \\ // \\
| | | |
\\ // \\ //

LEFT MOTOR RIGHT MOTOR

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2004-04-03 20:01
    Your task would be a bit easier with a motor controller like the Pololu
    -- but it can be done. What you have to do is create a program that
    runs a tight loop so you can synthesize the PWM signal to the motors.
    In that loop you'll use PULSIN to read the servo signal from your
    reciever; from that you'll determine direction control and speed for
    your synthesized PWM.

    The docs for the NX-1000-24/40 show how to control motor speed and
    direction with synthesized PWM (using the onboard L272 driver). That
    code should help you.

    http://www.parallax.com/detail.asp?product_id=28137

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office



    Original Message
    From: emm_frag [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=IZmDacAEbD1vhaAMCno7INa2dbFa3mzoeDGKzCd_pAj2mRqDM4zbeYuaWO-aam6qAZKvWGkfjA]emm_frag@y...[/url
    Sent: Saturday, April 03, 2004 6:12 AM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] Radio Control and DC motors


    Hello,
    I'm trying to radio control my robot using a Futaba Radio Control
    system (6EXA).
    The problem is that I have to control two DC motors separately and
    not one motor for direction and another for movement (Like an Army
    Tank).
    I think that the solution might be to use a BS (BS2SX) to translate
    the PWM of the futaba receiver for the Left-Right Channel and the PWM
    for the speed to two different outputs each for a DC motor. What do
    you think? Have you any better idea.
    Thanks in advance.


    +
    +
    | |
    | FUTABA RECEIVER |
    | |
    +
    +
    +----+
    | |
    |LEFT-RIGHT |SPEED
    |CHANNEL |
    | |
    +
    +
    +
    +
    | |
    | BS2SX |
    | |
    +
    *
    *
    +
    LEFT MOTOR * * RIGHT MOTOR
    * *
    +---*
    *----+
    | H-BRIDGE |
    +-+
    +-+
    | |
    | |
    --+-- --+--
    // \\ // \\
    | | | |
    \\ // \\ //

    LEFT MOTOR RIGHT MOTOR
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-03 20:33
    I'm not getting it:

    You have a 6 channel Radio control system and you want to control
    two DC motors separately?

    I would say, hook up one engine to the left stick and one engine to
    the right stick. No stamp needed

    For controlling the DC motors you can use any PWM controller (you'll
    need two controllers or one 2-engine controller) that can handle the
    power of the DC motors.

    If you want to steer the two engines configured in a tank-layout in
    the normal left/right and forward/backward style you might find the
    6EXA capable of doing this.


    --- In basicstamps@yahoogroups.com, "emm_frag" <emm_frag@y...> wrote:
    > Hello,
    > I'm trying to radio control my robot using a Futaba Radio Control
    > system (6EXA).
    > The problem is that I have to control two DC motors separately and
    > not one motor for direction and another for movement (Like an Army
    > Tank).
    > I think that the solution might be to use a BS (BS2SX) to translate
    > the PWM of the futaba receiver for the Left-Right Channel and the
    PWM
    > for the speed to two different outputs each for a DC motor. What do
    > you think? Have you any better idea.
    > Thanks in advance.
    >
    >
    > +
    +
    > | |
    > | FUTABA RECEIVER |
    > | |
    > +
    +
    +----+
    > | |
    > |LEFT-RIGHT |SPEED
    > |CHANNEL |
    > | |
    > +
    +
    +
    +
    > | |
    > | BS2SX |
    > | |
    > +
    *
    *
    +
    > LEFT MOTOR * * RIGHT MOTOR
    > * *
    > +---*
    *----+
    > | H-BRIDGE |
    > +-+
    +-+
    > | |
    > | |
    > --+-- --+--
    > // \\ // \\
    > | | | |
    > \\ // \\ //
    >

    > LEFT MOTOR RIGHT MOTOR
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-04 07:17
    Thanks for your answer,
    I can use only one stick, the other is to control a camera which use
    two servo for moving up-down, left-right.
    So I have to translate the movement of two separate servos front-back
    and left-right to a combination of left-right motor so for example
    when the stick is in front-right position than means that the left
    motor will move at full speed and the right motor at its half speed
    so the vehicle will steer right. I hope to state my problem clearer
    this time.



    --- In basicstamps@yahoogroups.com, "Peter NL" <tfro@b...> wrote:
    > I'm not getting it:
    >
    > You have a 6 channel Radio control system and you want to control
    > two DC motors separately?
    >
    > I would say, hook up one engine to the left stick and one engine to
    > the right stick. No stamp needed
    >
    > For controlling the DC motors you can use any PWM controller
    (you'll
    > need two controllers or one 2-engine controller) that can handle
    the
    > power of the DC motors.
    >
    > If you want to steer the two engines configured in a tank-layout in
    > the normal left/right and forward/backward style you might find the
    > 6EXA capable of doing this.
    >
    >
    > --- In basicstamps@yahoogroups.com, "emm_frag" <emm_frag@y...>
    wrote:
    > > Hello,
    > > I'm trying to radio control my robot using a Futaba Radio Control
    > > system (6EXA).
    > > The problem is that I have to control two DC motors separately
    and
    > > not one motor for direction and another for movement (Like an
    Army
    > > Tank).
    > > I think that the solution might be to use a BS (BS2SX) to
    translate
    > > the PWM of the futaba receiver for the Left-Right Channel and the
    > PWM
    > > for the speed to two different outputs each for a DC motor. What
    do
    > > you think? Have you any better idea.
    > > Thanks in advance.
    > >
    > >
    > > +
    +
    > > | |
    > > | FUTABA RECEIVER |
    > > | |
    > > +
    +
    +----+
    > > | |
    > > |LEFT-RIGHT |SPEED
    > > |CHANNEL |
    > > | |
    > > +
    +
    +
    +
    > > | |
    > > | BS2SX |
    > > | |
    > > +
    *
    *
    +
    > > LEFT MOTOR * * RIGHT MOTOR
    > > * *
    > > +---*
    *----+
    > > | H-BRIDGE |
    > > +-+
    +-+
    > > | |
    > > | |
    > > --+-- --+--
    > > // \\ // \\
    > > | | | |
    > > \\ // \\ //
    > >

    > > LEFT MOTOR RIGHT MOTOR
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-04 07:29
    At 06:17 AM 4/4/04 +0000, emm_frag wrote:
    >Thanks for your answer,
    >I can use only one stick, the other is to control a camera which use
    >two servo for moving up-down, left-right.
    >So I have to translate the movement of two separate servos front-back
    >and left-right to a combination of left-right motor so for example
    >when the stick is in front-right position than means that the left
    >motor will move at full speed and the right motor at its half speed
    >so the vehicle will steer right. I hope to state my problem clearer
    >this time.

    I'm by no means an expert with R/C but I would imagine that the camera movement
    and the motor direction would not be occurring at exactly the same time. Thus, a
    separate channel could be used as a "function" indicator. If that "function"
    channel was active the motion commands would be routed to the motor controller,
    and if it was off, the motion commands would be routed to the camera controller.

    Hope that makes some sense, and partially answers your question.

    Regards,

    Bruce Bates
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-06 04:33
    At 06:17 AM 4/4/04 +0000, you wrote:
    >Thanks for your answer,
    >I can use only one stick, the other is to control a camera which use
    >two servo for moving up-down, left-right.
    >So I have to translate the movement of two separate servos front-back
    >and left-right to a combination of left-right motor so for example
    >when the stick is in front-right position than means that the left
    >motor will move at full speed and the right motor at its half speed
    >so the vehicle will steer right. I hope to state my problem clearer
    >this time.
    >

    I think I understand your request.... I have a scheme that I have used
    in the past that uses a very similar technique. What I have available
    is a QuickBasic4.5 program that allows you to simulate the "Joystick"
    position on the transmitter (with arrow keys). From here you should
    be able to play with the values and get a desirable result. The two
    horizontal bars represent a "Dead Band" where joystick activity is
    ignored currently this is set to +/-50uS from Center equaling 1500uS
    but can be adjusted for any value. There is a Gear option that I have
    used in the past for HIGH or LOW gear designs. Simply described if your
    joystick is on the edge or outside of the great circle then you are in
    HIGH gear, otherwise you are in LOW gear. Electronically this would
    switch in/out an extra battery pack or something to that effect depending
    on what mode you were in.

    ScreenShot:
    http://www.angelfire.com/wizard/y2kbc/STAMPS/RC/rc_joy.gif

    QuickBasic4.5 Program:
    http://www.angelfire.com/wizard/y2kbc/STAMPS/RC/rc_joy.bas

    Standalone EXE:
    http://www.angelfire.com/wizard/y2kbc/STAMPS/RC/rc_joy.exe



    Beau Schwabe Mask Designer National Semiconductor Corporation
    500 Pinnacle Court, Suite 525
    Home: polygon_man@h... Mail Stop GA1
    Work: bschwabe@a... Norcross, GA 30071
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-06 07:20
    Thanks for your answer Beau . I see what you did and it is most
    helpful.
    I also found this item that gives a simple and easy solution to the
    problem:
    http://www.robotlogic.com/product_imx1.html

    Thanks anyway.
    Manos




    > I think I understand your request.... I have a scheme that I have
    used
    > in the past that uses a very similar technique. What I have
    available
    > is a QuickBasic4.5 program that allows you to simulate
    the "Joystick"
    > position on the transmitter (with arrow keys). From here you
    should
    > be able to play with the values and get a desirable result. The
    two
    > horizontal bars represent a "Dead Band" where joystick activity is
    > ignored currently this is set to +/-50uS from Center equaling
    1500uS
    > but can be adjusted for any value. There is a Gear option that I
    have
    > used in the past for HIGH or LOW gear designs. Simply described
    if your
    > joystick is on the edge or outside of the great circle then you
    are in
    > HIGH gear, otherwise you are in LOW gear. Electronically this
    would
    > switch in/out an extra battery pack or something to that effect
    depending
    > on what mode you were in.
    >
    > ScreenShot:
    > http://www.angelfire.com/wizard/y2kbc/STAMPS/RC/rc_joy.gif
    > QuickBasic4.5 Program:
    > http://www.angelfire.com/wizard/y2kbc/STAMPS/RC/rc_joy.bas
    > Standalone EXE:
    > http://www.angelfire.com/wizard/y2kbc/STAMPS/RC/rc_joy.exe
    >
    ---
    > Beau Schwabe Mask Designer National Semiconductor
    Corporation
    > 500 Pinnacle Court, Suite 525
    > Home: polygon_man@h... Mail Stop GA1
    > Work: bschwabe@a... Norcross, GA 30071
    >
    ---
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-26 07:42
    Hello,
    I'm trying to interface an RC receiver(Futaba) with a basic stamp
    (BS2SX) so I need to convert the RC signal into bits some how. Can I
    do it using the Pulsin command? Any connection schematics, is it
    possible to connect the receiver directly with the I/O pins of my
    stamp?
    The reason for doing this is to control two DC motors, among other
    things.
    Thank you all.
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-26 14:11
    Yes, the Futaba reciever output should be
    a normally low signal, pulsing high (5V) for
    1 to 2 mSec every 20 mSec. 1 mSec means
    'all the way left', 2 mSec means 'all the
    way right', and 1.5 mSec means 'Center'.

    You should use 'PULSIN' to grab the signal
    every 20 mSec or so (since it repeats, if
    you miss a few pulses it should be no
    big deal.)

    Make sure your BS2 and the Futaba reciever
    have a common ground, or you won't get
    accurate readings.

    --- In basicstamps@yahoogroups.com, "emm_frag" <manos@e...> wrote:
    > Hello,
    > I'm trying to interface an RC receiver(Futaba) with a basic stamp
    > (BS2SX) so I need to convert the RC signal into bits some how. Can
    I
    > do it using the Pulsin command? Any connection schematics, is it
    > possible to connect the receiver directly with the I/O pins of my
    > stamp?
    > The reason for doing this is to control two DC motors, among other
    > things.
    > Thank you all.
Sign In or Register to comment.