a1tQ2000009ZWRFIA4

Course: AI LAB- Level 2
Magic Box Stack Light

  • 6-12 grade
  • Intermediate

Lesson Description:

What is a stack light? Stack lights are a crucial part of a manufacturing cell. These devices provide visual feedback to the status of a work cell. It allows operators and personnel to know exactly what is happening at any given time. The number of lights and colors vary depending on the application.

Common stack lights consist of three colors:

  • GREEN – Normal Working conditions
  • YELLOW – Attention is needed, request for help, or a warning that material may be low.
  • RED – Indicates that a condition has been met that requires immediate attention. Often comes with an alarm.
 

Additional Colors
BLUE, CLEAR/WHITE – These colors may indicate various conditions such as the machine is running, machine service required, or a user defined signal.

Humans can trigger inputs in a manufacturing cell to start or stop different actions. An output like a stack light can provide valuable feedback.


KEY VOCABULARY

  • Stack Light
  • PIR sensor
  • 2-Button Input Module
  • Human Sensor
  • Magic Box
  • Input
  • Output


EQUIPMENT & SUPPLIES

  • Dobot Magic Box
  • Magician Robot Arm w/ Suction Cup
  • Digital - 2-Button Input Module
  • 12V Power Cable and Supply
  • Digital – PIR Sensor
  • Common Sensor Cables
  • LED Module
  • USB C to A Cable

image description

Lesson Modules


Teaching Tips:

PROCEDURE

SECTION 1 – WIRING the MAGIC BOX, SENSORS, & MAGICIAN ROBOT

Caution: NEVER wire anything to the Magic Box or Magician while it has power on. ALWAYS turn them off before making connections or damage to the Controllers could occur. Be sure to ask your instructor if you have any questions. 

1. For this activity, you will need:

  • • 1x Magic Box
  • • 1x USB-A to USB-C Cable
  • • 1x AC/DC Power Adapter (12V)
  • • 3x Common Sensor Cables

2. Wire the Magic Box as shown below

  • • 1x DUAL BUTTON – PORT 2
  • • 1x PIR SENSOR – PORT 4
  • • 1x LED MODULE – PORT 6
Magic Box wiring diagram

Caution: MAKE SURE THE TAB IS PRESSED DOWN ON THE WHITE CONNECTOR WHEN DISCONNECTING ALL SENSORS!!! It is very easy to damage the sensors if the white connector is pulled or tugged on without pressing down the small white tab to release the cable from the sensor housing. 

Tab Pressed Down

SECTION 2 – CONNECTING the MAGIC BOX & ROBOT to DOBOTLAB

  1. Open up DobotBlock Lab in the software.
DobotBlock Lab connection steps DobotBlock Lab connection steps
  1. Once ALL the wiring is done (sensors connected and robot arm connected), power ON the Magic Box and Robot. WATCH and WAIT for the robot to completely power on. (GREEN INDICATOR)
DobotBlock Lab connection steps DobotBlock Lab connection steps DobotBlock Lab connection steps
  1. Repeat the connection process completed in previous activities.
       a) Connect to the Magic Box in DobotLab.
       b) Add the AI Sensor Kit and Magician Extensions.
       c) Ensure the robot’s envelope is clear and home the robot.

CHALLENGE

SECTION 3 – CREATE A STACK LIGHT PROGRAM

For this challenge, develop a pick and place routine that adds:

  • a) A push button (B-BLUE) to start each complete loop (block in place)
  • b) A stack light for visual feedback
    • • GREEN ONLY - Normal Operation - Moving
    • • GREEN & YELLOW Waiting for Block (B-BLUE Push Button)
    • • RED ONLY – Motion detected while in operation
  • c) A PIR sensor that detects movement around the work cell environment that stops the primary operation (only while in operation)
  • d) A push button (A-RED) to restart the process from warning
DobotBlock Lab connection steps

Helpful tip At this time, using Blockly, a code does not exist that will stop motion once it has been started (GO TO or JUMP). For this simulation, the program will only look for motion (from the PIR) inside the work envelope in-between each motion. This is an excellent opportunity to develop a MY BLOCK that can be placed throughout the program. 

DobotBlock Lab connection steps

THINGS TO THINK ABOUT:

  • • What variables would be helpful? (both to simplify the program but also to debug it if it is not working as planned)
  • • What MY BLOCKS would be helpful? (break up the program into sections… waiting?)
  • • Use of JUMPS to cut down on motion blocks… but… does that take away the places to insert “look for motion”?
  • • Possibly try something like the code below to try to catch motion? 5x 0.1 = 0.5 … half a second?

If your set up did not work correctly the first time, what did you have to do to make it work?

DobotBlock Lab connection steps

Teaching Tips:

CONCLUSION

  1. Why was the program unable to stop the robot while it was in motion?
  2. What other sensors/inputs from the kit could be used to add safety in a manufacturing cell, and how would they be used?

GOING BEYOND

Finished early? Try some of the actions below. When finished, show your instructor and have them initial on the line.

  • _________ 1. Add the servo as an output in the work envelope to simulate dropping a safety shield while the robot is in motion.
  • _________ 2. Replace the 2-Button Input module with the gesture sensor. Make “swipe left” do blue button, and “swipe right” do red button.