Shop OBEX P1 Docs P2 Docs Learn Events
Boe-Bot - open loop program stops? — Parallax Forums

Boe-Bot - open loop program stops?

mclairemclaire Posts: 13
edited 2005-04-05 15:40 in Robotics
Rank beginner here, just built the Bot. In testing the servos, I enter the first few lines of code to spin the servos, and they stop after a couple rotations. The servos provided in the kit indictated that they were the "modified" servos, so why would they stop?


Mike

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-03-24 02:16
    Mike,

    ··· Please post the exact code you're using so we can see what it's doing.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Tech Support
    csavage@parallax.com
  • mclairemclaire Posts: 13
    edited 2005-03-24 02:28
    Sure, simple as it gets:




    ' {$STAMP BS2}

    LOW 12
    LOW 13

    loop:

    PULSOUT 12, 500
    PAUSE 20

    GOTO loop



    This code turns the servo 180 degrees. So it seems like maybe it's not "modified" after all? This kit was purchased in 2001, never used until now. But the markings on the servo definately indicated it had been modified.


    Thanks
    Mike
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-03-24 02:34
    ·· What happens if you change the 500 to a 750?· Oh, and as a side-note, since LOOP is a keyword in PBASIC 2.5, you should probably use a different label.· Oh, and before I forget, you can tell if the servo has been modified by gently turning it by hand, and see if it feels like it hits a stopper at the same point in both directions.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Tech Support
    csavage@parallax.com
  • mclairemclaire Posts: 13
    edited 2005-03-24 02:51
    If I change 500 to 750 it stays still, just like I think it's supposed to. You can here a slight noise as it receives the pulses, but no discernable movement. I changed the label name to "spin". No difference.

    I can turn the servos all the way around, no mechanical stops.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-03-24 02:54
    ·· Okay, and one more test, change the 750 to 1000 and tell me what happens.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Tech Support
    csavage@parallax.com
  • mclairemclaire Posts: 13
    edited 2005-03-24 03:01
    It turns 180 degrees in the opposite direction of where it went when it was set to 500. It seems to me this is all how it's supposed to work, except for some reason it stops. It's completely repeatable. It did this last night, and I didn't save the code, I retyped it. I also updated the Basic Stamp Editor from I think 1.5 to 2.1. Nothing changes. So the problem must be on the Bot somewhere.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-03-24 03:03
    But you can contiuously rotate the servo by hand?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Tech Support
    csavage@parallax.com
  • mclairemclaire Posts: 13
    edited 2005-03-24 03:06
    Yes. Absolutely. Sounds like I have you stumped. Just my luck.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-03-24 03:09
    Just out of curiousity, why 4 years to try it?



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Tech Support
    csavage@parallax.com
  • mclairemclaire Posts: 13
    edited 2005-03-24 03:10
    By the way, both servos behave exactly the same way. So it seems like the servos are just doing what they are told. I don't see how it could be a problem with the servos.
  • mclairemclaire Posts: 13
    edited 2005-03-24 03:15
    On the question "why 4 years". I bought it from a friend who bought it thinking it would be good for his kid. But he never opened it and I took it off his hands. It's a virgin set, it was never opened. Completely sealed.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-03-24 03:17
    ·· If the servos can be continuously turned by hand, then they should be continuous rotation servos, and if that's the case, then they're not doing what they should be.·· A PULSOUT of 750 should keep the servo still.· That works.· But 500 should have the servo turning continuously in one direction, while 1000 should have it turning continuously the other.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Tech Support
    csavage@parallax.com
  • mclairemclaire Posts: 13
    edited 2005-03-24 03:28
    No question about that, all I meant was that maybe the servos are just doing what they're being told. In other words, maybe I/O pin 12 stops sending the pulses. If I had a way to see what was going on at the I/O port that would help. Do you think I can use an LED in the breadboard to watch the pulses? How would I do it?
  • mclairemclaire Posts: 13
    edited 2005-03-24 03:51
    Well, I just took an LED out of the kit and put it between pin 12 and Vss on the X1 header. Sure enough, it pulses for about 1/2 second as the servo turns, and then stops. So it seems like the Basic Stamp is not putting the pulse out continuously. I have no idea why of course.

    Any ideas?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-03-24 04:02
    ·· Well, that's not a good test to do, simply because there is another condition which can cause that to happen, which is the servos turning causing the stamp to brownout.· Usually this will cause it to restart.· BUt what you should do is try the LED without the servo connected.· Also try using another port/pin.

    ·· Also, does that servo have a couple of check-boxes that say STD and/or PM that might be checked?· If so, which one is checked?

    ·· One last thing, I wanted to be clear that when you rotate the servo by hand, it can be turned 360+ degrees, and that it doesn't hit a stop at any point while turning it in one direction.· That is, you should be able to spin it a full 2 turns in one direction, for example.

    ·· If you're still having problems, feel free to call tech support tomorrow between 7A-5P PST.· Have the servo and BOE-Bot ready when you call.· 1-888-997-8267


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Tech Support
    csavage@parallax.com

    Post Edited (Chris Savage (Parallax)) : 3/24/2005 4:09:50 AM GMT
  • mclairemclaire Posts: 13
    edited 2005-03-24 04:07
    Well, check this out - it's working now. I figured the problem HAD to be the Basic code, so I decided to put a debug statement in there to see if it ever stopped looping. So the last statement was simply Debug "Done". As soon as I did that the thing started working. Can you explain that? If I take the Debug statement out, it goes back to the way it was.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-03-24 04:11
    · The Stamp Editor releases the COM port when it's finished sending data to the Stamp.· On some computers the COM port is·active right after the tranfer is complete.· That is to say it "times out" and the computer activates the DTR line goes high holding the Stamp in RESET mode.· Putting a DEBUG statement in there forces the port to stay open.· This is an issue only on certain computers.· What do you have?· This is common on Dell & Gateway laptops, according to the senior Technician here.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Tech Support
    csavage@parallax.com

    Post Edited (Chris Savage (Parallax)) : 3/24/2005 3:18:52 PM GMT
  • mclairemclaire Posts: 13
    edited 2005-03-24 15:46
    Yes, indeed. It is a Dell laptop. And I am using the 9-pin serial version, as opposed to USB. You mentioned DTR, I don't know if USB uses that or if it's just s/w handshaking.

    What is the recommended way of dealing with this?
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-03-24 16:30
    The recommended way is just what you have done -- put a debug statement somewhere in your program.

    Oh, and the DTR signal is used by the IDE to reset the BS2 just before it re-programs it.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-03-24 16:33
    mclaire,

    ·· The other option is to unplug the programming cable each time.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Tech Support
    csavage@parallax.com
  • RickBRickB Posts: 395
    edited 2005-03-25 07:23
    In some past posts there were references to a capacitor in series with pin 4 of the serial conn. and the attention line on the bs2 to prevent this problem. My recent boe board has that capacitor plus another one from pin 3 on the bs2 to ground. Your 4 year old board probably does not have that mod. Compare the schematic of your boe with the current one at www.parallax.com/dl/docs/prod/boards/BOERevC.pdf.

    Rick
  • Ben DamonBen Damon Posts: 42
    edited 2005-04-04 20:05
    there is no PAUSE in his code, i remember once i have a program run funny becuase there was no pause between pulses

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Ben Damon

    And may God Bless America!
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-04-05 15:40
    Ben,

    ·· Actually the original posted code does have a PAUSE statement in it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
Sign In or Register to comment.