Wednesday, February 8, 2012

Activity 3.1.5 Variable Functions

INTRODUCTION

A program can accomplish a given task in any number of ways. Therefore programs can quickly grow to an unmanagable size. One of the learning tasks in programming is to develop an understanding of loops and variables. In this way, we can limit the size of the program. Loops allow programs to repeat a set of functions for a specified number of times. Variables provide the ability to assign and monitor values. The use of variables allows for complex control of a system.

EQUIPMENT

- RoboPro software
- fishertechnik components:
   - Interface, power supply, and USB Cable
   - 1 complete wire
   - 1 lamp

PROCEDURE

In this activity you will create a program that controls the number of times a light turns on and off.

The ability to use variables in your program is a powerful feature. Variables are intermediate storage spots for specific information. At specific spots in your program, you can query the variable and instruct the program to act on this information. This information can be whether a particular switch  has been pressed, whether a predetermined number has been reached, or how often a specific event has occurred.

The variable expression can represent anything that has a value. The variable can equal another variable, an analog input, or a number. We can manipulate the variables to produce the output we desire.

Increase Available Function Blocks

1. Open a new file in RoboPro. Choose Level 5 Objects from the Menu Bar. This will make available the function blocks needed to complete this activity.

2. Expand Program Elements. This will allow you to view the full list of available element subgroups.

3. Select Basic elements. This will allow you to utilized common programming element blocks such as start and end program.

4. Create the program below. Three new function blocks are utilized. The Plus function block can be located in the program elements subgroup Commands. The Variable function block can be located in the program elements subgroup Variables, Timers. The Branch (with Data Input) function block can be located in the program elements subgroup Branch, Wait.


5. Wire a lamp to M1.

Plus Function Block

Every time a program passes through the Plus function block, it adds a value to the block connected to the node on the right.

6. Right click on the Plus function block to bring up additional information. Four different areas can be manipulated.

Command: Identifies the mathematical operation that the function block will perform.

Value: Identifies a numeric value to be manipulated by the mathematical command.

Description of Value: This text will be viewable on the function block in the program.

Data Input for Command Value: If this box is checked, a node will appear on the left, which allows a starting value to be designated.

7. Change the command element Value to "2".

Variable Function Block

A Variable keeps track of a value. RoboPro function blocks that are orange communicate values or information. They do not represent ports or control any physical components. They contain or provide information for the function blocks that must make Branch decisions.

8. Right click on the Variable function block. Three different items can be manipulated.

Name: Identifies the variable, not the value of the variable. It is helpful to name the variable something that describes its function. Also, the variable may be used in multiple places.

Initial Value: Identifiies the starting numeric value of the variable. Depending on your program design, the numeric value of the variable may need to be set at a specific value other than the default 0.

Variable Type: Local variables are only valid in the subprogram in which they are defined. Global variables with the same name are valid throughout the main program and all subprograms. Object variables are only valid for specific variable instances.

9. Change both variable function blocks names from "var" to "Count". Make sure that "Count" is spelled the same for both blocks. "Count" and "count" are two different variables.

Branch (with Data Input) Function Block

A branch (with Data Input) is much like the Analog Branch. Both possess yes and no nodes based upon a defined condition. The important difference is that Analog Branches retrieve information from an analog input device, while a Branch (with Data Input) retrieves information from whatever value is provided through the infromation node on the left side of the function block. It is common for this information to come from a Variable function block.

10. Right click on the Branch to bring up additional information. Two different items can be manipulated.

Condition: Identifies the condition that will be considered true.

Swap Y/N Branches: Choosing this selection causes the 1 and 0 nodes to trade places on the function block.

11. Change the Branch block condition to greater than 8.

12. Create descriptions next to each function block to describe what you believe will happen at each one.

13. Run the program and adjust any descriptions that may have performed differently that you predicted. Demonstrate the successful program for your instructor.

14. For how many seconds was the light on?

5 seconds.

15. Write a program that repeats the following sequence three times before ending: The lamp turns on for four seconds and turns off for four seconds. Insert text next to each function block to explain what is happening. Demonstrate the successful program to your instructor.



CONCLUSION

16. Describe how you might modify the Plus command so that it can reset a variable block to 0 within a program.



17. What might an industrial or manufacturing engineer need to count or keep track of? Describe one example.












Friday, February 3, 2012

Activity 3.1.4 Branch Functions

INTRODUCTION

One of the powerful attributes of a computer program is its ability to make decisions. Although it can be argued that only humans are capable of decision making, computers are able to make decisions using criteria. They are able to compare two values and determine whether one is larger than the other. They can determine whether a statement is true of false, based on empirical data.

EQUIPMENT

- RoboPro software
- fisthertechnik components:
   - Interface, power supply, USB cable
   - 3 complete wires
   - 1 lamp
   - 2 mini switches
   - 1 potentiometer

PROCEDURE

In this activity you will create programs that control a lamp based on the input from digital and analog inputs.

Digital Branch Functions Block
The Digital Branch function block can be used to represent a mini switch in your program. As the program flows into the tope node of the switch, it can leave in two different ways. If the circuit in the switch is closed, the flow will continue out the node labeled 1. If the circuit is open, the flow will leave through the node labeled 0.

1. If the mini switch is not being pushed and it is wired normally open, through which node with the program continue?

The program will continue through the normally open node 0.
2. Create the program below, wire the lamp to M1, and wire a mini switch normally open to I1.


3. If I1 is wired normally open, describe what will happen if the mini-switch is never pushed.

If the mini switch is never pushed, then the status of the lamp will not change until an intervention is committed. Basically, the program will continue to loop until there is a hiatus in the never ending loop of the program created - it doesn't stop until the switch is pressed, with which the program ends.

4. Right click on the Digital Branch block to bring up additional information. You can manipulate four specific areas: the Digital Input, Interface/Extension, Image, and Swap 1/0 Branches.

Digital Input
Make sure that the Digital Branch identified matches the correct component.

Interface/Extension
Identifies the interface on which the component and port are located. IF1 is teh default control interface. You will not need to change this unless you add extension modules to the interface.

Image
Identifies the image represented on the function block. Selecting the component you have connected to the output port on the interface allows for easy visualization during programming.

Swap 1/0 Branches
This causes the 1 and 0 nodes to trade places on the function block.

5. Run the program.

6. Wire a second mini switch  normally closed to input I2. Create a program that will turn on a lamp when the switch connected to I2 is pressed. Insert text next to each function block to explain what is happening. Demonstrate the properly functioning program for your instructor.

Analog Branch Function Block
The Analog Branch function block can be used to make a decision based on an analog value. All possible combinations less than, greater than, or equal to can be paired with a value. If the condition is true, then the flow will exit through the node labeled Y. If the condition is not true, then the flow will exit through the node labeled N.
7. Create the program below, wire the lamp to M1, and wire a potentiometer to analog input AX. Turn the actual potentiometer ccw until it stops.

8. Right click on the Analog Branch to bring up additional information. You can manipulate four specific areas.

Analog Input
Make sure that the Analog Branch identified matches the correct component. There are also options to measure the voltage and distance with other components using the Analog Branch.

Interface/Extension
Identifies the interface on which the component and port are located. IF1 is the default control interface. You will not need to change this unless you add extension modules to the interface.

Condition
The condition that will be considered true is entered here. For this activity, change this to less than 300.

Swap Y/N Branches
Choosing this selection causes the 1 and 0 nodes to trade places on the function block.

9. Set the Analog Branch condition to >100.

10. Start the program and slowly turn the potentiometer until the lamp turns off.

11. Modify the program so that the light turns on when the potentiometer is turned. Insert text next to each function block to explain what is happening. Demonstrate the properly functioning program for your instructor.

CONCLUSION

1. Describe why it is important to include branches in programs.

Branches in programs allow multiple things to happen at once, taking the complexity out of it a little bit.

2. Describe an everyday application of a normally open switch that has not been given as an example.

The keys on a keyboard are all just switches normally open with a different function.

3. Describe an everyday application of a normally closed switch that has not been given as an example.

A doorbell in a house is another application, but is normally a closed switch.

Thursday, February 2, 2012

Activity 3.1.3 Basic Programming

ITRODUCTION

Computer programmers often use code to create software and web pages. You have probably heard of hypertext Markup Language (HTML), a common language for creating web pages. Many designers use HTML, but most people utilize software that converts designs to HTML. If you wish to view the original code from a web page, most Internet browsers will allow you to right click in the page and choose View Source.

EQUIPMENT

- RoboPro software
- fishertechnik components:
     - Interface, power supply, USB cable
     - 4 complete wires
     - motor

PROCEDURE

In this activity, you will construct a flowchart that will turn a motor on or off. You will also check the system to see if your flowchart perfroms as written. You will be introduced to four Function Blocks: Start, Motor, Time Delay, and End.

1. Connect the interface to the computer and power supply, and then connect a motor to connection M1.

2. Open RoboPro and ensure that you are properly connected using Test Interface.

3. Click New on the toolbar and choose File --> New form the Menu Bar. You should recognize the shapes of function blocks in the element window on the left as common flowchart shapes. If you do not see shapes on the left, click Level from the Menu Bar and choose Level 1.

You will use the following function blocks to complete this activity.

CREATING A PROGRAM

4. To insert program blocks into the function window, left click on the program block then left click in the function window where the block is to be placed.

5. Insert a Start block into the Function window.

6. Insert a Motor output block into the function window and position if just under Start. If you touch the top node of the Motor output block to the node on the Start block, it will automatically connect. You can also manually connect blocks by left-clicking on one node and then left-clicking on the second node. Right click on the Motor icon to bring up the block information dialog box. You will notice that you can manipulate five specific areas.

Motor Output: identifies current programming function block output port. Your motor is currently attached to M1, so M1 must be selected in order to be controlled through programming.

Image: identifies the image represented on the function block. Selecting the component you have connected to the output port on the interface allows for easy vizualization during programming.

Interface / Extension: identifies the interface on which the component and port are located. IF1 is the default control interface. You will not need to change this unless you add extension modules to the interface.

Action: identifies the action you want the function block to perform when reahed within the program flowchart. If Motor is selected under Image, selecting cw or ccw will send power to a motor. Switching between cw and ccw will change the rotational direction of the motor. Stop removes power from the output. If you change the image from a motor to any other component, these options will change to On and Off.

Speed: controls output voltage from interface port. The higher the number, the greater the voltage output.

7. Insert a Time Delay block into the Function window and position it just under the Motor output block. Right click on the Time Delay block and change the time delay to 3 seconds.

8. Insesrt a Motor output block into the Function window and position it under the Time Delay block. Right click on the Motot output block. Under Action, select stop.
9. Insert an End block into the Function window and position it under the Stop Motor block.

10. Add labels to describe what is happening at each programming step. Select the Drawing Function block, located at the bottom of the Element Window, and click in the function window where you want the text to appear. If you need to edit your text, select the text box, click Draw from the Menu Bar, and choose Edit.

When programs become larger and the function blocks represent actual components, labels are invaluable for planning, troubleshooting, and communicating your process to others.

11. Choose Start from the Toolbar. Watch the function window as the program runs. The function blocks will change color as the program flows. This will be important later when you try to identify where certain functions occur when you run a program.

NOTE: if you need to delete function blocks or drawing objects, highlight the item(s) and click Delete on the keyboard. You may also select Delete from the Toolbar and click on the items that you wish to delete. You can also delete or copy several  objects by left clicking and dragging a large box around them.

12. Modify your program to run a motor for two seconds, off for two seconds, on for two seconds, and finally turn off before the program ends. Insert text next to each function block to explain what is happening. Demonstrate this for your instructor once the program runs successfully.

CONCLUSION

1. What is the best way to make sure that all of your devices are in the correct ports of the interface and have been wired correctly?

The best way to do this is to test it and you can do that by using the test window on your toolbar. If it is not wired correctly, there will either be a notification window or you will see no result in the values (which are supposed to be changing when you run a test).

2. Explain the importance of labeling block functions within a flowchart.

By doing this, you can communicate your ideas to others and make things easier to see for other people attempting to help.

Program 1:


Program 2:

Wednesday, February 1, 2012

Activity 3.1.2 Flowcharting

INTRODUCTION

Flowcharting for engineers and other proffessionals is an important part of planning a process. It is a way to think through a problem and document a solution. When video game developers design games, they must contemplate how the game will react to the many decisions made by players. Every time a player moves a remote or pushes a button, the processor in the game system must react immediately based upon the data provided by the game. Imagine how large a flowchart would be for even a simple video game.

EQUIPMENT

- PowerPoint or Word
- Activity 3.1.2a


(CLICK TO ENLARGE ANY OF THE ABOVE IMAGES)

Activity 3.1.1 Inputs and Outputs

5. In the test interface window, what is the condition of I1 when you are NOT pressing the switch?

Checked or unchecked? unchecked

One or zero? zero

Is voltage present or not present? not present

6. In the test interface window, what is the condition of I1 when you are pressing the switch?

Checked or unchecked? checked

One or zero? one

Is voltage present or not present? present

7. Move the wire in connection 3 on the mini switch to connection 2. Repeat the testing process in steps 5 and 6. What has changed about the behavior of the switch?

It works backwards where step 5 replaces step 6 in properties. So it would look like:

Checked or unchecked? checked

One or zero? one

Is voltage present or not present? present

9. Record the numeric value range of the potentiometer. 53 to 5000

10. Connect the NTC Resistor to the AY analog input. It is not polarity sensitive.

11. Record the value of the NTC resistor. 1832

12. Place the NTC Resistor between your fingers to warm it for 10 seconds. Record the new value. 1690

14. Describe how you can change the direction the motor shaft rotates without switching between cw and ccw.

Switch to 01 and 02 (M1 Mode) and toggle the values.

15. When touching, the value decreases to the absolute minimum, and when 3 inches and farther away, the values are the highest.

16. Normally open (0)

18. The photoresistor's values increase the farther away the activated lamp is.

19. The photoresistor's values increase the closer the lamp is to the pad.

20. The phototransistor can be utilized as a normally open digital input if you apply the light to it.

21. The phototransistor can be utilized as a normally closed digital input by connecting it normally to the circuit and activating it with the light rays.

1. The diagram indicates that ports 1 and 2 are connected in a circuit and are normally open; put with ports 1 and 3, they are normally closed.

2. Computers translate the signals into numerical values to be read on a scale.

3. Because the thermal energy in the metal conducts the electricity more than if the metal is cold.

Wednesday, January 4, 2012

Engineering Ground Zero

What different "trades" (types of construction work) are featured in this video? Name at least three.

The different trades featured in the video included concrete, cement, glazing, steel, and stone cutting.

What aspect of the project is most interesting to you? Why is that?

The most interesting aspect of the project is the amount of planning that went into it and the amount of work that people put in to get the memorials done before the deadline to make it that much more memorable.

The Smartest Machine on Earth

What is "machine learning"?

"Machine Learning" is the process by which a computer answers questions, and if the questions are answered wrong or incorrectly, the computer corrects the mistake, learns from it, slightly modifies the programming and search restrictions, and remembers the correct answer to the exact question in the event it appears again in another place.
How did the IBM team employ that concept in the development of Watson's AI? What advantage did that provide over previous attempts at "intelligence"?

Watson's AI learned throught the process stated above, except every time the computer made a mistake, it came closer and closer to the correct answer through later questions that were answered by searching through thousands of documents and bits of data stored in memory. The advantage was that every search became more and more accurate until the exact answer to every question was given, and although the IBM team never reached that point, they are continuing to get closer and closer.

I've often mentioned the term "Empirical Scepticism". What does that mean? How does that relate to the concept of Machine Learning? How does this relate to your life?

In this particular case, Empirical (scientific) Scepticism is the questioning or doubtfulness in one's knowledge or abilities, so, in relation to the concept of "Machine Learning," the idea is to doubt the credibility in Watson's sources or the search results and specifications. Basically, the idea revolves around modifying the programming to improve the answers that Watson gives. The idea relates to me personally in my second-guessing of myself. Take mathematics for example; I always double-check my answers, make sure that I did everything correctly and within the accepted deviations, according to the directions and the information given and by the rules of the geometrical shape for which the figures are being calculated.