How do I give a radio control car autonomous control


Closed Thread
Page 1 of 5 12345 LastLast
Results 1 to 40 of 191
  1. #1
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483

    Default How do I give a radio control car autonomous control

    I am trying to modify a 1/10 scale RC car to carry a microcontroller with the capability of taking over control of the car. The idea is to hook middle school students into Science, Technology, Engineering, Math by creating a vehicle that can perform both under RC and autonomous control. Controlling the servos and the motors is nothing new. I have found nothing of the interface between the radio control receiver and the microcontroller. Anybody have some suggestions?

  2. #2
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Here's a simple pulsein example for reading what the receiver is sending the servo's:

    http://www.picbasic.co.uk/forum/showthread.php?t=12039


    And I used the RCAP pibasic pro based autopilot on an rc plane. I know a few people that have used it to control RC cars. This requires a GOTO gps (like handheld garmin, etc). But for extra credit, the cordic could be used to determine the distance and direction from one waypoint to another ... that is, if gps was in your plan.

    Some info, and the picbasic code can be found here:

    http://en.wikibooks.org/wiki/RC_Airplane/RCAP

    Walter

  3. #3
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Define your vision of 'autonomy'.

    When I was a little girl, a favourite uncle of mine gave me a toy electric car for Christmas. It had one switch ON/OFF. Switch it on and the wheels drove forwards in a straight line until it hit an object. On impact, the polarity to the motor was then reversed for a couple of seconds, but because of the central front wheel (it looked like it drove on four, but the two visible front wheels were actually dummy) was housed in a curved slot, when driven backwards the car would swing to the left. The polarity would then switch back and it shot off forwards in a new direction. In this fashion it could travel all round the room - completely autonomous - until the Batteries went flat or you switched it off.

  4. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,611


    Did you find this post helpful? Yes | No

    Question

    Hi, Mel

    Pretty good question ...

    let's suppose the model must stay on a 1/10 scale winding road ...

    ... As it was in the Beatle's song ... a long and winding road.

    Precision of a GPS can be enough for a plane ... but a model car ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  5. #5
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    You are right, you need a wide road for the RCAP as it is. And no, it is not autonomous, but it includes many of the items that Kenjones1935 is asking about, like an example of a connection to the receiver that allows either transmitter control, or switched to "autopilot" mode, where the pic controls the servo. But I would love to see more examples as well!

    Here is 4 or so trecks down a the straight, wide (1/1 scale) roads. Another good place would be a soccer field.

    Attached Images Attached Images  

  6. #6
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483


    Did you find this post helpful? Yes | No

    Default A couple more details on my vision

    Thank you all for your encouragement and suggestions.

    My vision is a car that can be raced using the regular RC control on a circuit defined in the basketball court of the middle school gym but then the track leads underneath the fold down bleacher seats. The student running the RC can not see under the stands. Remember that under there on the floor are many supporting structures. The car must avoid these on its own.

    A different vision is to have the same track on the gym floor, but including a maze made from, say, cardboard boxes that the car must navigate. We could put Xmas tree lights over each of the exit holes in the boxes. In autonomous mode the car could sense the lights.

    RC cars have beautiful model suspensions. They go very fast and are quite indestructible. From the point of view of developing STEM thinking they are missing a formal language and repeatable controls. I are trying to marry the two.

    Ken

  7. #7
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Maybe just leave the RC part intact. Add another RC channel and another board.
    The second board would be for auto.
    The added RC channel would be to switch power from one board to the other.
    Dave
    Always wear safety glasses while programming.

  8. #8
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483


    Did you find this post helpful? Yes | No

    Default Racing RC car vs LEGO RSX car

    Yes, this idea might work.

    My problem is that I do not know the details of the I/O signals of the various parts of these 'bots. With LEGO RCX the outputs to the motors come directly from the encapsulated microcontroller system. The motors are not as powerful as those in a RC car. The commands available to the RCX from the ROBOlab program have seven levels of power.

    The RC cars, on the other hand, are driven by a 7.2 volt battery pack through a box called a "speed control". Speed control gets its signal directly from the RC receiver. I think it is treated as a servo. Is this pulse width modulation?

    I am hoping to borrow an oscilloscope soon.

    Ken

  9. #9
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    This might help some.
    http://ww1.microchip.com/downloads/e...hapter%205.pdf
    and the suggestion up in post #2 also.

    But yes, PWM is how speed is controlled. How your car is setup I do not know. Maybe if you gave a brand/type someone here might know off hand?
    Dave
    Always wear safety glasses while programming.

  10. #10
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483


    Did you find this post helpful? Yes | No

    Default Motor control in my radio control car

    Still finding it difficult to find the I/O details of my radio control receiver and my electronic motor speed controller. What is on those three wires (white, red and black) between the receiver and the ESC?? Also what is the information format on the three wires (blue, red and black) between the receiver and the servo?

    RC receiver: FUTABA FP-R122JE am 2 channel BEC

    ESC: NOSRAM Tomahawk Reverse 93050

    motor: MABUCHI RS-540RH/SH

  11. #11
    Join Date
    Feb 2009
    Posts
    36


    Did you find this post helpful? Yes | No

    Default

    I have done a lot of work on Autonomous control of RC cars, helis and airplanes. My applications have mostly been on stabilization and waypoints for aircraft using in inertial measurement unit (IMU) board. On the RC car, I ripped out the simple RC controls and replaced them with a Specktrum RX.TX system. I used a PIC processor to convert the throttle PWM signal into something the existing H Bridge motor controller understood and replaced the steering servo with a standard RC servo. I have a camera on a servo controlled pan and tilt servo system, and added things like the Parallax PING sonic distance sensor, and compass module and a GPS (but this only works outside). There are a lot of things you can think of adding.

    Looks like you already have a real RX/TX system with a BEC/ESC to a motor. The signal going from the RX to the ESC; Red/Black/Blue(sometimes different color) are +V/GND/Signal. Signal is a Pulse Width Modulated signal whose width tells you how much throttle to apply. Typically this signal will be 3.5v (or so) and a width of 1.2 to 1.8 usec, depending on throttle setting.

    Autonomous control will depend on what you want to do and what sensors you need to accomplish it. Waypoints won't work indoors with a GPS, but you can memorize a track, detect obstruction, follow a wire or tape track, lots of things.

    A very sophisticated version of indoor automony is a laser scanner that basically maps its environment, but very pricey. You could try a sonar version of this using the PING sensor, lots of math and geometry involved.

    Good luck and have a lot of fun with your students.

    John

  12. #12
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483


    Did you find this post helpful? Yes | No

    Default Getting somewhere...

    Thank you, John for answering my questions. I am out here in the middle of Massachusetts. Is there a robotics club around?

    My RC car is not the correct one for this job. It has 4 wheel drive and hence a drive belt down the middle where I would mount the PIC. I refer to it because that is all I have. If this idea takes wings a new car can be purchased.

    My first thoughts for autonomous control sensors is simple sonic proximity detectors. If they looked to the right and to toward the front, I'll bet I could program the car to follow a wall (close on its right side) until it found an opening (in a corner). Or something....

    I need to pick a PIC. I've been told that VEX uses Microchip's 18F8520. Our local technical high school has some VEX kits, but I do not have access to play with them. Any suggestions would be greatly appreciated.

    I am a retired digital hardware and software designer. I still have my Texas Instruments 7400 Series TTL catalog. I have not done hardware design since the early 1980's. I am way out of touch.

    Ken

  13. #13
    Join Date
    Feb 2009
    Posts
    36


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Kenjones1935 View Post
    Thank you, John for answering my questions. I am out here in the middle of Massachusetts. Is there a robotics club around?

    My RC car is not the correct one for this job. It has 4 wheel drive and hence a drive belt down the middle where I would mount the PIC. I refer to it because that is all I have. If this idea takes wings a new car can be purchased.

    My first thoughts for autonomous control sensors is simple sonic proximity detectors. If they looked to the right and to toward the front, I'll bet I could program the car to follow a wall (close on its right side) until it found an opening (in a corner). Or something....

    I need to pick a PIC. I've been told that VEX uses Microchip's 18F8520. Our local technical high school has some VEX kits, but I do not have access to play with them. Any suggestions would be greatly appreciated.

    I am a retired digital hardware and software designer. I still have my Texas Instruments 7400 Series TTL catalog. I have not done hardware design since the early 1980's. I am way out of touch.

    Ken
    Hi Ken

    I'm out in Colorado, so don't know much about clubs in Mass, but you do have MIT there and they are well known for their work in robotics. You might see if you could connect with them. The laser scan I mentioned was at MIT. Here is a link you might enjoy:

    http://diydrones.com/profiles/blogs/...ter-with-laser

    I don't really know about VEX, but I have chosen my PICs based on numbers of hardware PWM channels, ADC channels etc...so depends on application. I never found I taxed the speed of the processor.

    One thing I started, but never really finished was to put a PING on a servo so I could rotate it left and right. I took a left/right scan and stored the distances to detected obstacles, basically making a map. I could then make decisions on where to go next. You can't really scan very fast though due to a couple of things. The first is that you need to make redundant measurements to filter noise out at each setting, and then the servo is constantly moving and can limit it's lifetime. So this isn't useful for a fast moving car, but maybe a crawler. I like the idea since it requires some math and algorithm development as a learning project.

  14. #14
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483


    Did you find this post helpful? Yes | No

    Default What a great video!!

    John,

    Thank you for the pointer to the quadcopter video. It is spectacular.

    I am a member of the Cardinal and Gray. The alumni organization for those who graduated from MIT over fifty years ago. I have been looking unsuccessfully for an alumni robotics club.

    My impression is that the RC cars world (no microchip) and the VEX school competition world (both RC and autonomous but mostly RC) and the robotics world are completely separate. Then of course there is the land of production machine control.

    The RC cars motor can draw up to 80ampere. These cars have a 7.2 volt battery pack that feeds directly to the ESC which in turn gives a dribble of power to the RC receiver. If the micro proto board which has its own battery pack were to provide the PWM signal to the ESC might I not have a power problem?

    Really my problem is getting started. I thought the micro controller could be the middle of the car. The RC receiver gives it a low power PWM signal as per usual. When under RC control the micro interprets then passes this signal onto the ESC. If that were the design, the micro could take over control on its own without a command from the human.

    I need to pick a microcontroller either a fully packaged one like the VEX, the RCX or the NXT or a proto board. In my past I programmed in machine language and on RISC. More recently it was C, C++ and some higher level languages. That was alll in the work office environment. At home I am starting from scratch. If this looks promising I am pretty sure I can get some help. I need a basic design.

    Ken

  15. #15
    Join Date
    Feb 2009
    Posts
    36


    Did you find this post helpful? Yes | No

    Default

    Ken

    You probably need to decide if you want the flexibility of a bare PIC or a package that is already programmed. I went with the PIC since I can basically make it do anything I want.

    There is a price to be paid to get in that game however. Perhaps you already have all the infrastructure, if not you will need a programmer to write to the PIC, and then decide on the language. Since you are on this forum, you may have PICBasic. If not, you can go assembly (free), C (also free from MicroChip without optimization), or some other language (maybe free, maybe not). There are a lot of programmers out there. MicroChip has some, but other vendors too. I use an ICD2 clone from Sparkfun and PICBasic Pro for smaller PICs and the MicroChip C30 C compiler for dsp chips. I also program in asy, but I can get a lot more done with Basic or C.

    If you go the PIC route, I would just use a proto board to build up your circuits.

    I typically use an 11v LiPo battery to a BEC to get 5 volts for the board. You can actually take the power off the RX on the Red and Black wires of any channel. This is very low power drain compared to the motor and servos.

    Just a suggestion, but I would use an RC car or truck that has a very slow speed option. Fast isn't good when you are trying to debug sensors and code.

    One way to switch between manual RC and Auto is to use a channel of the RX that the PIC reads. If it is high, then manual, low then auto for instance. but you need a spare channel. I use a Specktrum DX-7 TX/RX with 7 channels for all the goodies I need to control. This approach is useful if the Auto goes nuts, you can switch to manual with the flick of a switch.

    This can get a little expensive to start, but if you plan to stick with it and do similar projects, I think the basic building block approach gives you the most fun....but then again I don;t know what the VEX etc are. And I do a lot of this on many different platforms.

    Did I understand you were involving students? It's a great learning project.

    John

  16. #16
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483


    Did you find this post helpful? Yes | No

    Default autonomous ex-RC car that goes around the block

    The Tech Junkies have this video. They removed the RC control and made the car completely autonomous being guided by the gps satellites.

    Their Arduino proto board has a voltage regulator. It produced a 5 volt supply from the 9 volt battery. This would allow me to keep using the 7.2 volt battery pack. I was hoping to keep the speed capability of the RC car.

    Ken

  17. #17
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483


    Did you find this post helpful? Yes | No

    Default

    You wrote:

    "One way to switch between manual RC and Auto is to use a channel of the RX that the PIC reads. If it is high, then manual, low then auto for instance. but you need a spare channel. I use a Specktrum DX-7 TX/RX with 7 channels for all the goodies I need to control. This approach is useful if the Auto goes nuts, you can switch to manual with the flick of a switch."

    Is that as easy as flipping a double pole double throw switch under PIC control?

    I have not chosen a PIC. Is the PICaxe Starter Kit for fifty bucks what you would recommend? It does not have any spare proto space. Are pretty much all the sensors I might need directly connectable? Will I need additional off board interface circuitry for, say, a servo or a simple on/off motor? Microchip sells a PIC18FXX20 Demo Board. It contains their 18F8720. I think VEX uses their 18F8520.

    I gotta purchase something and get started. One more thing. I have both Windows and Linux PC's at home. I assume that most everybody uses Windows.

    Ken

  18. #18
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483


    Did you find this post helpful? Yes | No

    Default Tech Junkies Video

    I don't know how I did not post this URL yesterday

    http://ttjcrew.com/

  19. #19
    Join Date
    Feb 2009
    Posts
    36


    Did you find this post helpful? Yes | No

    Default

    Hi Ken

    Just looked at the video. Remarkably, this is very similar to what I did and described in my earlier post. Some similarities/differences...I used a larger RC truck platform with 4WD (a junker from Radio Shack), I also ripped all the electronics out and replace the old steering motor with a real servo, I ripped out the RX and motor controller, but kept the H Bridge to be used under PIC control. They put in a new H Bridge, but looks like it was on or off, mine had variable speed control determined by the TX input. They were purely autonomous GPS (only works outdoors). I used a Spektrum DX-7 TX/RX RC system so I could have both RC and Auto control. They used an Arduino board from Sparkfun, I used the MicroChip PIC and my own proto board.

    So you see there are many ways to go.

    I looked up the VEX system. This is pretty much a lot of plug and play modules that you can buy to do robotics. I think you may still need to buy a TX/RX to have RC control...can get pricey. But you will have to choose.

    I am not that acquainted with the various kits that Microchip sells...perhaps others can comment.

    I went entirely from the ground up. ICD2 programmer (there are others you can use), I started in assembly but then bought PICBasic Pro (also easy to convert a lot of my old Basic Stamp programs), some 16F88 and 16F627A PIC chips, some proto boards, and supporting electronics (voltage regulator, caps, resistors, jumper wires, header pins,,,,) and built up the hardware and software to make it all work. Most of the sensors from Sparkfun or Parallax will work off a PIC, but you have to read the spec sheets. You will need the usual lab stuff, soldering station, with general electronic parts, batteries, power supplies, and I found the Parallax USB oscilloscope to be absolutely essential in debugging the code. Plus I already had the DX-7 TX/RX. Starting from scratch, this is also pretty pricey way to go. But I had a lot of the stuff and I wanted to be able to modify the control systems at the PIC level for all my projects.

    I don't know what you have nor your skill level in this area. You can get some help here on the Forum, but if you go with a plug and play system, it is more turn key and probably forums for those as well. Looks like the Tech Junkie website will have all the code and schematics for what they did, but you would have to go with the Arduino boards which use Atmega chips, not PICs.

    Take a look at the DIYDrone website and the ArduPilot system there. this is a great site for autonomous systems, and it is all freeware with most of the parts from Sparkfun. They have lots of stuff you might be able to use and a forum to get a lot of answers....and it is all as cheap as you can get. check this out:

    http://diydrones.com/profiles/blogs/ardupilot-main-page

    I have a blog there on using a dsPIC IMU system for model helicopters, still PIC based but use C code and microcode C compiler.

    You will have to decide the route you take, but it can be a lot of fun.

    Good luck

    John

    Oh...your question on switching from manual to auto...the switch is on the TX. It sends either a short PWM or long PWM to the RX and the PIC reads this to decide if it passes TX signals directly to the servos (manual) or is in control of the truck (auto)....not DTDT switches. And I also use Windows.
    Last edited by John_Mac; - 14th November 2009 at 03:10.

  20. #20
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483


    Did you find this post helpful? Yes | No

    Default My idea is taking shape

    Here's my idea.

    The underlying purpose is to interest middle school kids in STEM.

    Hobby level RC cars are technically really neat but the engineering is mostly cut and try. Missing is an element of formal language combined with intent. You know formal language as a "blue print" a "recipe" a "musical score" a "program".

    I suggest a competition, a race, to be held in the Longsjo Middle School (Fitchburg, Mass) gymnasium plus its lobby. The racing vehicles are 1/10 scale RC hobby level cars or trucks. The race course is delineated on the basketball court by four inch plastic flexible conduit and maybe some traffic cones. The course extends out into the lobby to which there are two doors the width of the basketball court apart.

    Inside the lobby is out of sight for the kids handling the RC transmitters. The regular lights are dim in the lobby. A bright light is placed in the doorway that leads back into the gym. The cars must find their own way back into the gym.

    Let's guess three or four cars racing each other. The first car to complete three laps wins.

    Can I build a car system robust enough to withstand the violence and simple enough to program? I am thinking of a simple language like ROBOlab or Terrapin LOGO. Both of these can easily follow a black line with a light background. I have done that. I think they could also easily find and go to a beam of light.

    What do you think? Will it work? Is it practical? Should I start with a PICaxe kit?

    Ken

  21. #21
    Join Date
    Feb 2009
    Posts
    36


    Did you find this post helpful? Yes | No

    Default

    Good plan Ken...and glad you are getting students involved.

    I cannot comment on the language you quote since I have no experience with them. What you describe, however, sounds very well suited to the Basic Stamp. Look at the Parallax site and look for the Board of Education. This is a Basic Stamp processor with an integrated proto board and voltage supply/regulator. It comes with a Basic Stamp program editor and integrated USB programmer. There are lots of example programs and Parallax sells lots of sensors to interface to it. I actually started my RC truck project on a Basic Stamp. The major limitation was that it has limited program storage for lots of variables. But for simple programs, it is very adequate. they also have more advanced Propeller systems as well. The nice thing about the Basic Stamp is that if you want to go more sofisticated on a PIC, you can get the PICBasic compiler (this site) and the programs port with little changes.

    The competition you describe sounds very challenging. Depending on what the obstacles are in the lobby, you may run into some serious navigation issues. An arbitrary course with chairs, tables, cabinets etc would require a great deal of sophistication to navigate. You could put some "clues" in there, such as bright LEDs or something a simple detector can locate and navigate to. If you think of tight turns with an RC car, it requires backing up, turning, etc. hard to do completely autonomously, but not impossible.

    I strongly recommend you take a good look at the Basic Stamp. Easy start up, few extra components, relatively cheap (you might get an education discount), simple sensors, and lots of programs out there to build on. It is also an easy step to upgrade to a more complex PIC system from there.

    John

  22. #22
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483


    Did you find this post helpful? Yes | No

    Default Parallax looks good

    Thank you , again, John,

    The Parallax products look just about right. They also seem to offer plenty of support.

    Initially I would have no obstacles out in the lobby of the gym. The car would still have to make a 360 turn to find the light at the exit door, then go to it. If I place the light correctly the car would reappear to the RC transmitter person once it reaches the light.

    The RC car suspension could be challenged by putting wooden ramps in the gym floor course. The type of tire affects their skidding. Which in turn affects their turning ability at speed.

    Thank you again and again for your help.

    What do you do professionally? How did you get so involved in RC/auto
    flight?

    Ken

  23. #23
    Join Date
    Feb 2009
    Posts
    36


    Did you find this post helpful? Yes | No

    Default

    Hi Ken

    My pleasure and good luck. Retired physicist here, always played with RC and processors/sensors....just not together. Now that I have time I, get to play with my toys

    Happy to share ideas and code/schematics, or just another set of eyes.

    John

  24. #24
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483


    Did you find this post helpful? Yes | No

    Default The radio receiver PWM signals??

    I am new to Parallax. It comes highly recommended.

    I wish to build a 1/10 scale hobby level radio control car that can also run autonomously. I think they have a PIC that can do the job. The question is how do deal with the Pulse Width Modulated signals that come from the radio receiver. Presently they go directly into the electronic speed control module and the steering servo. I thought that for my design I could use them as inputs to the PIC.

    I hope that I do not have to use PIC code space and compute power to continuously sample the three RC receive channels. Is there some kind of transition detector which can digitize the PWM signals? I assume the PIC input can figure when they change.

    If Parallax does not make an appropriate micro to be the central brains of this operation I can use a DPDT switch under PIC control to steer the PWM signals. There has to be a signal from the radio transmitter telling the car which mode is appropriate. That signal has to be interpreted by the micro somehow.

    Ken

  25. #25
    Join Date
    Feb 2009
    Posts
    36


    Did you find this post helpful? Yes | No

    Default

    The Basic Stamp has a function called PULSIN that will give you the width of a pulse on one of the input pins. You can sample multiple pins (input pulses). You can put these 3 PULSIN functions in a loop to keep sampling the PWM inputs. This can be a call in a larger loop that does other things. It shouldn't take much of the CPU power.

    The way I do it is to route the RX PWMs into the Basic Stamp then let the code decide if it merely duplicates the pulse in software to the appropriate servo (manual mode) thru an output pic, or let the code take over control (auto mode). No relays or switches to route PWMs, the processor does it all in software.

    A note of caution....the Tx/Rx that comes with most (inexpensive) RC cars is not a typical system that you would get if you had a regular RC Tx/Rx system (3 wire standard servo cabling). I ripped all of the truck controls out and replaced with a standard Tx/Rx system (Specktrum DX-7). Not to say you can't make it work, but you better have an oscilloscope and a lot of patience.

    The other advantage of a real system is you have more channels to use for more features. One channel can be to tell the car if you want manual or auto for instance.

    As I mentioned, I migrated to the PIC from the Basic Stamp to get more power and capability...but still think the Stamp is a good place to start.

    John

  26. #26
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483


    Did you find this post helpful? Yes | No

    Default Comment from the Parallax forum

    John,

    I got the following from a Mike Green on the Parallax forum. I think he is agreeing with your decision to migrate up from the Basic Stamp.

    With my 1/10 hobby car came a three channel RC unit. One for the DC drive motor, one for the steering servo, and a spare. I thought I could use the spare for the auto/RC toggle. This car is just an experiment to get a working prototype. Once that is done I might be able to find some money for a "real" prototype. There is quite a bit to consider in selecting the race car/truck itself. What do I want to teach about suspensions? I'm not sure.
    ----------Mike wrote----------
    "There is no mechanism for the Stamp to automatically sample the RC channels. Typically you'd use a sequence of 3 PULSIN statements, one for each channel. The RC receiver normally receives one channel at a time and the PWM signals occur in sequence and repeat about 50 times a second. There's not much time left to do control functions once you account for timing 3 RC receive channels and 3 servo PWM output channels. It's possible to offload the PWM output functions, but I don't know any ready-to-go PWM input processor.

    "I would strongly suggest you look at the Propeller. It can easily do the RC receiver timing and the servo PWM generation with two cogs (processors) and have plenty of processing power to do whatever control functions you need. The Propeller Servo Controller is a compact board that comes pre-programmed with a 16 channel servo controller, but the outputs can also be used as inputs by modifying the control program."

    My next step is to examine the Propeller.

    Thanks again..
    Ken

  27. #27
    Join Date
    Feb 2009
    Posts
    36


    Did you find this post helpful? Yes | No

    Default

    Mike is correct on the sampling times, however I have made things work well for this application at a much lower rate....basically whenever it gets to it. This can lead to some choppy response on the throttle and steering servo, but nothing bad unless you really load down the processor doing other things.

    The Propeller is a better chip, but look carefully at the overall cost of all the cogs and infrastructure compared to a PIC system....might still be cost effective, never used one.

  28. #28
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483


    Did you find this post helpful? Yes | No

    Default Maybe we're back to DPDT switched

    mackrackit suggested that I use a third RC channel to toggle disconnecting the PIC when under RC control. It does sound like the simplest and maybe the least expensive way to go. Trouble is I do not know how to do this.

    Is it as simple as inserting a double pole double throw switch that is controlled by the third channel into the signal line between the RC receiver and the electronic speed control? And another between the receiver and the steering servo?

    Will surges and the like kill the electronics? It would be safest if there were a way to guarantee the motor being off and the servo being neutral when toggling. John, mackrackit, what do you think?

    Ken

  29. #29
    Join Date
    Feb 2009
    Posts
    36


    Did you find this post helpful? Yes | No

    Default

    Personally I would go with what I described....software control. But someone might come up with an elegant solution. I really don't think you have to keep up with the 25ms servo rate. I have done several applications at lower rates and it works fine. So most processor will work just fine in this mode.
    Last edited by John_Mac; - 16th November 2009 at 23:28.

  30. #30
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    John made some good points as to why a hardware solution may not be to your liking.

    On the flip side side, a software solution can also have some draw backs. I am coming from an industrial point of view so maybe something non-critical as a RC car could be looked at differently...

    To go from manual to auto with software at least one ASM interrupt is needed, depending on the application you may want more from different sources. In your case on should be enough. If the operator can not see the car then switch to auto. Using software the code can be cumbersome. Say you are running in manual. Are you still keeping track of the sensors? That can get to be a neat trick, code space and all. If you do a hardware switch, the auto part can keep monitoring the inputs just as it would if it was in control. This way, when auto does take over it is near seamless.

    Good and bad both ways.

    If you do go with the hardware solution and the RC part of the car (manual) is still intact then you are halfway there. Find were the inputs to the MOSFET bank are or the motor controller and that is where the DPDT relay will go. Being the control signal is the only thing that is switching the only surge you will have to worry about is from the relay coil. A flyback diode will take care of that.

    But either way you go, keep us posted. I have some young ones I am also teaching.

    BTW.... I only use windows when I have to...
    Dave
    Always wear safety glasses while programming.

  31. #31
    Join Date
    Feb 2009
    Posts
    36


    Did you find this post helpful? Yes | No

    Default

    Hi Dave

    I agree it depends on the level of glitches you are willing to put up with. I have done what Ken describes with a PIC in a single loop. The call to read PWMs is one element. Sensor analysis is other.

    I don't use an interrupt on the lower level PICs. I simply read the mode channel PWM. If it is below some value I jump to manual, if above then to auto. Very simple.

    I do much more in the dsPIC which actually interrupts every PWM pulse, but that is way beyond what Ken is talking about. Without interrupts on a mid-range PIC, the throttle will seem a little sluggish in response to changes, this is due to the fact that it is being sampled at less than its normal 25ms rate. But this really isn't a big deal for an RC car. Same is true with steering.

    I would think that the sensor calls would only be in auto mode. So no real impact to manual response times. All depends on the details of what Ken ends up doing. I think a simple start is best. There is a big learning curve.

    John

  32. #32
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by John_Mac View Post
    I think a simple start is best. There is a big learning curve.
    Yup, as I was advised a while back when I asked "ASM or PBP first?" the general consensus was to make things as simple as possible so the students would not lose interest.

    Keeping the kids excited about something makes MCUs seem easy
    Dave
    Always wear safety glasses while programming.

  33. #33
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483


    Did you find this post helpful? Yes | No

    Default I'll go with the least complicated.

    Seems that using DPDT relays is the easiest approach to get this car on the road -er gym.

    Parallax has been suggested.

    If I go with Parallax I need:

    BASIC Stamp 2e Module $54.00
    either:
    BASIC Stamp 2pe Motherboard $70.00
    or
    Board of Education (USB) - Full Kit $100.00

    From TYCO or, 2 AXICOM V23105 dpdt DC relay ~$5.00 each

    Maybe some parts from Radio Shack like 7.5 volt power supply and a USB cable.

    What else besides my RC car a work bench and some time?

    Ken

  34. #34
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Ken,
    Do you have a copy of PicBasic? If so then a PICKIT2 from microchip is less than the cost of a stamp. Micrchip also has a samples option for some of their chips.

    The syntax between PB and stamp basic is minimal. But you have many more options with straight PICs. $54.00 for each project

    I bet if you explained what you are doing in a letter on your schools letter head you might get some help from Microchip and Melabs.
    Dave
    Always wear safety glasses while programming.

  35. #35
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483


    Did you find this post helpful? Yes | No

    Default I think the DPDT approach is worth further study.

    Seems that using DPDT relays is the easiest approach to get this car on the road -er gym.

    Parallax has been suggested.

    If I go with Parallax I need:

    BASIC Stamp 2e Module $54.00
    either:
    BASIC Stamp 2pe Motherboard $70.00
    or
    Board of Education (USB) - Full Kit $100.00

    From TYCO or, 2 AXICOM V23105 dpdt DC relay ~$5.00 each

    Maybe some parts from Radio Shack like 7.5 volt power supply and a USB cable.

    I also need a one dimensional light sensor if my BOT is going to find a glowing light bulb on the floor by the exit door.

    Parallax has the:
    TSL1401 Linescan Imaging Sensor Daughterboard $50.00

    What else besides my RC car a work bench and some time?

    Ken

  36. #36
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483


    Did you find this post helpful? Yes | No

    Default Is the TSL1401 too much for my job?

    After reading the details of the Parallax
    TSL1401 Linescan Imaging Sensor Daughterboard
    it seems like overkill. All I want to do is detect that my BOT is pointed at the brightest light in the room. A simple light detector like is used to follow a black line on the floor should be good enough.

    Suggestions?

    Ken

  37. #37
    Join Date
    Feb 2009
    Posts
    36


    Did you find this post helpful? Yes | No

    Default

    Take a look at the QTI Sensor on the Parallax site...only 6 bucks, emits and receives IR to follow line.

    But I'm not sure if you want to follow a line or seek out a bright light??????

    John

  38. #38
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483


    Did you find this post helpful? Yes | No

    Default I want to seek out a bright light.

    John,

    I only mentioned the follow-a-line to indicate how simple my needs are. The $50 sensor has great pattern recognizing capability. All I need is something to attach to the front of the car which can tell it that it is going in the right direction. If this device had a lens that would be the best design. If it had a reasonably narrow lens angle then once the BOT found the light, it could stay well directed.

    Ken

  39. #39
    Join Date
    Feb 2009
    Posts
    36


    Did you find this post helpful? Yes | No

    Default

    Ah OK got it.

    The problem with a simple light detector and lens is that it gives you no positional information as to where to go to seek higher intensity. The linescan sensor you mentioned does due to its pixelated imager...but as you say expensive.

    One thing I did similar to this was to mount the detector on a servo that can scan left to right and back. I issued position commands to the servo, then read in the ADC value of the sensor, moved the servo, recorded data, etc. The servo positions were mapped to the forward axis of the truck. A steering correction could then be calculated. Only a few positions are needed to determine if you need to turn to a higher intensity direction, but you need to oversample to filter out noise. Make your steering correction, then start a new scan. You may need a digital filter on the corrections so that you don't oscillate around the proper direction.

    You can always buy a smart sensor, but why not make a simple (cheap) one and make it smart with your processor? Also more of a learning experience.

    Just a thought.

    John

  40. #40
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Three photo-resistors set 30 to 45 degrees apart (one straight ahead)with a little shielding on each.
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. Car radio (Car radio and electronics support forum)
    By freewillover in forum Forum Requests
    Replies: 1
    Last Post: - 1st July 2009, 20:41
  2. Remote Car Starter Safety
    By CocaColaKid in forum General
    Replies: 8
    Last Post: - 22nd November 2005, 10:10

Members who have read this thread : 1

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts