EXPERIMENT 6
Chapter 2 – Computerized Models
2.1 Introduction
This chapter is the pinnacle of our studies. Here we can combine our knowledge of
programming with our capability to connect the computer to the "outside" world. In these
experiments, you will be challenged with tasks that you must face. These tasks require you to
solve problems regarding the structure of the required models and the control program needed
to operate it.
We must emphasize two aspects of the use of simulation kits:
a) While building some models, we must emphasize the necessity to work accurately and to
follow the instructions. This is mainly true in the first models.
b) To construct other models and solve additional problems, you must let your imagination
run wild, and then improve your ideas by a logical process. We will explain this process
further on.
Construction is based on "FischerTechnik" construction kits. There are many such kits available
and so there are many construction possibilities.
The learning method we have chosen emphasized the freedom to search for and discover
alternative solutions for each problem, with the possibility to analyze and evaluate each
solution. The construction solutions suggested here are intended only as stimulation and do not
represent a single or recommended solution.
Complete models and construction instructions are presented here. Let your imagination and
talent take over to present new ideas for building the models. Contend with your ideas and try
to improve them by logical thinking.
The object of experimental learning is to improve our thinking techniques by becoming aware
of efficient thought processes.
The process of solving a problem is characterized by partial or full use of the following thought
and action steps:
a) Defining the problem, collecting the data and understanding the background.
b) Collecting data regarding possible solutions.
c) Examining a number of possible solutions.
d) Selecting the "Best Solution".
e) Trying to solve the problem (in our program - using simulation kits).
f) Evaluating the solution while comparing it to the initial requirements.
g) Connection and improvement.
Good Luck !!
Experiment 6
– Automatic Fan
Objectives:
To construct a fan controlled by a light sensor.
Control and command of a time dependent system.
Automatic systems control.
Equipment required:
Computer
SESLOGO software
Power supply
APPLIC-37 – controller interface
TPS-3609 – FisherTechnik components kit
Discussion:In this activity, we will construct an automatic fan operated with an optocoupler
consisting of a light sensor positioned opposite a lamp. The system we build
resembles an automatic hand dryer. We will improve this system by placing the light
sensor beside the lamp with a reflector opposite them both.
In the parts kit you will find a light sensor called a phototransistor, fitted in a lamp holder. We
use the sensor as an electronic switch, which is closed when light shines on it and is opened
when it is in the dark. A light sensor is a polarized component. Look at it and you will see that
one pole is marked in red and the other black. The black pole must be connected to one of the
inputs J and the red pole to +V.
We will also use this system to practice timers, and systems operation according to a timetable.
It is better to create a new directory (DAVID 4 for instance) for the following projects.
Procedure:
Step 1: Construct a fan using a motor and a propeller. Place an optocoupler – which you
construct by positioning an uncovered (white) lamp opposite the phototransistor
(light sensor) – in front of the [Link] a red and a green signal lamp. Let the
diagram assist you.
Light
Sensor Green Lamp
White Red Lamp
Lamp
Step 2: Connect the electrical components according to this diagram:
J7 J6 J5 J4 J3 J2 J1 J0 GND Q7 Q6 Q5 Q4 Q3 Q2 Q1 Q0
-
M Green
+
Red
+V
White
Step 3: Create a new procedure named MOTOR ON with only one command:
DIGITAL OUT
ON
7
Step 4: Create another procedure named MOTOR OFF with the following command:
DIGITAL OUT
OFF
7
Step 5: Create the following procedure named FAN2:
DIGITAL IN ?= MOTOR ON
6 0
DIGITAL IN ?= MOTOR OFF
6 1
RESTART
Step 6: Create the following main program named FAN:
DIGITAL OUT
ON
0
FAN2
Step 7: Run the program FAN.
Put your hand in front of the light sensor.
The motor should rotate.
Step 8: Check that the fan coupled to the motor blows air in the right direction.
If not, switch around the motor connections.
Step 9: Halt the program.
Write a program to perform the following actions:
a) Switches ON the green light and the white (optocoupler) light.
b) Waits until no light falls on the light sensor.
c) Switch ON the fan and the red light.
d) Test the light sensor again.
e) When light once again falls on the light sensor, stops the motor.
Step 10: Change the MOTOR ON procedure to:
DIGITAL OUT
OFF
2
DIGITAL OUT
ON
1
DIGITAL OUT
ON
7
Step 11: Change the MOTOR OFF procedure to:
DIGITAL OUT
OFF
1
DIGITAL OUT
ON
2
DIGITAL OUT
OFF
7
Step 12: Change the main program FAN to:
DIGITAL OUT
ON
0
10
FAN2
Step 13: Run the program.
The white light goes ON and after a while the green light goes [Link] we turn on the lights, it
turns ON slowly (it seems fast to our eyes, but not for the computer or the light sensor). It also
affects the lights when we turn ON the motor. This is the reason why we add delay element
before checking the light sensor. We check the light sensor only after the system is stable.
Step 14: Move your hand in between the white lamp and the light sensor (watch out for the
fan!) so that it blocks the light to the sensor. The red light should go ON and the fan
should rotate. The green lamp should go OFF.
Step 15: Remove your hand.
The red lamp should go OFF, the green lamp should go ON and the motor should
stop.
Step 16: Halt the program.
Step 17: Download the program and run it.
Insert your hand again and the fan will go ON again.
Move your hand around as if you were rubbing it in the air flow. Most probably at
some stage light will fall on the sensor and the motor will stop even though your
hand is still there. The motor will go on when your hand blocks the light again.
Step 18: Challenge exercise:
Improve the program so it solves this problem.
Turn OFF the motor only after 100 sequential "OFF conditions" of the switch.