Shop OBEX P1 Docs P2 Docs Learn Events
First Project – Adding basic computer radio programming features to 2 channel t — Parallax Forums

First Project – Adding basic computer radio programming features to 2 channel t

__y5__y5 Posts: 2
edited 2008-07-25 14:56 in BASIC Stamp
Hello,
I started working with the BASIC Stamp Discovery Kit in January, and wanted to start my first project outside the examples in the book.
Project Overview: I have a few remote control cars with basic 2 channel proportional transmitters. The cars go too fast for new users so when my kids and their friends play the cars end up getting broken.
I would like to add a switch for a low setting (or speed governor) to limit the maximum speed. My idea is to clip the wires going from the potentiometer for the speed trigger to the existing circuit board and place between the pot and board another board with a processor that will read the input and then limit the resistance sent to the original board.
I have studied Chapter 5, Measuring Rotation, of What’s a Microcontroller and understand how to convert resistance to time using the function RCTIME to measure the dial, but I don’t understand how I would then convert this to the correct resistance.
Here is my pseudo-code:
Declare two variables currRCTime to store current RCTIME and currResistance to store the current resistance based on the currRCTime (don’t know how to calculate), and two constants, one maxResistance to set the for maximum resistance to send to the original board and one, maxRCTime for maximum allowed RCTIME.
· Do…Loop with code block to capture RCTIME (ReadPotWithRCTime.bs2 code).
··· IF Then statement to check currRCTime <= maxRCTime
···· If yes, send currResistance (don’t change input from pot)
···· If no, send maxResistance (limit the resistance sent to the board).
·
Thanks for any help or for·pointing me to reference material that will help me solve the above. I have a few follow up questions, but I want to build the test code for the above before I try to attach anything to my BASIC Stamp board.···
Thanks,
__y5

Comments

  • ZootZoot Posts: 2,227
    edited 2008-07-24 17:12
    Rather than digitally recreating resistance, there a few (perhaps) simpler approaches:

    - install a microcontroller (Stamp or SX) in the vehicle(s); use PULSIN to measure the output pulses of the RC RECEIVER in the vehicle. These are digital pulses, and quite easy to read. Then have the microcontroller reproduce the pulses for the vehicle *as if it was an RC receiver*. At that point, you can easily have your code adjust maximum speeds (pulses) and do other things too -- like acceleration, automatic shutdown, etc. Essentially you have a robot car with no sensors except reading RC pulses from the receiver and then acting on them (i.e. the "robot" will do whatever speed/turn it is sent, but will limit the speed).

    - hack the transmitter, but instead of a processor, put a limiting resistor on the end of the pot you want to limit. Perhaps drill the case for a toggle switch that bypasses the limiting resistor (when bypassed, you'd be able to drive full speed). Essentially what you are doing here is not letting the pot get to what would be it's minimum resistance on one or both sides (where the voltage out is closest to max or to 0).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php


    Post Edited (Zoot) : 7/24/2008 6:08:22 PM GMT
  • ercoerco Posts: 20,256
    edited 2008-07-24 18:03
    I second Zoot's second idea for simplicity. Per the attached sketch, you only add one DPDT switch (or a DPST switch, but they're rare) and two tiny fixed resistors, values obtained experimentally, but probably somewhere between 1K-5K.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
    410 x 308 - 18K
  • __y5__y5 Posts: 2
    edited 2008-07-25 14:56
    Thanks for the help. I will try adding the resistors and DPDT between the pot to see how this works. I would still like to build a processor to handle the remote. Like Zoot pointed out once I can control the input there are a lot of different things I can control besides limiting speed.

    I thought about trying to capture the pulses of the RC receiver but these are inexpensive RC cars and the speed control, receiver, etc are all integrated on one board and I'm not sure where I would capture the output pulses from the receiver. I would also like to prototype the system on my BASIC Stamp Board without actually connecting any parts from the RC car.

    Would I use a digital potentiometer as described in Chapter 9 of "What's a Microcontroller" to digitally recreate resistance?

    Thanks again,

    __y5
Sign In or Register to comment.