Shop OBEX P1 Docs P2 Docs Learn Events
need advice on project - Page 2 — Parallax Forums

need advice on project

2»

Comments

  • Jessica UelmenJessica Uelmen Posts: 490
    edited 2009-03-09 16:03
    Hi Roman,

    A small pause (i.e. PAUSE 10) should be sufficient on your transmitting end. This prevents any lost data in case the transmitter is sending data too fast for the receiver to receive it.

    Hope this helps!

    Jessica

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jessica Uelmen
    Education Department
    Parallax, Inc.
  • roadrunner3groadrunner3g Posts: 36
    edited 2009-03-12 00:36
    the mAh is basicly your gas tank. the more thr better.
    as far as using your 4ch radio it will work fine. you said it is 75mhz, I don't think it is. I think you have the 72mhz band. just make sure TX and RX are on the same freqincy. as far as controling your bot you only need 2 CH to drive it, and if you want to switch between RC and atonimoss control you only need to add one more CH. I have a 6-CH radio and have used it on many of my critters (bots). I haven't used more than 3 CH with the BS2 chip, I have used 2 of the extra CH. for a pan and tilt camera setup. to connect the RX, it's one pin per CH. to program it, use the pulsin command to read each CH of the RX.
  • roman froman f Posts: 21
    edited 2009-03-17 15:12
    We are nearing completion, almost ready for final assembly. ive got one leg fully assembled and have been playing around with the servo contoller. i notice the servo controller program allows sequences to be created and saved. is it possible to make a bunch of sequences, upload them into the stamp and then execute the appropriate ones when given the appropriate input? for example i would make a sequence of the robot taking a step forward, another sequence taking a step back, and one sequence each for taking a step right and left. there are four directional buttons on the console, pressing forward would make the robot execute the step forward sequence over and over for as long as the button is pressed, and so on for the other movements.
  • Jessica UelmenJessica Uelmen Posts: 490
    edited 2009-03-17 20:31
    Hi roman,

    You can use subroutines to accomplish this task.· For example, in your main code, you can nest a bunch of·IF...THEN·statements that look something like this:

    IF ForwardButtonPressed THEN
    · GOSUB MySubroutine
    IF BackwardButtonPressed THEN
    ··GOSUB MyOtherSubroutine
    ...etc

    For·more information on subroutines and how to call them, see the BASIC Stamp Syntax and Reference Manual, page 209.

    Happy Developing!

    Jessica

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jessica Uelmen
    Education Department
    Parallax, Inc.
  • roman froman f Posts: 21
    edited 2009-03-21 06:45
    the code that drives the servo controller needs a word-sized varible to control the pulse width for each servo. i have 16 servos, thus i would need 16 word-sized variables to control them all, but the bs2 seems to be have enough space to store only 12 word sized variables, i get an error if try to create more. i was thinking, since only 12 of the servos are needed to control the legs, and the other 4 are for the wheels, it would be sufficient to just have the 4 wheel motors to run at full speed forward or backward to control the robot, and thus use less variable space... i guess i could always hack apart the motors and use some relays.

    any help?

    Post Edited (roman f) : 3/21/2009 6:50:18 AM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2009-03-21 15:55
    You could also use byte-sized variables for the servo pulse widths and multiply them by a constant as you send them out to the servo controller. You can also have the servo controller send the current pulse width for a given servo back to the Stamp and not save it at all in the Stamp. See page 6 of the servo controller documentation.
  • roman froman f Posts: 21
    edited 2009-03-22 02:47
    i must be looking in the wrong place. the PSC didnt come with any documentation, and i've already read the manuals for both serial and usb versions (the ones linked to from the product pages) and there is no mention of of being able to use a byte sized variable multiplied by constant, or just giving it the pulse value. it only shows the code for using the word sized variable to control pulse width:
    sample code from the manual said...
    SEROUT Sdat, Baud+$8000,[noparse][[/noparse]"!SC", ch, ra, pw.LOWBYTE, pw.HIGHBYTE, CR]


    i was playing around with this code earlier and had no problems replacing the "ch" and "ra" with a value for the channel # and ramp rate that i wanted, but nothing happened when i put a value in place of "pw.LOWBYTE, pw.HIGHBYTE". Before that i tried using a byte-size variable multiplied by ten, placed inside brackets where the highbyte/ lowbyte stuff was, also didn't work. i'm most likely not using the right syntax, garbage in garbage out, as they say.

    Post Edited (roman f) : 3/22/2009 2:52:28 AM GMT
  • roman froman f Posts: 21
    edited 2009-03-24 04:16
    does any one have a link to the servo controller documentation handy?
  • Mike GreenMike Green Posts: 23,101
    edited 2009-03-24 04:40
    The PSC documentation doesn't mention using a variable multiplied by a constant because that's a feature of PBasic, not the PSC. The SEROUT statement, like any output statement, allows an expression to be used pretty much anywhere a simple variable can be used. You can't do that in the case of "pw" when it's followed by ".LOWBYTE" because that's not a simple variable. You can use shift and logical and operators to do the same sort of thing:

    "pw.LOWBYTE" is roughly equivalent to using "pw & $FF" and either will work in the SEROUT statement or anywhere an expression is expected.

    "pw.HIGHBYTE" is roughly equivalent to using "pw >> 8" and either will work in the SEROUT statement or anywhere an expression is expected.

    The PSC documentation is provided with a link on the product page. Search the webstore for the Parallax Servo Controller.
  • roman froman f Posts: 21
    edited 2009-03-28 04:45
    Mike Green said...
    The PSC documentation doesn't mention using a variable multiplied by a constant because that's a feature of PBasic, not the PSC. The SEROUT statement, like any output statement, allows an expression to be used pretty much anywhere a simple variable can be used. You can't do that in the case of "pw" when it's followed by ".LOWBYTE" because that's not a simple variable. You can use shift and logical and operators to do the same sort of thing:

    "pw.LOWBYTE" is roughly equivalent to using "pw & $FF" and either will work in the SEROUT statement or anywhere an expression is expected.

    "pw.HIGHBYTE" is roughly equivalent to using "pw >> 8" and either will work in the SEROUT statement or anywhere an expression is expected.

    The PSC documentation is provided with a link on the product page. Search the webstore for the Parallax Servo Controller.

    im still not quite sure whats going on here, what happens if i use "pw & $FF" and "pw >> 8" instead of "pw.LOWBYTE" and "pw.highbyte"? does "pw" still have to be a wordsized variable or is it a smaller sized variable multiplied by a constant value "8"?

    how would i write a code that would command a servo to go to a certain pulse width by giving it the value directly rather than using a variable?
  • Mike GreenMike Green Posts: 23,101
    edited 2009-03-28 05:00
    If you want a pulse width of 1500us, you'd say: SEROUT Sdat, Baud+$8000,[noparse][[/noparse]"!SC", ch, ra, 1500 & $FF, 1500 >> 8, CR]
    If "ch" is a constant, you'd put that number there instead of the "ch". The same is true for "ra". You can use any PBasic expression in the SEROUT statement. You can use a byte variable called "foo" multiplied by a constant "8" instead of the "1500" written above. You'd need to put the expression twice, once for the low order byte and again for the high order byte. Look at the examples in the PBasic manual. Look at some examples in other posted code, like in the various Parallax tutorials.
  • roman froman f Posts: 21
    edited 2009-03-29 22:42
    thank you, that makes a lot more sense now.
  • roman froman f Posts: 21
    edited 2009-04-02 00:37
    big problem, for no apparent reason the receiver module burned out. i tested it many times before, and it worked with no problems, i had it connected the same way every time, and then it just happened... it looks like only one of the little black things on the ic burned out, the rest of the board seems fine. is it possible to replace that component, or take out the main chip and antenna and make a new circuit for it (where to find schematic?); or can i just forget about having wireless control? even if we order a new receiver its not going to arrive in time for the project deadline.

    does anyone know of any places in toronto that sell this component?

    btw isn't it possible to send data from one bs2 to another using a single pin on each board and the SERIN/SEROUT commands, through a wired connection?

    i guess i should consider myself lucky that it wasnt the psc or one of the stamps that burned out.

    Post Edited (roman f) : 4/2/2009 12:45:45 AM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2009-04-02 02:47
    Can't tell you what to do with the module since there are lots of little black things that can go POP. If you can post a picture showing the damaged device clearly, maybe someone can tell what it is. It's rare for things to just burn out for no reason and it may not make sense to try to repair the module without first figuring out why it burned out.

    There are examples in the Stamp Manual for connecting one Stamp to another for wired serial I/O. Look in the chapters on the SERIN and SEROUT statements. There's also a pair of Nuts and Volts Columns that talks about networking several Stamps over a wired connection. Try columns #55 and #56 (www.parallax.com/Resources/NutsVoltsColumns/NutsVoltsVolume2/tabid/446/Default.aspx).

    Most important is to make sure the two Stamps have a common ground connection. There's only a single data connection on each board, but you need the common ground for the other side of the connection.
  • roman froman f Posts: 21
    edited 2009-04-03 06:28
    thanks for the tip mike

    i found a useful looking circuit in the basic stamp manual. it uses a single pin from each stamp. there appear to be two variations: open source and open drain, both very similar,except one has the pin from each stamp connected to vss and the other to vdd. also they show the method that uses two pins from each stamp. which to use? all i need is to send some variables over from the bs2 in the console to the bs2 in the robot, nothing fancy.
Sign In or Register to comment.