To control the system I have chosen the PIC 16F84 microcontroller. Support ICs are an RS485 line driver for serial interface to the HA system, and a stepper motor driver.

 

RS485 line driver:

Havn't done this bit yet.

Stepper driver:

The motors I have tested that have the required torque are bipolar motors, and testing was done using a L6219 Stepper driver. This is a PWM controller with dual H-bridges rated at 750mA per bridge. So I need a bipolar driver, but as some of the motors I have require a greater drive current, I need an alternative to the L6219.

The PWM control is needed so that the current through the motor windings can be accurately controlled. Many of the larger motors are rated at low voltages (e.g. 2 - 5 volts) and high current (e.g. 1.5A per phase), so a PWM driver is used with a higher supply voltage (between 10-50V) and the current is limited to the required level. At the high current levels required (approx. 1.5 Amps per phase) an integrated PWM current controller/H-bridge driver is not widely available, so I am using a combination of the L6506 PWM controller and L298 Dual H-bridge. Here is an extract from the datasheet showing the connections:

PIC programs:

I wrote a test program to receive input from the local OPEN/CLOSE switches and the two limit switches, and sequence a set of LEDs (to simulate the motor direction).

You can download the test source code here.

To make this into the complete program, I need to add a serial interface routine, and change the step table to contain the correct sequences to control the stepper motor.

The program will be available here when it's finished..