Shop OBEX P1 Docs P2 Docs Learn Events
S3 Rubber-Laser Gun & Educational activities — Parallax Forums

S3 Rubber-Laser Gun & Educational activities

NikosGNikosG Posts: 705
edited 2018-02-26 19:55 in Robotics
Hi all,
This is an announce from some activities of this year educational project with my students.
The project uses a 3d printed Rubber-band-gun controlled by S3 robot via hacker port with BlocklyProp
S3_rubber_gun.jpg
The inspiration project was the "S2 Marauder: 12-shot Semi-automatic ..." from Phil Pilgrim, an amazing rubber Gun for S2.

However I believe that the S3 Hacker Port, the 3d printers and BlocklyProp can make this project suitable and for not advanced makers and programmers.

That exactly was my main effort for that project that is still in progress...
Using that gun with BlocklyProp, I found powerful trigonometric commands that can activate students in order to use Maths better ....

In the next posts I'll give gradually all the activities and details of this project and I expect to improve it through the discussion, your comments and ideas....

For those with a 3d printer the parts are here: https://www.thingiverse.com/thing:2789905

«1

Comments

  • WhitWhit Posts: 4,191
    Great work Nikos! Thanks for sharing this!
  • ercoerco Posts: 20,244
    Sweet! By laser, do you plan to use the Laser PING to locate nearby targets? Here's my take on a rubber band laser-guided/targeting robot:


  • NikosGNikosG Posts: 705
    edited 2018-02-12 12:13
    erco wrote: »
    Sweet! By laser, do you plan to use the Laser PING to locate nearby targets?

    In order to locate the targets I use the PING)))™ ultrasonic sensor.
    The laser that I use, is a simple red Laser Head mini pointer adapted on the edge of gun's barrel.
    laser_code.jpg
    That laser is connected to the hacker port on P3 Pin and I can control it using the make Pin high/low commands. The purpose of that laser is to know in advance where exactly the rubber will going to hit and warn the users.
    It is also useful to test the several angles of the gun during the educational activities without need to throw rubbers every time...
    911 x 996 - 206K
  • ercoerco Posts: 20,244
    Nice! Of course you could swap a LaserPING right in there... :)

    BTW that rubber band hook above your laser diode sticks up a lot and is surely deflecting your rubber band to some degree. Important if you're aiming at small targets. You want a very gentle ramp, if any. As my photo above shows, I favor a straight rod with a fork cut in the end, per sketch.

    RBgun.png
    275 x 100 - 695B
  • erco wrote:
    BTW that rubber band hook above your laser diode sticks up a lot and is surely deflecting your rubber band to some degree.
    That's to correct for gravity, which affects the laser beam less than the rubber band. :)

    Nice job, Nikos!

    -Phil
  • NikosGNikosG Posts: 705
    edited 2018-02-13 07:12
    erco wrote: »
    BTW that rubber band hook above your laser diode sticks up a lot and is surely deflecting your rubber band to some degree. Important if you're aiming at small targets. You want a very gentle ramp, .....

    This is not a problem at all. Due to the gun's design you must make the minimum changes on3D printings. The only part you must change is the "S3_rubber_gun_part4" . In the next photo I explain the assembly of the gun's barrel with this part.
    part4_GunBarrel.JPG

    It is also very important that you can change the lenght of the aluminum barrel according the rubber's size you have, without change the rest parts of the gun.
    So for every change and improvement I provide the Sketchup files.....
    1642 x 1232 - 450K
  • NikosGNikosG Posts: 705
    edited 2018-02-26 20:00
    Here is a list of electronics and hardware for that project:
    RG_5_letters.jpg
    1) Two (2) Parallax Standard Servo
    2) One PING)))™ ultrasonic sensor (or Ideal The LaserPING 2m Rangefinder)
    3) Laser head mini pointer from e-bay (Optional)
    4) Aluminum tube (Length:175mm, Ext. diam:8mm, Int diam:5.5mm). You can change the length according rubber size)
    5) A barrel 40 mm length 6mm diam for cog's assembly
    6) (10) screw 15mm and nuts (for servo and servo horns assembly)
    7) (3) srew 40 mm and nut (for gun's main body assembly)
    8) Rubber bands (choose the size according gun's barrel length)

    video



    3648 x 2435 - 2M
  • NikosGNikosG Posts: 705
    edited 2018-02-16 18:21
    For the educational scenarios we'll need some targets ...
    Targets could be anything however in order to test the shooting angles, targets must have a height. 60 cm is a very good height for close and distance shootinghs .
    It is also necessary every target to have a flat area near the base in order to be detectable from PING)) sensor (that area for my targets is 14.5cmX20cm).
    target_mix.jpg
    The entire target base is wooden and on top of it we can put a paper with the printed target..
    1270 x 828 - 268K
  • Your students are very lucky, Nikos! Keep up the good work!

    -Phil
  • NikosGNikosG Posts: 705
    edited 2018-02-17 10:51
    Your students are very lucky, Nikos! Keep up the good work!

    -Phil

    Thank you Phil!
    I think that the activities I'll give on the next posts are able to be done with S3 and Blockly, with both guns : "S2 Marauder" and "S3 Rubber gun". The only thing that students must pay attention is to connect the corresponding parts of each gun in the right Pins in order to "run" properly the blockly code.
    Here is my Pin connection:

    Hacker_port_connections.jpg
    I also send the image of the target ,for those who want to print one...

    In the next post I'll give a simple way to calibrate the tilt of both guns with Blockly and the use of a protractor without any adjustment on the tilt-servo

    965 x 662 - 150K
    550 x 550 - 80K
  • What is the algorithm to find the target with the PING sensor?
  • NikosGNikosG Posts: 705
    edited 2018-02-19 18:55
    72sonett wrote: »
    What is the algorithm to find the target with the PING sensor?
    Please let me show two activities that will lead us to the algorithm you asked...
    two_activities_2z.jpg

    On activity-01 called Azimuth, the S3 robot must pivot and every time that locate a target toward in front of it, must stop in order to do the activity 02.

    On activity-02 called tilt, the S3 is looking toward straight to a target (in a random distance)(that has being solved from activity-01) , and it must ajust the tilt of the gun in order to hit the target.

    Both activities that lead to find the target can be solved using data from the PING))) sensor..
  • NikosGNikosG Posts: 705
    edited 2018-02-19 09:51
    Here is the image of both activities described on the previous post....
    two_activities_2z.jpg
    864 x 330 - 54K
  • WhitWhit Posts: 4,191
    WAY cool!
  • NikosG wrote: »
    ... the S3 robot must pivot and every time that locate a target toward in front of it
    ...
    using data from the PING))) sensor..
    OK, but the PING))) sensor only measures the distance to an object in front of it. How do you identify the object as a target and not the wall of the room, or a person or ...

  • NikosGNikosG Posts: 705
    edited 2018-02-23 20:46
    72sonett wrote: »
    OK, but the PING))) sensor only measures the distance to an object in front of it. How do you identify the object as a target and not the wall of the room, or a person or ...

    The maximum detection area is a circle with the S3 robot as the center, and radius 3m (the PING))) sensor maximum detection limit)
    Activity_01_blines_people.jpg
    So we can avoid to have walls or other objects inside the detection area.......
    However as you said, a person can be identified as a target inside the detection area. The only we can do is to prohibit the acces in that area to the people.
    In otther case we need an artificial vision with another sensor able to see the difference
    between a man and a target...

    Of course we must always have in mind that a rubber that throws the gun can goes out from the detection area....
  • 72sonett72sonett Posts: 82
    edited 2018-02-21 20:26
    So, basically you fire at anything that is within +/- 3 m range.
    NikosG wrote: »
    ... another sensor able to see the difference between a man and a target...
    Maybe also a PIR sensor, if that detects something, the target may be a person, so then you do not fire.

  • Great work, Nikos. I'm going to use some of this for Tuesday's webinar.

    Ken Gracey
  • NikosGNikosG Posts: 705
    edited 2018-02-22 19:40
    Ken Gracey wrote: »
    Great work, Nikos. I'm going to use some of this for Tuesday's webinar.

    Ken Gracey
    Thank you Ken, I will be there!

  • NikosGNikosG Posts: 705
    edited 2018-02-23 20:45
    Before I explain more the two activities, I'll give a method to calibrate a gun's tilt using the BlockyPROP.

    We create a table with ServoY and Y values…
    ServoY is the angle of the servo and Y is the real tilt of the gun.

    S3_caribrate_tilt.jpg

    We give some random values to the servoY (e.g 80, 60, 45,30) in order to see the produced tilts….
    For each one ServoY value we execute the code “Servo Pin P1 set angle (0 ο -180 ο) ServoY” on BlocklyPROP, and then we get a corresponding tilt that we must measure using a protractor in order to complete the table. (for me, the values I got were: 18,38,53,68)

    protractor_measure.jpg
    From the table we can see that the sum of values y and servoY is a constant number. For me it was y+servoY=98 (for another user could be a different number but it doesn’t mattet). From that number we can have the Tilt formula (For me it was: ServoY=98-y). In other words every time we want a tilt y degrees, we know the corresponding servo's angle ServoY=98-y
  • NikosGNikosG Posts: 705
    edited 2018-02-23 22:37
    Activity 01 (Azimuth)
    Activity_01_blines_02.jpg
    On activity-01 called Azimuth, we put targets randomly, inside a circle with radius =< 3m. The S3 robot must pivot and every time that locate a target toward in front of it, must stop in order to shoot. At the present time we avoid the shooting and we program the S3 only to blink its Led’s and waiting for a while in front of the target before continue the scanning the entire circle.
    The procedure is the following: The S3 pivot in a small step (Azimuth step=2 degrees) and simultaneously gets the values X from the Ping sensor that is the distance. Every time that x is smaller than max_detection_area it means that a target has been detected.
    Then the S3 light its LEDs for a while and then makes a rotation skip to continue the scanning on the rest part of the circle

  • WhitWhit Posts: 4,191
    I've got lots of work to do to keep up with you Nikos!
  • ercoerco Posts: 20,244
    edited 2018-02-25 22:13
    There has been a super-accurate rubber band gun line (RBS) at Toy Fair for several years. I talked with the young inventor Ben Stack for a long time last year, he's as passionate about rubber band guns as we are about Parallax! His guns are super cool and well designed, but I think the big secret (applicable to Nikos' & PhiPi's guns) is HOW the rubber bands are loaded. Namely, asymmetrical tension, or stretching one side more than the other, which makes the rubber bands spin in flight (like an Aerobee) instead of tumbling, reducing aerodynamic drag to let them go farther. Try that when you need more range and/or accuracy. Also (per my earlier post) note how the far end of the gun is flat, and doesn't have a deflecting ramp at the end like Nikos' otherwise perfect design. :)

    https://precisionrbs.com/about-precision-rbs/

    A pity Ben's face is never shown below, the blogger hogs all the glory. Loading technique details at 2:20:




  • ercoerco Posts: 20,244
    Although apparently a single NERF dart does more damage.

  • NikosGNikosG Posts: 705
    edited 2018-02-26 11:21
    To continue the analysis of Activity 01, we have some stages, that is shown in the next animation:
    Activiti01RG.gif
    When the S3 detect a target, stop the scanning procedure (at this stage the gun it is not centered towards the target). Then the robot turns right for some degrees in order to center the target, then it shoot (light the red LEDs and makes a sound), and finaly skip the target, turning right again for some appropriate degrees.
    951 x 665 - 372K
  • NikosGNikosG Posts: 705
    edited 2018-02-26 19:59
    For the activity above you only need the Ping))) sensor without the gun.

    On BlocklYProp the corresponding program has the name: "Activity 01 Azimuth Rubber gun (NikosG)"
    Video


  • NikosGNikosG Posts: 705
    edited 2018-02-26 19:56
    Explanation of Activity-02 (Tilt)
    On activity-02 called tilt, the S3 is looking toward straight to a target (in a random distance), and it must adjust the tilt of the gun in order to hit the target.
    Activity_02_solution.jpg
    Here as you can see, we have a right triangle and we know the vertical side (h) (the height of the target, that is constant h=50), and the horizontal side (X) that is the distance between the base of the target and the robot. The horizontal side (X) can be changed but we can know it every time, using the PING))) sensor. On BloclyPROP the command in order to get te value of X is: “ X=Ping)) sensor on P2 distance in centimeters”
    The Tilt of the gun is the angle y.
    Using trigonometry, we can calculate the Tangent of the angle y, so… Tan(y)=h/y and then the angle y is: y=arc tangent (h/y). On BloclyPROP the command in order to calculate Y is: “arctangent of (h÷X) X 1 store in Y”
    In the next experiment we move the target in front of the robot. BloclyPROP using the method we described above can calculate the tilt and change automatically the gun’s position….
    Video




    Moving the target closer to the robot the tilt is increased. Moving the target away from the robot the tilt is declined... The gun always target the center of the target.
  • 72sonett72sonett Posts: 82
    edited 2018-02-27 22:15
    I would measure the horizontal distance from the PING back to the hinge point of the gun, call it 'a'.
    Then, as the height 'h' of the target and 'a' are constants and 'd' is the distance measured by PING, the tilt angle α = atan (h/(a + d)).

    BTW, from your earlier target drawing I would think h is closer to 40 cm than 50 cm.
  • Like this:
    593 x 330 - 38K
  • NikosGNikosG Posts: 705
    edited 2018-03-01 13:23
    72sonett wrote: »
    I would measure the horizontal distance from the PING back to the hinge point of the gun, call it 'a'.
    Then, as the height 'h' of the target and 'a' are constants and 'd' is the distance measured by PING, the tilt angle α = atan (h/(a + d)).

    BTW, from your earlier target drawing I would think h is closer to 40 cm than 50 cm.
    Yes you have right in some way....
    However the rotation center is that with the yellow arrow.... So The "α" you said, is a little bit different.....

    activity2_new.jpg
    In fact we have some "Similar" triangles over there.......
    It doesn't matter which of them we are going to take because all of them have the same tilt
    I would say that is better keep the smaller one (with the clear d as a side ), and to "play" a little bit with the values of "h" in order to have the best result....


    593 x 330 - 47K
Sign In or Register to comment.