1 of 51

Principles of Engineering Refresher

PRESENTER: MASTER TEACHER ERIC RICE DATE: AUGUST 10TH, 2022

ERIC.RICE@WHSCHOOLS.ORG

2 of 51

Refresher Description

Participants will use the V5 Brain and new V5 sensors in combination with existing Vex Sensors to use VexCode V5 to complete programming tasks associated with Unit 3.1 including 3.1.7 and Marble Sorter 3.3.1. Participants can then continue to work and refine their skills with VexCode V5 using the new V5 Brain and associated sensors or work through another POE activity of choice. The workshop will be equipped with the following hands-on activities: Basic circuit review (1.2.3 and 1.2.4) and completion of Solar Hydrogen Car with Vex motor (1.3.1), Project 1.3.4 Heat Box Lab Renewable Insulation with Graphical Analysis, and materials to build a compound machine 1.1.6.

3 of 51

Morning Schedule

4 of 51

Afternoon Schedule

5 of 51

Google Drive Sharing

6 of 51

Automated Guide Vehicle 3.1.7

  • (Hardware Level 3, Software Level 4)An assembly plant would like your team to design an Automated Guided Vehicle (AGV) to drive in a straight line back and forth to deliver batches of parts. The vehicle must travel back and forth based on closed loop control. The AGV will not start until a button is pressed on the robot vehicle. When the same button is pressed and held at the end of a cycle, the robot will stop to complete a round trip back and forth.

7 of 51

Elevator 3.1.7

  • (Hardware Level 4, Software Level 4)A company would like to begin producing residential elevators. Your team must design the control system and a prototype of an elevator that can go between three floors in any order. Each floor must have a way for someone to call the elevator to that floor. The prototype must be able to identify when the elevator is at each floor and have a visual, such as a panel display or separate lights, to show where the elevator is. A built-in safety mechanism requires that the elevator normally rest on the ground floor and return to the ground floor after a user-determined period of nonuse.

8 of 51

Surgical Arm 3.1.7

  • (Hardware Level 2, Software Level 4)A surgical supplier needs a robotic arm to move equipment within a sterile environment. Your team must design a remotely operated arm with at least three degrees of freedom using a base that pivots, arm that raises and lowers, and pinch mechanism.

9 of 51

Cookie Topper 3.1.7

  • (Hardware Level 4, Software Level 2)A cookie factory needs your team to design a device that will put a chocolate drop on top of peanut butter cookies. The machine must position a cookie on a device that will then move it into position for a dropper to descend and dispense the chocolate drop. The cookie should then move to another position where it will be placed with other finished cookies to await inspection and packaging.

10 of 51

“Marble Sorter” 3.3.1

  • Basically sort 2 or 3 different marbles.

11 of 51

Marble Sorter Pics

12 of 51

Vex V5 Teaching & Learning Progression

13 of 51

Vex Robotics Support- Vex Library

14 of 51

Vex V5 Tutorials –Nice Resource

15 of 51

Step 1: In 3.1.1 Introduction to the Vex Robotics Platform PPT i

16 of 51

Step 2: Motors and Sensors Setup

17 of 51

Sample Brain Screens for Step 2

18 of 51

Step 3: Program Outputs and Inputs �3.1.2 and 3.1.3 Procedures

19 of 51

Step 4: While Loops and If-Else Structures 3.1.4

20 of 51

Next Slides are more on Step 4

21 of 51

Activity 3.1.4While Loops, If-Else Structures, & Variables

22 of 51

While and If-Else Example

23 of 51

Boolean Operators

Symbol (text based)

Symbol (V5)

Meaning

==

“Is equal to”

!=

“Is NOT equal to”

>

“Greater than”

<

“Less than”

>=

N/A

“Greater than or equal to”

<=

N/A

“Less than or equal to”

24 of 51

Looping - While loops

Looping allows the program to repeat a sequence as long as certain conditions are met. Looping streamlines your program so you don’t have create the same code multiple times. It simplifies your code and makes it easier to read and more efficient.

25 of 51

While loops

While (boolean condition)

{

Body (code you want to repeat)

}

26 of 51

While loop considerations

  • Once the program evaluates the condition and enters the loop - it completes all the steps in the body before evaluating the condition again. - it won’t stop in the middle if condition changes
  • Be careful with “infinite loops” - easy to get “stuck” in a section of your code.

27 of 51

While challenge (together)

Challenge 1

  1. Start by running motorA and motorB forward at full speed.
  2. When the bump switch is held:
    1. Stop both motors
    2. Run motorA forward at half speed
    3. Run motorB in reverse at half speed
  3. When the bump switch is released, go back to running both motors full speed forward

Challenge 2

Modify the code to allow this to repeat indefinitely

28 of 51

Other looping options

Boolean Condition

Commands

 

 

29 of 51

If Statements

  • Method for branching
  • Allows program to “make decisions”
  • 1 of 2 scenario
  • Does NOT loop
  • Is a singular “check” - if true, it executes
  • If not true, program skips

Start

IF

no

yes

Do this

Do that

30 of 51

If-Else Statements

  • 1 of 2 Scenario
  • Provides a “default” action or path

31 of 51

If/else-if/else Statements

-Occasionally you need more than 2 options

-1 of 3 (or more) scenario

32 of 51

Nesting

  • Nesting allows “multiple checks”, or loops within loops, etc.

33 of 51

Nesting Considerations

  • Be careful when controlling the same object with multiple conditions:
  • What will happen here?

34 of 51

Step 5: Variables and Functions 3.1.5

35 of 51

Next slides are more on Step 5: Variables and Functions �

36 of 51

Variables

  • Variables allow data to be stored in your program
  • Example variables might be time, score, count, etc.
    • Values you want to hold locally for access later
    • Makes your program more readable and more easily expanded

abrv.

Type

Value

int

Integer

0,5,-10

float

Float

0.5, 10.0

bool

Boolean

True,False

string

String

“hello”

Example uses:

  • Store the current score
  • Store the highest score
  • Store arm positions
  • Store speed
  • Store time (when something occurs)
  • Calculate and store values

37 of 51

Functions

  • A function takes a group of blocks and encapsulates them into a single block
  • One method of abstraction for your code (removing the details)
  • Allows for reuse
  • You have been using functions all along! Now let’s make your own!

void FunctionName(); - Declare the function

DataType FunctionName(parameters) - Define the function

{

body

}

FunctionName() - call the function

Function Declaration

Function Definition

Function Call

38 of 51

Function examples

Function Declaration

Function Definition

Function Call

Add an parameter

When to use functions…

  • When the code could be reused
  • To clean up/simplify long code
  • Think “subprograms” or break code up into smaller “tasks” that become your functions.

Tips

  • Use variables when possible to make functions more flexible - usable with different values
  • Use parameters to allow the user to customize

39 of 51

1.2.3 Physical Circuits

40 of 51

Intro to Electricity and Breadboarding Located in 1.2.3

41 of 51

Links to Eric’s Help Videos

  • A great way to learn how to physically wire these circuits in unit 1.2 is to use TinkerCAD.

42 of 51

1.3.1 Solar Fuel Cell Car

43 of 51

1.3.1 Resources to Guide Your Work

44 of 51

1.3.1 Additional Challenge

45 of 51

1.3.4 Heat Box

46 of 51

1.3.4 Heat Box Resources

47 of 51

Heat Box and Thermodynamics Help Videos from Eric

48 of 51

1.1.6 Compound Machine

49 of 51

1.1.6 Resources

50 of 51

Help video on Compound Machine Analysis

51 of 51

Some more info/Course Eval/Website Reference

Refresher website: Refresher website

Course Eval QR: