Shop OBEX P1 Docs P2 Docs Learn Events
Adapting an Board of Education w/ a Frequency crystal to control an R/C car — Parallax Forums

Adapting an Board of Education w/ a Frequency crystal to control an R/C car

neverfinishedneverfinished Posts: 7
edited 2012-11-14 22:13 in Robotics
I have a 2 channel transmitter with a 27.145mhz crystal. I have a matching crystal on the reciever of 27.145mhz which is mounted onto the R/C car.2 channel is a minimum because i have to control the DC motor im adapting onto the Rc Car as well as the steering servo. I want to plug the crystal into the Board of Education and use that to control my steering servo and DC motor. I'm unable to find anything as to how i would program this however.

The crystal looks like this
http://www.parallax.com/Store/Microcontrollers/AllMicrocontrollers/tabid/758/CategoryID/1/List/0/SortField/0/Level/a/ProductID/341/Default.aspx

The million dollar question i have is their any resources that someone could refer me to to help me solve this problem?

p.s im open to buying a different board if neccessary. Just looking for some help getting on the right track.

Comments

  • Martin_HMartin_H Posts: 4,051
    edited 2012-11-13 06:08
    I'm a little confused by your request, but I don't think plugging a crystal into a Board of education (BOE) which achieve much.

    Questions. Do you want to control the transmitter with the BOE or receive output from the receiver? Do you really want to just control the servos?

    Basically think of your RC system like a pipeline starting with the source of control signals, then flowing through the transmitter to the receiver, to the object being controlled. When in the pipeline do you want the BOE?

    RC servos can be controlled directly from the Basic Stamp 2 and no RC system is required to do that. You can also set up a BS2 to accept the RC receiver's control signals using pulsin command.
  • neverfinishedneverfinished Posts: 7
    edited 2012-11-13 10:52
    Thanks for the prompt response.
    Martin_H wrote: »
    I'm a little confused by your request, but I don't think plugging a crystal into a Board of education (BOE) will achieve much.

    Questions. Do you want to control the transmitter with the BOE or receive output from the receiver? Do you really want to just control the servos?
    My goal is to control the steering servo as well as the power to the DC motor with my HPI TX2 transmitter. I can use a potentiometer attached to a servo to control the DC motor for simplicitys sake and then i only have to control 2 servos.

    Basically think of your RC system like a pipeline starting with the source of control signals, then flowing through the transmitter to the receiver, to the object being controlled. When in the pipeline do you want the BOE?
    I would like my BOE to take the place of the reciever on the RC Car currently and control the servos based on incoming signals from the transmitter just like the reciever currently does.


    RC servos can be controlled directly from the Basic Stamp 2 and no RC system is required to do that. You can also set up a BS2 to accept the RC receiver's control signals using pulsin command.
    Currently i have my Boe bot being controlled by IR signals off of a tv remote using the pulsein command but i'd like to control this rc car with my HPI TX2 transmitter with the radio frequency 27.145mhz. Do i need to plug an antenna into the RC car to recieve the signals from my Transmitter?

    Also i notice that using the Pulsein command with the TV remote required using ''if'' ''Then'' commands alot which meant i was only able to achieve one forward,backwards,turn right and turn left command. But in the RC car i would like gradual control of the servos turning right slowly as i turn the wheel on my transmitter more and more and the same for the throttle. Would i just program endless if then commands so that it understands as i turn the wheel more and more or is there some kind of command i can use to achieve the gradual control of the servos.

    I hope that was more clear because i'd really like to get this project up and running.
  • neverfinishedneverfinished Posts: 7
    edited 2012-11-13 10:57
    This is the program im using right now to control the BOE bot with a tv remote which you probably all recognize :D
    ' IR Remote for the Boe-Bot - 2BitRemoteBoeBot.bs2
    ' Control your Boe-Bot with an IR remote set to control a SONY TV
    ' with the 1-4 or CH+/- and VOL+/- keys.
    '{$STAMP BS2}
    '{$PBASIC 2.5}
    time VAR Word(2) ' SONY TV remote variables.
    DEBUG "Press and hold a digit key (1-4) or CH+/- and VOL+/-..."
    FREQOUT 4, 2000, 3000 ' Start/reset indicator.
    DO
    DO
    PULSIN 9, 1, time(0)
    LOOP UNTIL time(0) > 1000
    PULSIN 9, 0, time(0)
    PULSIN 9, 0, time(1)

    IF (time(1) < 500) AND (time(0) < 500) THEN
    PULSOUT 13, 850 ' Forward
    PULSOUT 12, 650
    ELSEIF (time(1) < 500) AND (time(0) > 500) THEN
    PULSOUT 13, 650 ' Backward
    PULSOUT 12, 850
    ELSEIF (time(1) > 500) AND (time(0) < 500) THEN
    PULSOUT 13, 850 ' Right rotate
    PULSOUT 12, 850
    ELSEIF (time(1) > 500) AND (time(0) > 500) THEN
    PULSOUT 13, 650 ' Left rotate
    PULSOUT 12, 650
    ENDIF
    LOOP ' Repeat main loop.
  • Martin_HMartin_H Posts: 4,051
    edited 2012-11-13 11:27
    The bottom line is that the BOE is not a radio receiver and adding a radio crystal to it won't make it one either. It might be possible to keep the RC receiver and have the BS2 interpret its signals. Here's a link to a forum discussion to about that.

    http://forums.parallax.com/showthread.php?138259-How-to-interface-basic-stamp-with-servo-output-of-r-c-radio-reciever

    However, that doesn't do what you want which is remove the radio receiver and I'm not sure of the value of that.
  • neverfinishedneverfinished Posts: 7
    edited 2012-11-13 13:23
    Martin_H wrote: »
    The bottom line is that the BOE is not a radio receiver and adding a radio crystal to it won't make it one either. It might be possible to keep the RC receiver and have the BS2 interpret its signals. Here's a link to a forum discussion to about that.

    http://forums.parallax.com/showthread.php?138259-How-to-interface-basic-stamp-with-servo-output-of-r-c-radio-reciever

    However, that doesn't do what you want which is remove the radio receiver and I'm not sure of the value of that.

    Keeping the reciever on the car and wiring it into the BOE would serve my purposes as well. The code file available in that other link looks very promising. Now can i get a double ended servo motor plug and plug it into the servo motor ports from the reciever to the BOE or would i be better off getting a single ended servo motor plug and then connecting each wire of the 3 into the bread board on the BOE and then reading the information that way? What im thinking right now is once i can identify the values of the incoming signals from the RC reciever i program 4 if then commands going both ways for both rc servos as well as center commands for a total of 20 if then commands.

    If executed properly as i imagine it this should give me 4 increments in each direction for each servo motor. This wouldnt give me the smooth action i have right now directly controlling it with the R/C reciever but it would make it functionable.

    Does that sound feasible or is their a better way to do it?
  • Martin_HMartin_H Posts: 4,051
    edited 2012-11-13 16:20
    Yes it sounds feasible.

    But how do you plan to power the BOE?

    If you run a servo cable from the receiver to the BOE's servo header you'll connect the ground and signal, which is good. But the center wire is the power line which might conflict with the BOE's power or the receiver's power, depending upon the power setup. If you run the servo line to a breadboard, then you can connect only signal and ground and avoid the possibility of a power conflict.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-11-13 16:52
    If the two channels controlling the RC car are motor speed and front-wheel steering, you will need to convert those signals for the BOE-Bot's differential drive.

    -Phil
  • NWCCTVNWCCTV Posts: 3,629
    edited 2012-11-13 18:44
    Thanks for the prompt response.


    ?

    Also i notice that using the Pulsein command with the TV remote required using ''if'' ''Then'' commands alot which meant i was only able to achieve one forward,backwards,turn right and turn left command. But in the RC car i would like gradual control of the servos turning right slowly as i turn the wheel on my transmitter more and more and the same for the throttle.
    I hope that was more clear because i'd really like to get this project up and running.

    Do you mean pulsout? I was able to accomplish this with no problem. If there is no pulsout signal the servo will not move so I just use "IF" condition = 1 "THEN" pulsout Servo. If you used the example code provided in the documentation for the remote control then that needs to be modified as it is set specifically for full left and right turns and a specific distances for forward and reverse.
  • neverfinishedneverfinished Posts: 7
    edited 2012-11-13 23:26
    If the two channels controlling the RC car are motor speed and front-wheel steering, you will need to convert those signals for the BOE-Bot's differential drive.

    -Phil
    I figured that. I'm not quite sure how to do so yet. I was thinking by starting with an array measuring the charecteristics of each pulse sent from the transmitter fed through the reciever kind of like how i got started with the IR TV remote but that is programmed to sony which makes binary code by its very function so that may not apply for this application.

    I dont suppose you had something in mind :D?
    NWCCTV wrote: »
    Do you mean pulsout? I was able to accomplish this with no problem. If there is no pulsout signal the servo will not move so I just use "IF" condition = 1 "THEN" pulsout Servo. If you used the example code provided in the documentation for the remote control then that needs to be modified as it is set specifically for full left and right turns and a specific distances for forward and reverse.

    I was referring to the pulsout command in that text. My apologies for the mistake. So it sounds like you are saying that you found a way to gradually control the servos, but im not fully grasping what your saying. Could you post up an example of a code demonstrating what your saying. It sounds very promising!

    Really appreciating all the good input here.
  • neverfinishedneverfinished Posts: 7
    edited 2012-11-14 21:18
    possible Brainblast?

    I was browsing the web for ways to solve my problem and ended up looking at the parallax store. Correct me if im wrong but its been my experience that the Board of education im using right now is only capable of dealing with a single command at a time therefore it cant turn and go forward at the same time like an rc car can.

    Now if i was to upgrade to a Propellar board of education outfitted with one of these XBee 1mW Wire Antenna (802.15.4) - Series 1

    Since the Antenna runs off of 2.4ghz (a digital signal) i would most likely have to get a new transmitter, But then it would be able to accept multiple commands (left and forward at the same time). Still unsure of how i would get the smooth control i have right now though.

    EDIT: It seems all the information to do what i want to do is found here and i dont even need to get a propellar board, But i think im looking at the video game building kit pretty seriously which uses the propellar board. If it teaches you how to use C++ im definitley getting it since i've wanted to learn that code for along time now.
  • NWCCTVNWCCTV Posts: 3,629
    edited 2012-11-14 22:13
    :D?



    So it sounds like you are saying that you found a way to gradually control the servos, but im not fully grasping what your saying. Could you post up an example of a code demonstrating what your saying. It sounds very promising!

    Sorry, My bad. I used HIGH and LOW commands instead of the PULSOUT. That way when you press the right or left channel the servo will pulse only as long as the button is pressed.

    Edit: I will see if I can dig up the code and post it.
Sign In or Register to comment.