Curtain Actuation

There is no point in watering plants if they are going to die from a lack of sunlight. So a subsystem was created for opening and closing window shades and curtains.

This subsystems focus was on fulfilling the requirement to provide precision angular and linear control for use in a variety of ways. As mentioned previously a modified RC servo motor could be controlled with a 555 timer or through Pulse Width Modulation to control its angular rotation. A stepper motor was used instead of an RC servo to control angular motion.

Stepper motors have a natural 360⁰ rotation angle whereas an RC servo has only a limited range without modification. Servo motors also come in a wider variety of sizes and strengths.

Unlike a regular motor a stepper motor does not spin freely when a voltage is applied to its terminals. Instead a stepper motor has many inputs (4-8) and a voltage applied across the right pair will cause the stepper to rotate a small amount (typically 1.8⁰). This is called taking a step.

When a voltage is applied to the stepper motor terminals in the proper sequence the stepper motor will step in the same direction as the applied terminal voltage. To reverse the stepper motor the input sequence is reversed. To change the stepper motors speed the sequence is changed faster or slower. And to stop and hold a stepper motors position the sequence is halted on the appropriate step.

Stepper motor speeds can be limited by the inductive/resistive components associated with the leads and internal windings of the motor. This LC time constant can lead to stalling and dead zones of operation. The time constant that determines where the motor stalls can be easily changed on unipolar motors. This allows them to be run at speeds they were not initially designed for, and as long as the input power stays within the motors operational range no damage should come to the motor through such control. To change the LR time associated with a unipolar motor a series resistance is added to each line. Then by running the motor in its higher voltage range the same torque levels can be achieved. The drawback to running a system in this method is the power that gets wasted as heat in the series resistances that were added to the driving terminals.

Stepper motors come in two varieties bipolar motors, and unipolar motors. Bipolar motors have four input wires and require an H-Bridge circuit to drive the inputs. Unipolar motors have from five to eight inputs, but most are run using the five terminal configurations regardless of the number of terminals available. Unipolar and Bipolar motors have the same stepping sequences, but unipolar motors are easier to work with and do not require an H-bride driver circuit. A typical stepping sequence can be seen in the below image.

SteppingSequence.JPG

The above figure shows the sequence of terminal activation required for driving the motor in half step mode. Half stepping provides a motor with greater resolution but requires more power to drive the motor. To do regular stepping the odd numbered steps can be removed from the chart, and to drive the motor with more torque two adjacent terminals can be triggered at the same time. Any stepper motor requires two additional pieces of circuitry; a stepper driver and a transistor array capable of sourcing or sinking the motors operational voltage and current.

A stepper motor driver can be purchased for around $15, or one can be programmed on a microcontroller. The microcontroller option is cheaper, and allows us to add features that may not be available on a driver circuit. An ATtiny2313 is again chosen to drive the stepping sequence of the motor. Programming a step limit allows us to tell the motor how far it is required to turn before stopping. A general stepper motor driver was written in C++ for the ATtiny2313 and several input pins were used to determine various factors about how quickly, and how far the motor would turn. Limit switch inputs were also included in the code as a means of redundantly stopping the motor from turning past its desired bounds.

To provide the motor with enough power to turn a ULN2803 eight Darlington array with a common emitter was used to sink power through the motor terminals. Although only four of the eight Darlington pairs are required to drive the stepper motor a person can use the extra four, and the unused four digital I/O lines on the ATtiny2313, to drive a second motor at the same time for use on a future subsystem. The pinout of the ULN2803 Darlington transistor array can be seen in the next image.

DarlingtonArray.JPG

The block diagram for this subsystem is shown in the following picture.

BD_Curtain.JPG

Now being able to control the rotation of a motor precisely, the system can be mechanically converted from this motion into a linear path and meet the second motional specification of this subsystem. To do this conversion, simply connect the stepper motor to a long threaded rod via a shaft coupling. On the threaded rod is placed an inch long coupling nut. When the orientation of the nut is held constant and the stepper motor is turning the nut will move up or down the threaded rod depending on which direction the motor turns. The next picture shows the stepper motor attached to the threaded rod. The coupling nut can also be seen at the far right.

CurtainStepper.JPG

To hold the coupling nut in a constant orientation a non-threaded rod is run parallel to the threaded rod and a slider is placed on it. The coupling nut is then attached to the slider with some JB Weld. The motor and two rods are mounted in a frame to hold it all together. As the threaded rod turns the orientation of the coupling nut is held constant due to its connection to the slider. This causes the coupling nut to screw itself up and down the threaded rod which allows control of the backwards and forwards movement of the coupling nut. The next image shows this mechanical setup.

CurtainCoupling.JPG

The angle of threads on the threaded rod and the speed and resolution of the turning motor will translate to the speed and resolution at which the nut moves up and down the threaded rod. With a smaller threaded angle and a slow strong turning motor the linear motion can be made fairly strong as was done in this system. Industrial applications for this setup are commonly found in desktop printers, as well as CNC routing machines.

Window curtains are usually opened with a pull string, while the angle of blinds is determined by rotating a plastic rod. This system can be used to open either, with little modification. To open curtains that have a pull string, attach the string securely to the coupling nut on the threaded rod. Activate the system and the nut will move up or down pulling the curtains pull string with it. If the pull string is secured on the bottom with a pulley the curtains will open and close with no trouble.

To change the angle of blinds on a window directly drive the blind rod with the stepper motor and a shaft collar. Varying the level of light allowed to enter the blinds can be done by changing the number of steps the motor takes before stopping. The curtain stepper software flow is shown in the following figure.

CurtainSoftware.JPG

The schematic for this system is shown in the next image and a copy of the stepper motor program is included in the code section of the appendix under the heading ‘CurtainStepper.c’. Also as can be seen in Figure 25 a ULN2003 Darlington array can be used in place of a ULN2803 array. These chips are identical in function but the ULN2803 has one extra Darlington pair included in its array. There are also several connections to the ATtiny2313 that are not shown in the schematic. Each of these connections is a control signal for the program that runs the stepper motor and is described in the comments at the beginning of the program “CurtainStepper.c”.

CurtainSchematic.JPG

Curtain Driver Implementation Details

The curtain driver was required the most in terms of electrical and mechanical assembly. The frame to hold the system together was made from oak and measures 41.5’’ in length. The electronics were assembled as was described in the plant watering implementation system and placed in an identical RadioShack project box with a size K coax DC power connector attached flush with the side of the project box. The completed subsystem is shown below in the next image.

CurtainFull.JPG

A local activation pushbutton and an up/down toggle switch was added to the front of the project box. The local activation switches are wired in parallel to the external activation signal connectors so as to not interfere with the microprocessor activating the system. All signal connections to the outside world were made with screw terminals which can be accessed through drill holes created in the project box and which can be seen below in the following image.

CurtainFront.JPG

The stepper motor used for this subsystem is a size 23 motor and was purchased on e-bay with two other identical units for $30. It has a resolution of 1.8⁰ per step and 56 oz-inches of holding torque. It is a six lead unipolar stepper motor and can be driven from 12-36 VDC. The frame depth was measured to fit the size 23 motor. The motor was attached to the frame using its mounting holes and 3 2’’ machine screws. A hollow metal guide (slider) was placed in line with the motor shaft to hold the threaded rod. The slider rod was bent to fit through the motors final mounting hole and through a drilled guide hole at the top of the frame.

The electronic circuitry was attached to the side of the frame using zip-ties which passed through holes drilled in the project box for mounting. Momentary roller limit switches were mounted on small L-brackets at either end of the threaded rod and wiring to the switches was fed along the back of the frame and into the project box. To reach the limit switches with the wires, holes were drilled through the frame and the wiring fed through and soldered to the switch contacts. This setup kept the system very compact and clean looking. The wiring to the limit switches can be seen in the previous figure, while the motor mounting can be best seen in the next picture.

CurtainAngled.JPG

The speed of the stepper motor is kept slow to demonstrate the precision control achieved for both linear and rotational motion. As a result the coupling nut takes about a half hour to traverse the length of the threaded rod. For the demonstration the curtain driver will be actuated using its localized switches.

Future versions of the curtain driver can be improved by the addition of an emergency stop switch, an external speed controller, and a six pin programming header. The programming header would allow a user to easily interface to the microprocessor without having to take apart the entire system. This can also be used for testing different programs with greater efficiency.
The test results met the required design specifications for both linear and rotational motion control. The electrical and mechanical designs are both sound and can be used with slight modifications for a variety of applications. The curtain driver will also be rebuilt using a DC motor with limit switches and an H-bridge. This will enable a higher degree of efficiency and speed for this particular application.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License