Reader small image

You're reading from  Design Innovative Robots with LEGO SPIKE Prime

Product typeBook
Published inJan 2022
PublisherPackt
ISBN-139781801811576
Edition1st Edition
Concepts
Right arrow
Author (1)
Aaron Maurer
Aaron Maurer
author image
Aaron Maurer

Aaron Maurer, also known as “Coffeechug” is the STEM lead for 21 school districts in Iowa helping to expand STEM, Computer Science, Makerspace, and Purposeful Play into classrooms K-12. Aaron is also a former FIRST LEGO League coach for 8 years with much success working with phenomenal kids. He has a Master Educator License with endorsements in 5-12 Psychology – 163; 5-12 World History – 166; 5-12 American History – 158; 5-12 Computer Science – 278; PK-12 Talented and Gifted – 107; 5-8 Middle School Generalist – 182; and K-8 Computer Science – 277. Currently, Aaron is a member of ISTE Making It Happen Award; Lego Education Ambassador and Master Educator; PBS Digital Innovator and All-Star; PITSCO Tag Committee; Microsoft Innovator Educator Expert; Microsoft Innovative Educator Fellow; Global Learning Mentor (formerly Skype Master Teacher); Minecraft Global Mentor; and Makey Makey Ambassador. Finally, Aaron was a finalist for the Iowa Teacher of the Year in 2014.
Read more about Aaron Maurer

Right arrow

Chapter 6: Building a Dragster

Dragsters that race and are designed for speed are a classic build and one that every builder creates at some point in their lives. I have operated a LEGO MINDSTORMS robotics summer camp for several years and the dragster challenge is a favorite every year that the kids always want to compete in. Whether designing for yourself or competing against others, racing is a blast. In this chapter, you will build a dragster using the SPIKE Prime kit to see how it turns out in terms of speed and design.

Here is a photo of what your dragster will look like by the end of this chapter:

Figure 6.1 – Dragster

In this chapter, you will build and program as follows:

  • Building the motor frame
  • Building the gear system and back wheels
  • Building the body of the dragster
  • Adding the body design
  • Coding the dragster

Technical requirements

For the building of the dragster, all you will need is the SPIKE Prime kit. For the programming, you will need the LEGO MINDSTORMS app/software.

Here is the link to the code: https://github.com/PacktPublishing/Design-Innovative-Robots-with-LEGO-SPIKE-Prime/blob/main/Dragster.llsp.

You can find the code in action video for this chapter here: https://bit.ly/3FJPx41

Building the dragster

Before we get into the building of this dragster, let's explore the strategy being used for this dragster. The strategy for drag racing is all about speed. How fast can you get from the starting line to the finish line? That is it! The design of this dragster is based on the following strategies:

  • Low to the ground to eliminate drag.
  • Minimal touch points – the less friction the better.
  • Gearing up to max out the speed of the dragster.
  • Weight balance to help the dragster stay straight.

Keeping these features in mind will help you understand why the dragster is built the way it has been designed. Additionally, the dragster has been designed in a way to allow plenty of customization to be done to it without losing sight of these strategies. The body design has been created to give the look of a dragster, but you could easily modify the design to your own liking, as well as adding to or reducing the weight of the dragster.

In...

Building the motor frame

The first part of this build is to align the motors with a larger gear to maximize speed:

  1. To begin, you will combine two medium motors together using a yellow 3L yellow axle. In the space between the motors, insert a 36-tooth double-bevel gear:

    Figure 6.2 – Combining the medium motors with the gear

  2. On the side of each of the medium motors, attach two black connector pins on the outside pin holes and connect an azure 13L beam:

    Figure 6.3 – Add a 13L beam to the side of the medium motors

  3. You will build a simple frame to house the Intelligent Hub and ensure it does not cause friction with the gear system. The steps to do that are as follows:
    1. On the top of each medium motor, add two gray H perpendicular connectors.
    2. Connect two black 9L beams across the motors using the gray H perpendicular connectors.
    3. Add two black connector pins to each of the black 9L beams:

Figure 6.4 – Building the raised frame for...

Building the gear system and back wheels

  1. Now that the large gear is in place, it is time to add the small gear system to allow the wheels to spin faster:

  2. To begin this part of the build, you will build a sub-model of the gear axle. Follow these steps to do that:
    1. Start with a yellow 7L axle and add a black 12-tooth double bevel gear into the middle of the axle.
    2. Add two gray bushings on either side of the gear:

Figure 6.6 – Building out the small gear axle

  1. This sub-model should fit between the azure 13L beams and line up with the larger gear. At this point, nothing is going to hold it into place, but you will take care of that in the next step:

    Figure 6.7 – The location of the small gear axle

  2. You are going to build another sub-model for the wheels. Follow these steps:
    1. Connect two wheels together using a yellow 7L axle.
    2. Add a gray bushing on the side where the yellow 7L axle is most exposed.
    3. On the other side, add a white tooth onto the yellow...

Building the body of the dragster

  1. To begin the build of the rest of the body of the dragster, you will work on the opposite end to where the gears are located:

  2. Add an azure 7L beam across the medium motors using two black connector pins:

    Figure 6.11 – Building brace across motors

  3. Connect a purple 7x11 open frame to the azure 7L beam you installed in the preceding step using two black connector pins:

    Figure 6.12 – Adding an open frame to the build

  4. Add another purple 7x11 open frame to the dragster body using another two black connector pins:

    Figure 6.13 – Adding a second open frame to the build

  5. Connect an azure 7L beam to the end of the second purple 7x11 open frame using two black connector pins:

    Figure 6.14 – Adding a beam across the open frame

  6. Rotate your dragster so that you can see underneath the robot and locate where the purple 7x11 open frame connects to the main frame of the robot. Secure these together using two black T beams, connecting...

Adding the body design

  1. The first part of the body design is to create a space for one of the minifigs in the LEGO SPIKE Prime kit to sit and drive (or choose your own favorite minifig). The steps are as follows:

  2. Begin with a black 5x7 open frame and secure it to the purple 7x11 open frame closest to the Intelligent Hub, using four black connector pins:

    Figure 6.31 – Attaching the black 5x7 open frame to the dragster frame

  3. Add another black 5x7 open frame to the same purple 7x11 open frame but secure it to the black open frame you just installed in the previous step, using two blue connector pins and a purple 5L beam between them:

    Figure 6.32 – Adding the second black 5x7 open frame to the dragster frame

  4. Create four of these elements by combining a gray perpendicular connector pin and a yellow 3L beam:

    Figure 6.33 – Make four of these elements

  5. Secure these four elements into the insides of the black 5x7 open frames. Additionally, add four black connector...

Coding the dragster

The code for this project is designed to achieve the following objectives:

  • The dragster needs to count down 3-2-1 to make sure people have time to move out of the way.
  • The dragster needs to stop when it sees the red (or the color of choice) finish line.
  • The dragster needs to display the time to avoid human error when using a stopwatch.

Connecting to the proper ports

Before we begin to code, you need to make sure you have all the parts properly connected to the Intelligent Hub. Start with the motors. The motors should be plugged into ports A and E. It does not matter which motor goes into which port if they are A and E, since the dragster will only move forward and backward.

Your color sensor will go into port C. This sensor will help your dragster identify and stop at the finish line:

Figure 6.47 – The port view in the software

For this program, you will have two code stacks. Additionally, you will be...

Making it your own

And now it is time to hand the dragster over to you. This is where you can take what you have built so far and customize the dragster to your liking. Plenty of pieces have been left in the bin, such as designing aesthetic features, new approaches to making your dragster more intuitive, and plenty of coding options to take the dragster to the next level.

Here are a few ideas to consider:

  • What can you change on the body of the dragster to make it look like one you would drive?
  • Search online for different dragster designs and tweak this model to another body design.
  • Design a better seat for the minifigs to drive the dragster.
  • What are other approaches to help your dragster become faster? Less weight, better gearing, and drag resistance reduction are a few things to consider.

Summary

In this chapter, you explored the concept of gearing up to increase the speed of your dragster. You also explored the timer block in the coding as well as the use of the broadcast block. Again, this is one of my favorite build challenges because you can spend hours designing the perfect dragster to become as fast as possible. It is a timeless activity that everyone loves.

In the next chapter, you will be building a game to really challenge the mind.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Design Innovative Robots with LEGO SPIKE Prime
Published in: Jan 2022Publisher: PacktISBN-13: 9781801811576
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at ₹800/month. Cancel anytime

Author (1)

author image
Aaron Maurer

Aaron Maurer, also known as “Coffeechug” is the STEM lead for 21 school districts in Iowa helping to expand STEM, Computer Science, Makerspace, and Purposeful Play into classrooms K-12. Aaron is also a former FIRST LEGO League coach for 8 years with much success working with phenomenal kids. He has a Master Educator License with endorsements in 5-12 Psychology – 163; 5-12 World History – 166; 5-12 American History – 158; 5-12 Computer Science – 278; PK-12 Talented and Gifted – 107; 5-8 Middle School Generalist – 182; and K-8 Computer Science – 277. Currently, Aaron is a member of ISTE Making It Happen Award; Lego Education Ambassador and Master Educator; PBS Digital Innovator and All-Star; PITSCO Tag Committee; Microsoft Innovator Educator Expert; Microsoft Innovative Educator Fellow; Global Learning Mentor (formerly Skype Master Teacher); Minecraft Global Mentor; and Makey Makey Ambassador. Finally, Aaron was a finalist for the Iowa Teacher of the Year in 2014.
Read more about Aaron Maurer