Program Flow LabVIEW Robotics Fundamentals. Unintuition You know what this program does… So what...
-
Upload
liliana-bell -
Category
Documents
-
view
214 -
download
1
Transcript of Program Flow LabVIEW Robotics Fundamentals. Unintuition You know what this program does… So what...
Program Flow
LabVIEW Robotics Fundamentals
Unintuition
• You know what this program does…
• So what does this one do?
Inserted code
Unintuition
• Nope
then until TouchSensor pressed?
“Wide” turn with right wheel planted
Move forward
then
Wait in place 1 second
Unintuition
• Nope
then until Touch Sensor pressed?
“Wide” turn with right wheel planted
Move forward 1 sec
Unintuition
• Correct answer:
• But why? And how do you explain it?
then until Touch Sensor pressed
Turn in placeMove forward 1 sec
Intuition
• Commands in LabVIEW follow simple rules:– Commands run when the program reaches them– Robots are very literal
Intuition
• Run when the program reaches you– Blocks “pass” control of the program between
them as they are done• Motor commands pass control when they are done
setting the motor power (usually instantly)• Wait commands pass control when done waiting
Intuition
Be the Block Exercise:1. One person gets to “be” each command2. One person gets to “be” the robot3. Use a ball or other prop to represent control of
the program
Intuition
Be the Block Exercise:– Each motor “command” will tell the “robot” to do
something, such as “Set Motor C forward”– When done, hand “control” to the next command!– The “robot” should only do exactly what it is told!
Set Motors B and C forward!
Okay
(walking forward)
Intuition
• To see this happen LIVE in LabVIEW:– Turn on Highlight Execution (near the Run button):
– Then Run the program; commands will animate to show which one is running!
Active command