Scribbling sport team logos with S2, using Microsoft Excel
NikosG
Posts: 705
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.
Then all the students wanted to scribble the logo of their favorite sport team!
Although they hadnt 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:
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 dont 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.
Here is the logo of OLYMPIAKOS sport team a more complicate drawing which uses 85 spin commands created by this way.
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
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.
Then all the students wanted to scribble the logo of their favorite sport team!
Although they hadnt 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:
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 dont 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.
Here is the logo of OLYMPIAKOS sport team a more complicate drawing which uses 85 spin commands created by this way.
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
Comments
'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
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, dont 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!
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
Nikos, please PM me so we can get in touch about the Propeller BOE this weekend.
Thanks,
Ken Gracey
That is totally cool!!!! I need to get my S1 programmed to scribble "WOW!" in tribute. ;-)
Keep up the good work!
Amanda Ward
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!
This is amazing!! What an incredible combination of programming tools, this makes drawing with the S2 so simple.
Great work!
Cheers,
Jessica
The heart and arrow is just in time for Valentine's Day!
Keep up the great work.
I must echo Phil's response.
Thanks so much for sharing!
Jim
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)
Although I used to play guitar many years ago Im 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 coordinates conversion to spin with the excel file.
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
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
Ken Gracey
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. Im looking forward to receive the Parallax package!!!!!
Nikos Giannakopoulos
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!
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.
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
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.
Step3: Copy the “ARC” and “h” column and paste them one cell down. In fact we make a shift one position down.
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!
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.
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.
Here is the result: what exactly scribbles the S2 robot.
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
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
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)
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.
I convinced that this shape is too complicate and the use of a pen lifter is essential ..
Nikos Giannakopoulos