Shop OBEX P1 Docs P2 Docs Learn Events
S2 user ..... Forum Intro and S2 GUI question. — Parallax Forums

S2 user ..... Forum Intro and S2 GUI question.

SCFalconry27SCFalconry27 Posts: 9
edited 2013-07-19 09:00 in Robotics
Good morning,

A short intro: My son and I recently received our S2 and are having great fun. For several years he has expressed interest in learning more about robotics... but we have a gap between his understanding and mine....and I have never been accused of being a great teacher. It seems the S2 is bridging this gap very well. Quickly kindling a fire in him that he will only be able to quench with more knowledge. Needless to say.....I am ecstatic! Just wanted to stop right here and thank the forum members and Parallax for doing all you do.

For years my son has believed his father to be some sort of robotic creating savant (it simply isn't true). I have tinkered with a BS2 (w/PBasic) to build and choreograph a dancing monkey for a trade show booth. http://youtu.be/JmwxLQ9IlFU I also used the BS2 to build a lane judge for a pine car derby track for his cub scout troop. Other than these two instances... I normally use "C" and another uC... to program my projects. Although I have worked in the manufacturing automation industry for the past 15 years... I am currently an electron plumber..and pneumatic wizard for a custom panel shop.... not a programmer. So all my uC projects are simply hobby for me... and unfortunately come and go in spurts as time allows. With a previous employer I have built and maintained AGV's (automated guided vehicles) that delivered inventory/material around factories and hospitals. http://youtu.be/ZpEs46gdrb4

Well that is more than enough intro.... sorry!

Regarding the stall sensor:

Programming the S2 via the Scribbler Program Maker GUI. We've noticed that the stall sensor only works if the MOVE COMMAND does not have a duration assigned to it. For example.. the following portion of code would work.

stall.JPG


However the following does not work for us....
stall 2.JPG


Is this the norm?

Re: Line following
We are having difficulty getting the the S2 to follow black electric tape stretched on a nearly white floor. We've added white electric tape to either side of the black for added contrast... but still having numerous event of going off course. We have made the numerous code revisions to tighten up the resolution of the encoder movements vs opportunity for course correction... but the problem seems to be the S2's ability to see the vinyl black electric tape. Or should I say... the tapes ability to absorb the IR emitted by the S2. I think our vinyl electric tape is too shinny/reflective. Also recently noticed in a post by Duane that parallax sells black MASKING tape... that has a matte finish. Are other people having success with glossy electric tape? Or should I run to town and find a wide tip sharpe marker.... and commence to coloring a roll of masking tape?


Thanks,
Marty
243 x 468 - 41K
271 x 464 - 44K

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-07-18 07:51
    Hi Marty,

    Welcome to the forum!

    Regarding the stall sensor, you are correct that the sensor is ineffective during a defined-duration move. The reason is that the timed move command must complete before anything else executes, including your subsequent check of the stall sensor.

    As to the line following, use something besides black electrical tape, which is very shiny and reflects IR nearly as well as a white surface. Parallax carries a dull black masking tape that is ideal for this application:

    -Phil
  • Duane DegnDuane Degn Posts: 10,588
    edited 2013-07-18 08:51
    For years my son has believed his father to be some sort of robotic creating savant (it simply isn't true). I have tinkered with a BS2 (w/PBasic) to build and choreograph a dancing monkey for a trade show booth. http://youtu.be/JmwxLQ9IlFU
    I agree with your son, robot savant you are. Very cool robot monkey!
    I normally use "C" and another uC... to program my projects.

    If you're used to C then Spin shouldn't be a problem. IMO, Spin is like C without the semi-colons and brackets. Loops are done with "repeat" and use "=<" not "<=". There, now you should know how to use Spin (well almost). I was a heavy C user prior to starting with the Propeller. I thought the transition to Spin relatively painless. It does take awhile to get used the parallel processing the Propeller allows but this freedom to have true parallel processing is what really makes programming the Propeller fun.

    BTW, Phil is the one who wrote the Scribbler 2 GUI as well as the S2.spin object the generated code relies upon.
  • SCFalconry27SCFalconry27 Posts: 9
    edited 2013-07-18 09:34
    Hi Marty,

    Welcome to the forum!

    Regarding the stall sensor, you are correct that the sensor is ineffective during a defined-duratioon move. The reason is that the timed move command must complete before anything else executes, including your subsequent check of the stall sensor.

    As to the line following, use something besides black electrical tape, which is very shiny and reflects IR nearly as well as a white surface. Parallax carries a dull black masking tape that is ideal for this application:
    -Phil

    Phil thanks for the verification on the stall sensor... and on my thinking re: absorbed vs reflected I.R. light for the line following. I live about 30-40 minutes away from the city... so was trying not to make a trip into town to search for black masking tape... (that may or may not exist in town.) Also I am 3000 miles from Parallax... so UPS delivery takes a week. While I've got my son's attention... I want to continue stoking the fire... so I am investigating some work arounds. :)
    So far we've tried black cloth strips and elmers glue over white poster board.(glossy and matte side of poster)... also tried black construction paper. Neither improved things much. We've tried Sharpe pen on poster board. (narrow lines and upto 1.5" wide lines. Also printing the tracks from the ink jet onto printer paper. Write now I am digging through junk drawers and boxes trying to find sand paper... to matte the finish on the vinyl electric tape. :lol:

    Also finally dawned on me that the bearded dragons enclosure near where we are working has UVA, UVB bulbs that may be interfering.... unfortunately putting the lizard in the dark didn't help.

    I will order black masking tape from Parallax... but for now I'm just being impatient. It isn't often that I am not working 60+ hours a week... and playing hookey to play robots with my son is awesome.... just want us to get more accomplished. On the other hand he is getting one heck of a lesson on critical thinking and trouble shooting. LOL

    According to Duane... you are to thank for the Scribbler2 Program Maker GUI & S2 Spin. It is a wonderful resource for my son. He has enough initial interest to jump into this using the GUI with zeal. Gives him a chance to make things happen while learning about conditional statements, program loops and logical critical thinking etc... Once he is completely addicted I will dangle SPIN in from of him... and tell him it is a tool that may be to powerful for him. In years past I was making the mistake of trying to sit him down and explain H-bridges and transistors, diodes and covalent electron shells, conventional vs electron current flow etc... etc..... etc... apparently I can suck the fun outta anything.... Now that I realize my mistake... I think I'll just turn him loose and try to refrain from interrupting unless asked to assist. Thanks again for your part in creating this very appealing bait... he is all ready taking line... and shouldn't be long before I can set the hook!


    Marty - K4MLW
  • SCFalconry27SCFalconry27 Posts: 9
    edited 2013-07-18 09:56
    Duane Degn wrote: »
    I agree with your son, robot savant you are. Very cool robot monkey! .

    <blush> I wish it were true... A savant I am not! I struggle with "C'. 25 years ago in high school I used to write in basic,basic a, gw basic, visual basic, pascal, fortran, cobol, and C. But I was not proficient in any of them. My career path has had me turning screw drivers for the past 20 years. The limited amount of time I have to devote to relearning "C"and using it for uC's..... has me constantly making bit manipulation errors... and navigating the Atmel spec sheets doesn't make things easier for me either. I am very much a neophyte C programmer. The BS2 and P-Basic just made me look good...and I got very lucky with the Dancing Monkey. It was also the limited memory on that BS2 that had me looking for a different uC to use for future projects. So I invested about $500+ into AVR programmers (STK500 ,dragon, buttterfly) and various AVR uCs and decided to relearn "C". Unfortunately time is a resource I didn't have as much control over.... so for the past few years I chip away at it as I can find the time.... I may have bitten off more than I can actually chew with AVR.... I'm thinking that Spin may be a better place for me.

    Thanks again,
    Marty K4MLW
  • SCFalconry27SCFalconry27 Posts: 9
    edited 2013-07-18 10:47
    Lightly sanding the electric tape to a matte finish works..... Matte finish electric tape laid over gloss side of poster board.

    [video=youtube_share;AI6ncusyAAY]

    Marty K4MLW
  • WhitWhit Posts: 4,191
    edited 2013-07-18 12:26
    Nice work Marty! Have you tried printing your tracks - some printers make good non-shiney lines. There is a neat pdf on the S2 page.
  • SCFalconry27SCFalconry27 Posts: 9
    edited 2013-07-18 15:27
    Whit wrote: »
    Nice work Marty! Have you tried printing your tracks - some printers make good non-shiney lines. There is a neat pdf on the S2 page.

    Yep... both my printers make tracks that are to glossy. The sanded matte finish on the vinyl electric tape is working for now. My son and I .. are leaving for summer camp with his Boy Scout Troop this Saturday. We will be gone a week. We should have a package of several rolls of black matte finish MASKING tape delivered to the house by the time we get home. For today and tomorrow... we're getting it done with sanding the vinyl. :)

    Thanks again,
    Marty
    aka..K4MLW, aka Mr. Hawkins to the scouts, or "Matts' Dad!" LOL
  • WhitWhit Posts: 4,191
    edited 2013-07-18 17:26
    Hey Marty,

    One last trick till your tape arrives. Sometime you can photo copy the printed pdf track sheets and the photocopy will be much more flat an less shiney. With the original Scribbler (Blue) this also worked. Believe it or not, it was even more sensitive than the S2 to this issue.

    When you and your son are ready, attached is a start I made on using the feature on the GUI that lets you toggle into the Spin Tool to use both along with the S2 help to begin to learn Spin. S2GUItoSpinLesson1.v.3.1.pdf

    Enjoy!
  • SCFalconry27SCFalconry27 Posts: 9
    edited 2013-07-19 06:07
    Whit wrote: »
    When you and your son are ready, attached is a start I made on using the feature on the GUI that lets you toggle into the Spin Tool to use both along with the S2 help to begin to learn Spin. S2GUItoSpinLesson1.v.3.1.pdf

    Enjoy!

    Whit,

    Thank you....Lesson 1 is excellent! I don't mean to sound greedy... but are there more lessons? I searched the forums and came up empty searching for lesson 2.

    Marty - K4MLW
  • WhitWhit Posts: 4,191
    edited 2013-07-19 08:06
    There is a lesson 2 - that needs proofing (about program loops). I got busy with some other project and slowed down... Maybe I can dig it up and get it square.

    They kind of prove the concept of how you can program in the GUI and see it then in Spin - Using the reference materials you can then expand your knowledge and try new things.

    It is really the genius of the Scribbler (for BASIC) and the S2 for Spin. Masterful work by Phil Pilgrim, Ben Wirz and the Parallax S2 team. I wrote a review of the S2 for Robot Magazine when it was introduced. You can find a copy here -http://www.botmag.com/index.php/parallaxs-red-hot-scribbler-2-robot
  • SCFalconry27SCFalconry27 Posts: 9
    edited 2013-07-19 09:00
    Ok...That makes me feel better... thought I was being completely daft with my searches. No lesson 2 for the moment... but you are absolutely correct that being able to copare the GUI code vs Spin code....will be invaluable in learning Spin.

    Thanks again,
    Marty
Sign In or Register to comment.