Shop OBEX P1 Docs P2 Docs Learn Events
S2 Unable To Execute List of Commands Accurately (Perhaps user error) — Parallax Forums

S2 Unable To Execute List of Commands Accurately (Perhaps user error)

Hewittmd97Hewittmd97 Posts: 15
edited 2016-10-26 04:15 in Propeller 1
I'm having my S2 draw the outline of a car and it does fine up until about 3/4 of the way through the function. Then an angle is deviated from and everything else just snowballs.
I have tried multiple times to tinker with my code and it still doesn't work. I think that either there is an angle within the outline too small for the S2 to navigate or the length of the memory pertaining to where the S2 thinks it is located on the graph is short or not up to what it should be although that does not seem to be the case.
Computer specs:
Windows 10 Pro
Propellor stand alone suite
32gbs of RAM
i5-4690k processor
(sorry if this info is irrelevant. I'm more accustomed to computer related forums.)
S2 specs:
stock specs with fresh batteries.
1920 x 976 - 88K
1920 x 975 - 170K
1920 x 972 - 169K
1920 x 969 - 169K
295 x 904 - 24K
244 x 812 - 22K
3887 x 726 - 509K
«1

Comments

  • Should I try shifting the coordinates down in the lower portion of the program so that the outcome will be as I desire?
  • ElectrodudeElectrodude Posts: 1,657
    edited 2016-10-26 19:38
    I don't have a Scribbler, but I can't imagine that anyone will be willing to type over your code from your screenshots in order to test it themselves to try and find the problem. Someone might be more willing to help you if you upload your Spin file as an attachment instead of just uploading screenshots of it.
  • I don't have a Scribbler, but I can't imagine that anyone will be willing to type over your code from your screenshots in order to test it themselves to try and find the problem. Someone might be more willing to help you if you upload your Spin file as an attachment instead of just uploading screenshots of it.

    I agree. Could you archive the file to a zip to post it so others can try.

    File>Archive>Project.

  • Hewittmd97Hewittmd97 Posts: 15
    edited 2016-10-26 20:34
    Ignore this comment.
  • Yes! I'm sorry for my ignorance.
    I spoke to my professor and she said that the drawing from the image shown in the original post would be acceptable because one can obviously tell that it is supposed to be a car. It isn't good enough for me though. I have already invested too much time and effort into this to just settle for the lack-luster results. I want to wow the people. The assignment is to make the S2 draw something with creativity. While we were assigned to groups, I did this entirely on my own. (I know. Shame on me. I need to learn to work as a team.) Other groups are planning on doing a basic Transformers emblem design. In my opinion (which I realize is biased. Haha) the outline of a car would be way more astounding. I have talked to my team members and only 1 of them really cares about the assignment. He was talking about changing the angle of the robot further on down in the code so that it is correct after that. I thought about that, but that would only work if I told the robot to move forward for a set amount of time and told it exactly what angle to turn at. Simply programming in a slight variation of the robots current orientation wouldn't work either, because then the robot would just continue onto where it believes the next coordinate is. Unless I were to program in an 'end_path' , alter the degrees, and then begin another 'begin_path' at some point. My team member also mentioned shifting the points down for the detailing to the door and the front tire and front bumper. I believe that would be a lot of trial and error though. Let me know what you think about the different approaches or if you have some other alternative that will be simpler.

    P.S. Our drawings will be graded by outside sources and the group with the best drawing is awarded extra points or something along those lines.
    P.P.S. Once the robot begins drawing, no one is allowed to touch or adjust the robot, except to remove the pen so that it may move to a new location and at that point the pen would be reinserted.
    Also, I am not familiar with what method I should be calling on to make the S2 pause so that the pen may be taken out or inserted.
  • One problem you have is you have zero free longs. The Propeller needs a couple hundred free longs to manipulate the stack.

    You could remove part of your diagram or remove unused methods of the S2 object. I think there are Spin compilers which will remove unused methods. This should save some RAM. You could also try removing unused methods manually.

    You can check to see how much free space you have by pressing F8. Try to get the free space over 200 longs (though it might work with about 100 free longs).
  • I should add there are other ways of dealing with memory issues. You could save your plot to EEPROM but this isn't a trivial task (if you don't already know how to do it).
  • Duane,

    Are you sure about the memory. I'm showing over 5,000 long available.
    640 x 458 - 332K
  • Publison wrote: »
    Duane,
    Are you sure about the memory. I'm showing over 5,000 long available.

    You're right!

    I blame the anesthesia from having an tooth extraction and implant placed yesterday.

    Thanks for catching that.

  • Duane Degn wrote: »
    Publison wrote: »
    Duane,
    Are you sure about the memory. I'm showing over 5,000 long available.

    You're right!

    I blame the anesthesia from having an tooth extraction and implant placed yesterday.

    Thanks for catching that.

    Tooth pain has to be the worst pain in the world. I have had mine over the years.

    I don't have enough rechargeable batteries or a big enough piece of paper to replicate at this time.

    Working on it in the next day or two.




  • Got a chance to run this. I had to break out a brand new, unopened S2 that I was saving. :)
    The program seems to run through to the end.

    The two runs may differ because I have 2" tape on the 11" x 17" papers. That may have cause slippage.

    It looks pretty close to your originals.

    Where you you running the tests on a tile floor? (Looks like it). That would produce some slippage.

    Sharpies on tile floors? Not a good thing. Acetone should clean it up.

  • It was a dry erase. Haha. It came off with a little cleaner. So I should get a poster board and attempt to run the program again?
  • Forgot the photo.
    640 x 480 - 175K
  • I wanted it to look more like the first screen shot I posted. The current outcome looks like a drunk person did it. Haha.
  • Since the program seems to run repeatedly, I would suggest the vectors were miscalculated.
  • Hewittmd97 wrote: »
    It was a dry erase. Haha. It came off with a little cleaner. So I should get a poster board and attempt to run the program again?

    I have used Sharpies where I should not have. Messy cleanup. :)

  • Hewittmd97Hewittmd97 Posts: 15
    edited 2016-10-27 18:39
    My coordinates were miscalculated? I plugged all my coordinates into desmos and it gave the exact image I traced. Perhaps splitting the 1 path into multiple paths could work?
  • And also, what's the difference between running on RAM and EEPROM? I just ran on the EEPROM.
  • Hewittmd97Hewittmd97 Posts: 15
    edited 2016-10-27 19:04
    I looked it up. Nevermind. I also ran the program with the wheel speed set to 1 so that the force applied would not exceed static friction. The results were still the same.
  • Publison wrote: »
    Forgot the photo.

    Nicely done Publison!

    I think that's close to what one can expect with a S2. It's not really a precision plotting printer.

    It might be possible to improve the output if one used a single sheet of paper on a very flat smooth surface.

    I'd suggest simplifying the design a bit. Each turn is going to result in a small error and lots of turns will cause these small errors to add up to a large error.

  • Okay. The problem seems to begin with the details on the door so I'll look into drastically simplifying that area.
  • PublisonPublison Posts: 12,366
    edited 2016-10-27 23:00
    And there is a problem with a nose vector being off. (Lifted up).
  • Yes. I'll see what simplifying does to it.
  • Let me start off by telling you how much I now dislike Parallax for making garbage and selling it for $180. I'm pretty sure I can buy a Lego robotics kit and have it do 10x better of a job. That being said, I DID IT! (After 14 attempts)
  • Hewittmd97 wrote: »
    Let me start off by telling you how much I now dislike Parallax for making garbage and selling it for $180. I'm pretty sure I can buy a Lego robotics kit and have it do 10x better of a job. That being said, I DID IT! (After 14 attempts)

    It's pretty clear you're new to robotics.

    I used Lego robotics stuff before purchasing anything from Parallax (I have a huge Lego collection). I think you're inexperience and frustrations are causing you to make claims which are not true. You could possibly make a Lego plotting device which used rails and rack and pinion tracks to produce a drawing 10 times better but you'd be hard pressed to get a Lego car capable of matching the S2's output.

    There are well known limits to odometry type robotic navigation. As I mentioned previously, there's a small error with each turn (and even while driving straight) associated with wheels slipping on the ground the finite resolution of the encoders. Odometry alone is not used for very precise navigation in robots. You need some sort of outside reference to correct for the accumulated errors associated with odometry. The precision you're seeing with the S2 is pretty close to as good at it gets with only odometry feedback.

    It's easy to say you could make a Lego robot capable of doing a ten times better job, it's a much different thing to actually build such a robot. Based on my experience with Lego robots, I think you'd have a very hard time making a wheeled Lego robot capable of matching the S2's performance.

    Did you pay $180 for your S2? The S3 sells for that price but it has a cool rechargeable battery system. I recall the S2 selling for significantly less than $180. I purchased mine on a Black Friday sale for $90.

    Congratulations on getting as far as you have.

    Here's a great video on robotics by David Anderson.



    One of his robots is made from Lego bricks but I doubt even his robot would out perform the S2 in the task of drawing a car using odometry input alone.

  • I take back m previous comment. I was simply venting. I'm pleased with these results although I feel there could be more feedback or some sort of mention as to the accumulation of error within code. I guess that could be another project of mine. Parallax did say that 1 unit was about 5mm but I found that 10 units is closer to 5mm.
  • I'm glad you got it sorted out. The S2 was only doing what it was told to do.

    Parallax has thousands of Scribblers out in the wild, mostly in educational environments. Most people do not see them as inferior to other bots.

    As far as feedback, there is always the tech support email and phone number when you are in a crunch.
  • Can someone tell me the code that is required to make the robot perform a certain task when various sensors are covered and then you press the reset button and it restarts and performs the certain task?
  • I think you want the 'default' software that comes pre-loaded in the Scribbler? S2 software downloads are available here. Click on the "Downloads & Documentation" line. You would be wanting the "S2 Default Robot Firmware".
  • If you have the S2 GUI, you can load that program into your S2 anytime you want by connecting your robot, turning it on, and clicking the button on the top row that looks like an S2 with a Halo over it.
Sign In or Register to comment.