Shop OBEX P1 Docs P2 Docs Learn Events
Scribbling sport team logos with S2, using Microsoft Excel — Parallax Forums

Scribbling sport team logos with S2, using Microsoft Excel

NikosGNikosG Posts: 705
edited 2014-10-15 20:14 in Learn with BlocklyProp
Hello everybody,
I recently bought from Parallax the famous S2 robot and one of the first activities I made, was the: “Scribble Your Name with the S2 Robot” by Jessica Uelmen.I became very exiting when I saw the accuracy of the S2! I introduced the S2 to my students and we scribbled together their names. They enjoyed the result and one of my students asked me to scribble a “clover” that was the logo of his favorite sport team “PANATHINAIKOS”. We worked together and after a lot of effort we achieved to make the S2 scribble the clover.
attachment.php?attachmentid=89009&d=1327705537
Then all the students wanted to scribble the logo of their favorite sport team!
Although they hadn’t any experience with S2 and Spin language before, they became very enthusiast!
I shared them some piece of ruled faint paper and they started to do their drawings. They could find correctly the coordinates on their shapes but they had a difficulty to create the Spin code.
In order to help them I designed a Microsoft Excel File that could create automatically the Spin code from the coordinates.
Before I start to explain the method I would like to say that if we have to draw an arc it is not necessary to measure the W (the width of the base of the arc). Here is a small change in the formula that it was described by Jessica:
attachment.php?attachmentid=89007&d=1327705535

As you can see we can calculate the R of the S2.arc_to(x1,y1, R) command only using the coordinates of A and B and the height h of the arc. There are some calculation but don’t worry because the Microsoft Excel make this automatically.
Here is how it works my method: Supposing we have to scribble a “Flag”.
1) We find the coordinates of the 8 points and we numerate them.
2) We put the coordinates X and Y of every point in the green area.
3) If the robot must scribble an arc we fill the "ARC " column (ORANGE AREA) with 1 or -1 only . We Put -1 when the robot scribbles the arc clockwise and 1 when the robot scribbles the arc counter clockwise. In both cases we must also fill the "h" column (PINK AREA) with the appropriate value. If we have to draw a line, we leave these two areas blank. The default size is 30 but we can also change it
4) Then we mark the result area using the mouse and we press the button (export to spin file) in the help area. After this we get a spin file ready to load it in to S2, using the Propeller demo tool.
attachment.php?attachmentid=89006&d=1327705534

Here is the logo of “OLYMPIAKOS sport team” a more complicate drawing which uses 85 spin commands created by this way.
attachment.php?attachmentid=89008&d=1327705536
Making the activity more attractive we can program the S2 to multitask playing the Olympiakos theme song while drawing the logo.
Here is the video:
which you can also see from www.grobot.gr
962 x 975 - 186K
517 x 410 - 22K
581 x 371 - 23K
467 x 295 - 18K

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-01-27 15:36
    Nikos,

    'Spectacular achievement! My mouth is agape! I never would have thought to use Excel to write code. Congratulations, and thanks for sharing your Excel file!

    -Phil
  • rogersydrogersyd Posts: 223
    edited 2012-01-27 15:37
    That was far out. Awesome contribution. Thanks for sharing it.
  • NikosGNikosG Posts: 705
    edited 2012-01-28 01:28
    Thank you guys,


    Phil and Parallax have done excellent work with S2! As a teacher I have to say that S2 is the perfect robot for an educational curriculum. From my experience I believe that students on Lyceum, don’t like very much cables end wiring connections neither complicate programming code. On the other hand they love to see a robot doing amazing things like scribbling and roaming. S2 is all in one. No cables, all sensors build in, strong and easy to carry, friendly programming environment and finally the cost (comparing with other educational robots). The cost issue is very important especially here in Greece after the recent financial crisis. Phil congratulation for your work and the supporting open code! I'm sure that I' ll need your advice very soon because I want to make my S2 able to execute commands in Logo language! On 30rd of March 2012 there is a conference for ICT teachers here in Patras. I intent to make a presentation and demonstration of S2 in the teachers’ community as they are not very familiar with this new product!
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-01-28 09:01
    Thanks, Nikos! I'm glad the S2 is working out for you so well.

    BTW, my contribution the the S2 project was mainly the software, with only minor consultation on the hardware design. The hardware heavy lifting was done by Ben Wirz of Element, Inc., in Colorado. His company also did the design for the plastic enclosure, and he handled the arrangements for manufacture in China. Ken Gracey managed the project and brought in staff from Parallax, including their very talented art department, as needed. It all added up to a great team to be part of.

    -Phil
  • Ken GraceyKen Gracey Posts: 7,392
    edited 2012-01-28 09:21
    Nikos, most awesome explanation. I will be using the S2 with middle school students starting March 1st, and I'll be very thankful to have these examples to do precision drawing. You guys are making it all so easy - start with Jessica's video, move to Nikos' examples, and here we are!

    Nikos, please PM me so we can get in touch about the Propeller BOE this weekend.

    Thanks,

    Ken Gracey
  • ajwardajward Posts: 1,130
    edited 2012-01-29 00:50
    Nikos...

    That is totally cool!!!! I need to get my S1 programmed to scribble "WOW!" in tribute. ;-)
    Keep up the good work!

    Amanda Ward
  • NikosGNikosG Posts: 705
    edited 2012-01-29 01:38
    Well guys,

    Here is a set of 3 examples:

    “Clover”: made by me and my student Nodas.
    ”Heart_arrow”: Made by me and my students Ariadni and Nora
    “Olympiakos”: Made by me

    There are the excel file with the coordinates, and the exported spin code. You can play with the size using the excel file or make changes and improvements and you can take a different spin code.
    Enjoy these activities! I would be glad if you could send back photos on forum from any event running these codes with your S2 robots!
  • Jessica UelmenJessica Uelmen Posts: 490
    edited 2012-01-30 09:30
    Nikos,

    This is amazing!! What an incredible combination of programming tools, this makes drawing with the S2 so simple.

    Great work!

    Cheers,
    Jessica
  • ercoerco Posts: 20,256
    edited 2012-01-30 12:52
    Αυτό είναι φανταστικό, Nikos!
  • WhitWhit Posts: 4,191
    edited 2012-01-30 18:20
    Great work Nikos! You and your students deseve a gold medal...

    The heart and arrow is just in time for Valentine's Day!

    Keep up the great work.
  • PublisonPublison Posts: 12,366
    edited 2012-01-31 08:23
    Nikos,

    'Spectacular achievement! My mouth is agape! I never would have thought to use Excel to write code. Congratulations, and thanks for sharing your Excel file!

    -Phil

    I must echo Phil's response.

    Thanks so much for sharing!

    Jim
  • NikosGNikosG Posts: 705
    edited 2012-02-12 15:23
    Hello guys,

    Your responses make me feel on top of the word!!!
    I keep trying to improve the scribbling method with S2 and Excel and I have some useful notes with symmetrical shapes.
    Before I share with you these findings I would like to explain the multitasking example which we program the S2 to play music as it scribbles the sport team logo.
    In order to achieve this challenge I used the object file: “simple_multicore_template.spin” from AN011 Parallax Semiconductor Applications Notes
    The only I had to do was to create the music file of “Olympiakos” and “Panathinaikos” theme songs in spin code. I used the Scribbler Program Maker (S2 v1.3)

    attachment.php?attachmentid=89524&d=1329088346
    Although I used to play guitar many years ago I’m not very good at reproducing the music tones hearing a song. So I asked my nephew Leonidas who plays piano, to hear the athletic marches and put the appropriate notes in the Scribbler Program Maker environment. When I had the notes on the Scribbler Program Maker I pressed the “view the propeller program” button and I got the spin code. The spin files with the result code are: “pao_logo_music.spin” and “Olympiakos_logo_music.spin”.
    I also send you another example with title: “apple” from my student Thanos, and a power point presentation that explains the coordinate’s conversion to spin with the excel file.
  • Ken GraceyKen Gracey Posts: 7,392
    edited 2012-02-12 16:52
    Nikos -

    For a local group of 34 7th and 8th graders I'm instructing these examples couldn't have come at a better time.

    I've got you in the queue for a couple of PropBOEs along with two S2 robots. Let me know if you want the S2s ahead of time.

    Sincerely,

    Ken Gracey
  • jdoleckijdolecki Posts: 726
    edited 2012-02-12 17:06
    Thats what I like about Parallax (Mr Gracey)

    At any time Ken just gives away stuff to people to do more amazing things with.

    Thanks Parallax and Ken for providing such a great product and support to all of us.

    John
  • NikosGNikosG Posts: 705
    edited 2012-02-12 22:55
    WOW!!! Ken!!! Of course!!!! This is AMAZING!!!! The s2 has become the center of attention for the students in my school. Every day they bring me new shapes and logotypes to try with s2!!! A couple of S2 robots will make teaching easier and will give us the opportunity to do more amazing things!
  • Ken GraceyKen Gracey Posts: 7,392
    edited 2012-02-13 10:47
    @Nikos, these will be as a "gift" to reduce customs, which is exactly what they are considering we are thanking you for the contribution. These might go slow or quickly depending on what shipping method our sales staff uses (they'll choose the best one). In either case they'll be on an airplane by tomorrow.

    Ken Gracey
  • NikosGNikosG Posts: 705
    edited 2012-02-13 12:53
    Ken Gracey wrote: »
    @Nikos, these will be as a "gift" to reduce customs, which is exactly what they are considering we are thanking you for the contribution. These might go slow or quickly depending on what shipping method our sales staff uses (they'll choose the best one). In either case they'll be on an airplane by tomorrow.

    Ken Gracey
    Ken ,
    Thank you very much !!!

    You are a big heart!!!!

    I hope to be able to do more interesting things with Parallax products!
    You have built a wonderful world with excellent cooperators! The world of Parallax! The most amazing in this world is the people!!!
    Keep going and inspire the people around you!

    p.s. I’m looking forward to receive the Parallax package!!!!!

    Nikos Giannakopoulos
  • NikosGNikosG Posts: 705
    edited 2012-02-15 10:59
    Symmetrical logotypes- S2 & MS Excel:

    The following two logotypes have a particular characteristic. They are almost symmetrical. The red axis on the middle of each shape divides the shape into two almost identically parts. I said almost because they aren’t a 100% symmetrical. As you can see in the first logotype the left side of the skull is not exactly the same as the right size of the skull and in the second logotype the left eagle catches a sword and the right nothing. However we can use this fact in order to scribble easier these shapes with the S2 robot and Microsoft Excel!
    attachment.php?attachmentid=89613&d=1329332225

    The only we have to do is to find the coordinates and the spin commands of the one half of the shape and then using the MS Excel we can find automatically the coordinates and the spin commands of the other half. If we have a point A(x,y) and C is the x-intercept of the symmetry axis, the coordinates of the symmetrical point A’(x’,y’) are: y’=y and x’=2*c-x . Ms Excel gives us the opportunity to find extremely easy these coordinates.
    In the next step I will present two strategies in order to scribble these shapes with S2 robot.

    Nikos Giannakopoulos.
    847 x 316 - 42K
  • NikosGNikosG Posts: 705
    edited 2012-02-19 09:56
    Let’s go to scribble the logotype of “AEK” (this one with the two symmetrical eagles)

    attachment.php?attachmentid=89703&d=1329672905

    This logotype is more suitable for the first strategy:
    According the first strategy the S2 start its path from the point 1 that is belong on the axis of symmetry (red axis) and it scribbles the left half of the shape as it is showed by the small red arrows. This path has a set of 53 points which is the only set of points we have to calculate in order to accomplish the whole shape. When S2 arrives in point 53 will continue to scribble the right half following the path which is indicated by the green small arrows. As you can see the S2 will draw the string of symmetrical points in opposite order than the original points. You can also see that S2 keeps the way that scribbles the symmetrical arcs. If the original arc is clockwise the symmetrical it is also clockwise and if the original arc is counter clockwise the symmetrical it is also counter clockwise (the height of the arc doesn’t change).
    So if we have all the data for the left half shape , in order to find the correct data for the right half shape we must do the following:
    Step1: we copy and paste the columns: num,x,y,arc and h, in the blank area next to the "spin command" column next to last point 53

    attachment.php?attachmentid=89706&d=1329672925


    Step2: Select the area you’ve just copied from step 1 and sort the selected area in descending order according the first column (num). The 53 point will come first and the 1 point will come last.


    attachment.php?attachmentid=89707&d=1329672927


    Step3: Copy the “ARC” and “h” column and paste them one cell down. In fact we make a shift one position down.

    attachment.php?attachmentid=89708&d=1329672929

    Step4: In this step we are ready to create the coordinates of the symmetrical points. In cell J55 we write the type “=2*11,5-V55” which is the formula X’=2*C-X that give us the symmetrical X coordinate. We copy this formula into all the following cells. So we have automatically the X’ coordinates of all the symmetrical points!

    attachment.php?attachmentid=89709&d=1329672931

    Step5: We copy the Y, ARC and h columns and we pate them next to the X’ column
    In this step if our shape is 100% symmetric we have finished.

    attachment.php?attachmentid=89710&d=1329672933

    If the shape it is not 100% symmetric (like the ‘AEK’ logotype) we add or we remove the differences

    Step6: In the above example we must remove the commands 73,74,75,76 for the right sword because the logotype doesn’t have a right sword. Then select whole the spin command area (don’t worry about the blank lines) and press the button to get the spin code.

    attachment.php?attachmentid=89711&d=1329672934

    Here is the result: what exactly scribbles the S2 robot.

    attachment.php?attachmentid=89702&d=1329672902

    I also send you the spin code and the excel file with all the above steps in separate Excel sheets. Feel free to make any questions or improvements!
    BTW the second strategy for symmetrical shapes that I will suggest, is by far easier than the first one but we can’t use it in all symmetrical shapes. In the next post I’ll present the logotype of “PAO” with the skull and the two wings, which is one shape we can use both strategies.


    Nikos Giannakopoulos
    320 x 240 - 14K
    623 x 615 - 114K
    510 x 376 - 54K
    512 x 374 - 49K
    514 x 307 - 42K
    544 x 393 - 61K
    521 x 261 - 40K
    518 x 353 - 54K
  • NikosGNikosG Posts: 705
    edited 2012-03-01 14:01
    Before introduce the second strategy in order to scribble symmetrical shapes, I’ll give you another example: the “Puma Logo” created by my student Leandros, and one update of “Eagle_aek” logo created by students Philipos and Hero.

    attachment.php?attachmentid=90179&d=1330639029

    attachment.php?attachmentid=90182&d=1330640090

    I also send you some unsolved examples very useful for teachers.

    Working on symmetrical shapes and trying to improve the scribbling method, I ended up that the existence of a pen lifter on S2 robot will expand the abilities of the robot.
    The wonderful gift (the s2 robots) from Ken Gracey gave me the chance to experiment more with the robot. So an amazing S2 pen lifter kit is in the pipeline and I make an effort to create a video for the assembly and installation instructions in order to share with you.

    Stay tuned

    Nikos Giannakopoulos
  • NikosGNikosG Posts: 705
    edited 2012-03-06 13:15
    Hi,

    I came back for the 2nd strategy in order to scribble symmetrical shapes with S2.

    According the second strategy the robot scribbles the first half of the symmetrical shape and before goes for the second half it must return at the same point where the first half started.
    In the following shape you can see that for the first half, S2 uses 86 steps and in the 86th step it has returned again in the start point. Then it is ready to scribble the symmetrical 2nd half shape using the rules x’=2*c-x, y’=y (the same as the 1rst strategy) and Arc’=-Arc (because in the symmetrical shape it scribbles the arcs in the opposite direction than the first half)

    attachment.php?attachmentid=90340&d=1331067744

    It is very easy to create the commands for the symmetrical in the excel file. Just copy and paste the above formulas in the cells for the symmetrical points. You can see the "wings_skull_test.xls" file.
    Here is a first attempt to scribble the wings and skull using this method.

    attachment.php?attachmentid=90342&d=1331068175


    I convinced that this shape is too complicate and the use of a pen lifter is essential…..


    Nikos Giannakopoulos
  • WhitWhit Posts: 4,191
    edited 2014-10-15 20:14
    Amazing stuff Nikos - Great to re-visit this tread! Thanks for posting the link again!
Sign In or Register to comment.