Activity 1.2.8Emergency Stop (VEX®)
Introduction
An emergency stop, e-stop, is a feature that many machines have to enhance safety by providing a system to rapidly stop a machine. The emergency stop feature can be activated remotely when the machine is operated from a remote location. The most common configuration is a clearly marked button located within a safe area close to the machine. This button can be pressed by a human to stop the machine in an emergency.
In this activity you will apply a multitask program to provide an emergency stop for an operation.
Equipment
- Computer with ROBOTC software
- CIM VEX® testbed
- PLTW ROBOTC template
- Activity 1.2.7 Multitasking Emergency Stop presentation
Procedure
- Form groups of four and acquire your group’s CIM VEX® Kit under your teacher’s direction.
- Connect the CIM VEX® testbed Cortex to the computer.
CIM VEX® Testbed
- View the Activity 1.2.7 Multitasking Emergency Stop presentation to understand multitask programming.
- Open the PLTW ROBOTC template. Click File, Save As, , and thenselect the folder that your teacher designated, and name the file A1_2_7_eStop.
- In this activity the emergency stop task runs concurrently and ends all tasks if the e-stop button is pushed.If an ultrasonic sensor reports a value of 10 inches or less then both motors run at quarter power. Otherwise both motors turn at full power.
- Confirm that the Motors and Sensors Setup window reflects the inputs and outputsto be used. Note that additional motors and sensors that are physically attached may be configured; however, these are not required to be configured. Click OK to close the window.
Cortex Wiring Diagram
- Use the program as the main body of the program.
task e_stop()
{
while(true)
{
if(SensorValue(e_stopBtn) == 1)
{
stopAllTasks();// ends the program and all tasks including task main.
}
wait1Msec(10);// prevents the current task from using majority of available CPU capacity
}
}
task main()
{
startTask(e_stop);// initiates the e-stop task which will run simultaneously
while(true)
{
if(SensorValue(sonar)<= 10)
{
motor[rightMotor] = 32;
motor[leftMotor] = -32;
}
else
{
motor[rightMotor] = 127;
motor[leftMotor] = -127;
}
wait1Msec(10);// prevents the current task from using majority of available CPU capacity
}
}
- Save the program, power on the Cortex, compile, and download the program. If you have any errors, check with your instructor to troubleshoot your program.
- Test the program and troubleshoot until the expected behavior has occurred. Save the program.
- Describe the behaviors observed.
- Document what this program could look like as pseudocode simple behaviors.
- Modify the program to use the limit switch connected to digital input 1.
- Follow your teacher’s direction and either print the programs or submit it electronically with this activity.
Conclusion
- Describe any challenges that you encountered while developing the program.
- Describe applications for whichan emergency stop could be used.
© 2013 Project Lead The Way, Inc.
Computer Integrated ManufacturingActivity 1.2.8 Emergency Stop (VEX®)– Page 1