+ All Categories
Home > Documents > Basic Movement Using the Front Panel - Robotics … get rid of all the text and pictures on the...

Basic Movement Using the Front Panel - Robotics … get rid of all the text and pictures on the...

Date post: 03-Apr-2018
Category:
Upload: danghuong
View: 215 times
Download: 2 times
Share this document with a friend
4
LabVIEW™ Education Edition Curriculum with LEGO ® MINDSTORMS ® © Copyright Carnegie Mellon Robotics Academy 1 Behavior Lab The following steps will introduce you to the Front Panel window in LabVIEW™ and will explain how to add a knob to change the power given to the motors as well as basic wiring in the Block Diagram. Before you begin, make sure your NXT is on and connected to the computer, then open the NXT Motor example Control_a_Motor_With_Time.vit. Basic Movement Using the Front Panel 1. Front Panel The Front Panel is the user interface for a VI. You can add knobs and switches to control and change values in the Block Diagram. Also, you can add graphs and readouts of values in the code. 2. Targeting the NXT Go to File > Target to NXT. There should now be orange squares in the bottom left of your windows, indicating the change. This mode ignores all of the LabVIEW options that are not supported for the NXT. 3. Removing Items To get rid of all the text and pictures on the Front Panel press CTRL-A on your keyboard to select everything, then press the Delete key. Now you have a blank Front Panel.
Transcript
Page 1: Basic Movement Using the Front Panel - Robotics … get rid of all the text and pictures on the Front Panel press CTRL-A on your keyboard to select everything, then press the Delete

LabVIEW™ Education Edition Curriculum with LEGO® MINDSTORMS® © Copyright Carnegie Mellon Robotics Academy

1

Behavior Lab

The following steps will introduce you to the Front Panel window in LabVIEW™ and will explain how to add a knob to change the power given to the motors as well as basic wiring in the Block Diagram. Before you begin, make sure your NXT is on and connected to the computer, then open the NXT Motor example Control_a_Motor_With_Time.vit.

Basic Movement Using the Front Panel

1. Front PanelThe Front Panel is the user interface for a VI. You can add knobs and switches to control and change values in the Block Diagram. Also, you can add graphs and readouts of values in the code.

2. Targeting the NXTGo to File > Target to NXT. There should now be orange squares in the bottom left of your windows, indicating the change. This mode ignores all of the LabVIEW options that are not supported for the NXT.

3. Removing ItemsTo get rid of all the text and pictures on the Front Panel press CTRL-A on your keyboard to select everything, then press the Delete key. Now you have a blank Front Panel.

Page 2: Basic Movement Using the Front Panel - Robotics … get rid of all the text and pictures on the Front Panel press CTRL-A on your keyboard to select everything, then press the Delete

LabVIEW™ Education Edition Curriculum with LEGO® MINDSTORMS® © Copyright Carnegie Mellon Robotics Academy

2

Behavior Lab

4. Controls PaletteGo to View > Controls Palette to open the Controls Palette.

5. Adding a ControlTo add a control, simply click and drag an icon from the palette to the Front Panel workspace. Drag a knob from the Numeric palette to the Front Panel.

6. Editing PropertiesTo change the knob scale, right click on it and go to properties. A new window pops up. Go to the scale tab and change the maximum from 10 to 100 and click OK.

You can turn this knob to set a value from 0 to 10. You want the knob to set the motor power, so it should go from 0 to 100.

The Controls Palette contains all the controls, like knobs, buttons, switches, and text fields; and indicators, like gauges, LEDs, charts, and graphs.

You can navigate through the various sub-palettes by using your mouse and clicking on the names to expand or contract the menus.

Page 3: Basic Movement Using the Front Panel - Robotics … get rid of all the text and pictures on the Front Panel press CTRL-A on your keyboard to select everything, then press the Delete

LabVIEW™ Education Edition Curriculum with LEGO® MINDSTORMS® © Copyright Carnegie Mellon Robotics Academy

3

Behavior Lab

7. Turning the Knob You can now use your mouse to turn the knob from 0 to 100. Turn it to a value around 45 (don’t worry if it is not exact), then open the Block Diagram window by going to Window > Show Block Diagram.

8. Block DiagramThere is a new VI in the diagram. This VI outputs the number from the knob on the Front Panel. Click and drag the knob VI to the left of the Motor On VI.

9. WiringYou need a wire to connect the knob VI to the Motor On VI. To do this, move your mouse over the lower left portion of the Motor On VI until your mouse becomes a spool of wire and a blue wire end shows up.

Left click and then move your mouse to the terminal on the knob VI. (The terminal is near the white triangle) Left click again and your wire is created.

If you are having trouble wiring, check out the Wiring Trouble-shooting at the end of this handout.

Page 4: Basic Movement Using the Front Panel - Robotics … get rid of all the text and pictures on the Front Panel press CTRL-A on your keyboard to select everything, then press the Delete

LabVIEW™ Education Edition Curriculum with LEGO® MINDSTORMS® © Copyright Carnegie Mellon Robotics Academy

4

Behavior Lab

10. Run the Program Click on the Run button to send and run your program on the NXT.

ReviewThis VI will use the values set on the knob to go forward for five seconds and then stop.

Wire TroubleshootingIf you make a mistake while creating a wire you can right click or press the Escape key on your keyboard to cancel making the wire. Also you can delete wires by selecting them with your mouse and pressing the delete key on your keyboard.

Remember, the robot only uses the knob value set when you download the program. Later you will learn how to control the speed while the robot is moving!

Broken wires will be dashed and have a red X on them. This means that something is connected improperly. The keyboard shortcut CTRL - B will remove all broken wires from your dia-gram.

Take value from knob

Move forward using knob value for motor power

Run for five seconds and stop


Recommended