EasyManua.ls Logo

ST ST7 - Page 282

ST ST7
317 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
282/317
9 - A Carrier-current System for domestIc Remote Control
The control of the relay coils
The relays are arranged so that one relay switches the motor on or off, while the other relay
selects the open or close direction.
As said above, the relays are of the locking- or bistable-type. This means that only a short
pulse of current in the coil is needed to trip the relay from one state to the other, thus con-
serving energy.
The difficulty with this type of relay is that we cannot know which position they are, since with
both coils de-energized they may be in either position. Thus, to start the motor in one
direction, we must do the following:
Pulse the direction relay to the desired direction
Pulse the on-off relay to the on position
To stop the motor, we must do the following:
Pulse the on-off relay to the off position
The function for stopping the motor is very simple:
void StopMotor ( void )
{
COILS = STOP ;
WaitDelay ( COIL_PULSE ) ;
}
It energizes the appropriate coil, and starts the timer as described above. When the time has
elapsed, the current in the coil is switched off.
To start the motor in one direction, the job is a little bit more complicated. To simplify the
writing of the C source text, and make it more legible, a general function has been written. It
receives a message (four are possible) and acts as required. The message is made of a value
defined by an enumerated type:
enum eStates { START_CLOSE, START_OPEN, STOP_CLOSE, STOP_OPEN } ;
and the function handles that message according to its value:
void SwitchMotor ( enum eStates Direction )
{
LastDirection = Direction ;
switch ( Direction )
{
case STOP_OPEN:

Table of Contents

Related product manuals