Thursday, January 7, 2010

Motor Lockout and Timer

I need a remote box to control the RPM of a 20 HP rotor.
Since, the AC Drive provides 90% of the work, the remote box is a pretty easy task.

It has 4 parts:
10-turn rotary potentiometer - vary rotor speed from 0-12000RPM,
Kill switch - big red button that cuts power to the motor if something goes wrong
Something ALWAYS goes wrong
Enable switch - small button that lets command from the AC Drive go to the motor
Lock out - timer that makes sure the command from the AC Drive is zero before letting you use the Enable switch

The diagram is shown below:

The red lines S1, Sc:
If S1 is connected to Sc, then the Drive commands reach the motor.
Ultimately, the circuit will connect S1 to Sc if Enable switch is hit.

Av, A1, Ac:
10-turn pot to control RPM.
This is a basic voltage divider; the Drive senses the reference voltage (Av) compared to A1.

Enable Switch and Panic Button:
The yellow block is a 3PDT 5V relay.
When the coil is energized by pressing the Enable button:
Pole 1 connects the main coil to 5V. Thus the coil stays energized after the Enable button is released.
Pole 2 connects S1 to Sc.
Pole 3 energizes the Green LED.

When the Panic button (normally closed) is pressed, it breaks the circuit and opens the coil.

Once the circuit is enabled, the Panic button is the only way to kill it.

The key is that NOTHING happens if the lockout transistor (NPN) is not energized by the output of the Safety Lockout. This transistor acts as a normally-open switch.

Safety Lockout:
This is borrowed in whole from, "retriggerable monostable timer"

The input signal is an RPM pulse train (0-10V), this goes through a voltage divider (0-5V), and an inverter (the monostable likes HI inputs).

The 555 timer is used to create a monostable timer.
The output (pin 3, green line) goes HI when the input (pin 2) has a falling edge.
Output is HI for 15 seconds (1.1*900K Ohms*15microF).
Red LED turns on to indicate Output is HI.

Basically, if there is a pulse train coming in, then the output goes HI for 15 seconds and stops you from enabling the relay. ( If it is already enabled, then there is no effect.)
The problem is that the 15 seconds starts from the first falling edge; additional pulses don't reset the timer.
Enter the "retrigger transistor"
Every time the input is LO (PNP) the capacitor is discharged and must slowly recharge.
This resets the 15-second timer after each pulse.

The actual circuit wired up on the bread board is shown below.
The rightmost button would be replaced by the RPM pulse train.
The center button would be replaced by a "normally closed switch"
And the left LED should be GREEN.

Tuesday, January 5, 2010

Bipolar Stepper Motor circuit

So about 5 years ago, a coworker was going to teach me electronics.
Starting with something simple: stepper motor controller.

List in hand, I bought diodes, resistors, and power MOSFETs. I scavenged a stepper from an old printer. And left in all in a drawer for 5 years.

Finally, I pulled it out of the drawer and started working on it.

The stepper motor turned out to be Bipolar Stepper Motor with 4 wires: 2 independent coils.

The drive circuit is basically an H-Bridge. This allows a low power/low voltage controller (like a PIC) to drive a high current/high voltage (1A @ 12-24V).


So I had a lot of trouble figuring out that the Source pin goes to low voltage (source of electrons) and the Drain pin goes to high voltage (absorbs electrons). Basic electricity, but it still took me a while.

Most of the circuits used transistors in lieu of MOSFETs or to control on/off ahead of MOSFETs. Eventually I found a simplified diagram using just MOSFETs.

Basic diagram:

Layout for breadboard:

My actual breadboard:

Of course all of this already exists in a simple IC, L293D Dual H-Bridge. Although, I suppose my set up can handle more current, the 16 pin IC is very clean.