Shop OBEX P1 Docs P2 Docs Learn Events
A little twisted and a couple of pulse off — Parallax Forums

A little twisted and a couple of pulse off

Joe-BotJoe-Bot Posts: 24
edited 2013-02-02 16:49 in General Discussion
So I’m building the Boe-Bot with the Basic Stamp 2 and have a couple of issues to work out.
But first a little about me.
One day I was talking to my daughter, who works over at the university, about a career change, maybe robotics, more like programing in manufacturing, but there really Isn’t any night classes around here. I don’t have a lot of experience in electronics, but have always been interested and have picked at it from different angles. So for Christmas see got me the Boe-Bot Robot kit with the basic stamp 2 . Wow what a awesome little learn kit. I am really liking it.

Here’s my first issue. I think I’ve figured it out, but I’ll lay it out for your welcomed feedback. Hope I can lay it out clearly.
So Chapter 4 Activity #3 Calculating distances.
I did the One Second measurement and came up with 7.3 in/s then divided it into 20in = 2.73 x 40.65 and came up with a pulse = 111.
So 111 pulse at full speed should take Boe-Bot 20 inches right, wrong it only went 19". More then a couple of pules off. So I re-checked everything and checked it again, same results. It actually took 118 pulse.
Working backwards, 118 divided by 40.65 = 2.90 So I shaved the time down in the one second test to make it work. Shave it from 41 down to 38 which worked. Thinking about it, I knew 41 must be a good number. So examining the other part of the formula 40.65, braking that down, I’m thinking that its probably in my code overhead. I’m going to make the adjustment their and see how that works. Hopefully that should work with all the speed ranges.

Second issue
After programing the Boe-Bot I set it down to run the program, on the Board of Education I switch the power from 1 to 2 and it makes an instant twist to the left. This one I can deal with, but It also dose it at the end of most programs. I really noticed it at the end of the
Forward for ten seconds program. At the end, the left wheel stops and the right go just a little bit more. It also dose this when I put a pause in the program. So if I run it forward then pause it for a half a second then backwards, it returns a little to the right.
Is this fairly normal? I hope to deal with in the next activity , ramping.

Feeling a little twisted and a couple of pulse off.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2013-01-30 19:06
    Issue #1: You're talking about a less than 10% error. Remember that wheels can slip on the floor, batteries are not always fresh, voltages through voltage regulators have their own (small) errors, and there are small differences from one servo motor to another ... these are not precision devices.

    Issue #2: When a standard servo motor is turned on, it twitches as the internal circuitry initializes itself. When control pulses are first applied, the program will put out a pulse that specifies a desired initial position for the serve. Sometimes the actual position of the servo is very different and the servo will move at high speed to the desired position. The BoeBot's wheel servos are continuous motion servos where some of the feedback mechanism has been disabled so the control pulse width specifies the speed and direction of the motor rather than the wheel position.

    At the end of your programs, put a DO : LOOP so the Stamp program doesn't stop. If you put a STOP or END, the Stamp will go into low power mode which allows the I/O pins to all become inputs and that may cause a noise pulse to be seen by the servos and cause a twitch.
  • NWCCTVNWCCTV Posts: 3,629
    edited 2013-01-30 19:20
    Welcome to the forums. This is a great place to get help with your projects. Enjoy that shinynew Boe-Bot. There are a ton of things it is capable of!
  • Joe-BotJoe-Bot Posts: 24
    edited 2013-01-30 20:41
    Thanks for the info and I'm sure I'll have a lot of fun with it, if I don't drive my dog crazy.
  • Joe-BotJoe-Bot Posts: 24
    edited 2013-01-30 20:49
    Ok I took the end off the program and it is better, Thanks again
  • ercoerco Posts: 20,259
    edited 2013-01-30 22:14
    If your program simply stops sending "forward" pulses when you want to stop, your servos are left to fend for themselves and will shut down whenever they feel like it. That's another variable which may differ between servos, causing your final twist. If instead you send a long (or endless) stream of PULSOUT 750s, which is the zero speed command, that actually puts on the brakes. Try either of these at the end of your program and report back:

    DO
    PULSOUT 12,750
    PULSOUT 13,750
    PAUSE 20
    LOOP 'continuous output of stop pulses

    FOR B1=0 TO 50
    PULSOUT 12,750
    PULSOUT 13,750
    PAUSE 20
    NEXT '~1 second output of stop pulses

    Per Mike, you can further try STOP, or END, or DO:LOOP after that last one to see what effects they have.
  • Joe-BotJoe-Bot Posts: 24
    edited 2013-01-31 20:06
    That worked great, I put one in between forward and backward and one on the end.
    I think I got a little ahead of my self, I read a little future and there in an information box, pretty much confirming what mike had said.
    Then the next activity, activity #4 is about ramping, well now I have smooth take offs, no more burnout marks on my hardwood floor, and then it comes to a nice stop.

    I really got thank you guys for coming up with these kit, The way its laid out, it’s very easy to follow, with room for experiments, and laughs, and just when my mind is thinking about the next step, the book deals with it. It’s nice to be learning again.
    I’ve tried a couple of different classes but I just couldn’t get my brain around um. I am definitely a hands on guy. I’ve taken low voltage lighting apart and replaced burnt capacitors, but they looked overheated. I wouldn’t know how to test them, and finding their replacment wasn’t easy.
    Anyway thanks for the info and I’m sure I’ll be back with more question
  • ercoerco Posts: 20,259
    edited 2013-01-31 22:11
    Welcome aboard, Joe-Bot!
  • GadgetmanGadgetman Posts: 2,436
    edited 2013-02-01 00:54
    Joe-Bot wrote: »
    Thanks for the info and I'm sure I'll have a lot of fun with it, if I don't drive my dog crazy.

    Eh... I thought this was what the Boe-bot was designed to do?

    ;-)
  • Joe-BotJoe-Bot Posts: 24
    edited 2013-02-01 09:14
    Yeah you’re right. I guess I’m just impressed with how good it really dose work , even catches my spelling mistakes
  • Joe-BotJoe-Bot Posts: 24
    edited 2013-02-01 09:17
    erco your Avatar reminds me of an old Si-Fi move, It was a planet with all these Babes, but it was in black and white. Or was it that other one, I think the robots name was Toebart.
  • ercoerco Posts: 20,259
    edited 2013-02-01 23:41
    Joe-Bot wrote: »
    erco your Avatar reminds me of an old Si-Fi move, It was a planet with all these Babes, but it was in black and white. Or was it that other one, I think the robots name was Toebart.

    http://en.wikipedia.org/wiki/Forbidden_Planet
  • Joe-BotJoe-Bot Posts: 24
    edited 2013-02-02 16:49
    Robby the Robot with personality and Anne Francis. I'm ganna have to call you Robby from here on out.
Sign In or Register to comment.