Software Support > Automated Projects

Beginner's Guide (Inputs)

<< < (4/6) > >>

DaOld Man:
Your project is looking good. I will be following your progress.

Now, back to the beginners guide.
We have looked at using a DPDT (Double Pole Double Throw) switch as a simple reversing drive. This is about as simple as we can get. But if we want to do this thing automatically, we most certainly need an electronic drive.
Most drives that we would use do this with transistors.
You can think of a transistor as an electronic switch. (It is much more versatile than this, but for our purposes, we will think of it as a switch.)
There are basically two types of transistors that we will explore for this.
NPN and PNP. 

Each transistor has 3 poles (or connections). These are B for Base C for Collector and E for Emitter.
On an NPN transistor, when a small current flows from Emitter to Base, a larger current is allowed to flow from Emitter to Collector.
(Note, Im from old school, and I presume that current flows from negative to positive. Most newer thinking will show current flowing from positive to negative. I dont think it really matters which way you think, as long as it is consistent. So if you subscribe to the positive to negative theory, please just bear with me.)

So with the NPN, you can use a very small current to switch (or control) a much larger current.
You can imagine the transistor as a SPST (Single Pole Single Throw) switch.

The PNP is really the same, its just that the polarities are reversed. A small current flowing from base to emitter allows a large current to flow from collector to emitter.

One  thing you must keep in mind that the current flow on the base must be limited to a small current. This is usually done by a resistor. The current flow on the collector to emitter must be limited to the maximum amount of current the transistor can handle. This is usually done by the load (or in our case the motor).

Below is a diagram that shows NPN and PNP transistors. The drawing is not how the transistors really look, but rather symbols, which are usually much easier to draw than the actual device. The polarities (+ and -) are drawn to show how each transistor would normally connect to the current flow.
You probably already see how these can be used to replace real switches in our drive.

DaOld Man:
Ok here is the very basic theory behind an H drive.
In my demonstration Im using 4 NPN transistors.
To get the motor to turn forward, a small positive current is applied to the blue forward connector.
This turns on Q2 and Q3.
This allows high motor current to flow through Q3, through the motor from left to right, then through Q2. (The heavy blue arrows are the forward current flow.)

Now if you want to run the motor in reverse a small positive current is applied to the reverse connector.
This turns on Q1 and Q4. You can then follow the heavy red arrows to see that the motor current flows through Q4, through the motor from right to left, then through Q1. This reverses current flow through the motor thus reversing rotating direction.
This is a very basic drive and in practicality would not work in the real world, for instance what would happen if a positive current was applied to both forward and reverse at the same time?
Most H drives also use a combination of NPN and PNP transistors.

Now have you figured out yet why it is called a H drive?
Look at the just the 4 transistors and the motor in this diagram. resembles the letter H doesnt it?

DaOld Man:
How do you control the speed of the motor if it is turning too fast?
This can be done a few ways.
One way is through gearing the motor down through pulleys and belts or gears, so that the monitor disc turns slower than the motor shaft.
There are two distinct problems with this. It can be harder to build and more expensive than a rig with no gearing, and there is no variable control of the speed.
Most (but not all!) drives can control the speed of the motor by using PWM.
PWM (or Pulse Width Modulation) is the process of controlling motor speed by turning it off and on in pulses.
Think of it as a switch that you (the control) can turn off and on to turn the motor off and on.
While the switch is on, the motor is accelerating.
If you leave the switch on long enough, the motor will reach its top speed.
But when you turn the switch off, the motor decelerates, or slows down.
Turn the switch back on and the motor starts to accelerate again.
Between these on and off pulses, the average desired speed of the motor is determined.
Turn the switch on and off at different speeds and the motor speed will change accordingly.
An electronic drive does this very efficiently and can do it with much more precision and repetition than you could with a switch.

So, PWM is a repeating cycle of on and off pulses to supply an average power to the motor.
The pulses have an on time and an off time.
Varying these two time spans can allow you to arrive at a speed that is just right for your rig.

Relay drives cannot do PWM.

Yet another way to control the speed of the motor is to control the voltage to the motor. Decrease the voltage below the maximum of the motor, and the speed of the motor will decrease.
If you are using relays to control your motor, and you need speed control, then you may have to go the route of changing the voltage to the motor.

I have attached a very rudimentary diagram that basically explains PWM.

Please note that this method of speed control only works with a DC motor that has a rotating armature and brushes.

If you are using an AC motor or a stepper, then that requires a different beast of burden to control speed. (However the first above mentioned method of gears or pulleys should work with any motor).

DaOld Man:
What is dynamic braking?
It is the process of using the power generated by a motor while it is coasting to stop it quicker.
When the power is removed from a motor, it will not immediately stop. Because of inertia in the mechanics of the motor and the load it is driving, the motor will coast to a stop.
While the motor is coasting, it becomes a generator, actually "putting out" power.

This can be used to our advantage to stop the motor quicker.
If the motors leads are shorted together while it is coasting, it is putting a tremendous load on the motor, which is now a generator.
This increase in load will stop the motor quicker.
To test this, twist the shaft of your motor while the leads are not connected to anything.
Note how much strength you need to turn the shaft.
Now tie the motors leads together and try turning the shaft again.
You should notice that the shaft is much harder to turn, and the faster you turn it the harder it is to turn.
This is called dynamic braking.
It can bring the motor to a smooth and fast stop when the motor is turned off.

How do we implement dynamic braking?

If you use a simple on/off switch, you use a SPDT switch, and wire it so that when the switch is turned off it shorts the motor.
See the first attached drawing.

The second drawing shows how a diode can do dynamic braking. This illustration only works if the motor is never reversed. Why? Because when you reverse the current flow to the motor, the diode would short out the power supply.
Of course we reverse ours, so this would not work for us. However, some electronic drives use diodes to do dynamic braking in either direction, it just takes more than one.
Some drive designers refer to these diodes as "flyback diodes".
Flyback diodes also protect the transistors from back EMF in electronic drives.

Some electronic drives also switch on the both transistors in the top half or the bottom half of the H bridge.
This, along with flyback diodes, allows the current generated by the motor to flow through the transistors.
The drives usually do this by seeing both direction inputs turned on.
Some do it by seeing both directions on and enable on.
And some drives even automatically apply dynamic braking whenever neither direction input is turned on.
And still, some drives do not offer dynamic braking at all.
So, know your drive. Consult manufacturers instructions if you wish to use dynamic braking.

MRotate3 allows you to choose which method your drive uses for dynamic braking. You can also choose not to use it at all.
If your motor stops quick enough when told to do so, then dont use it.

DaOld Man:
With CRT monitors whenever the monitor turns, it will most likely need to be degaussed.
This is due to the earths magnetic field acting on the internals of the CRT tube. Search for degaussing and you will find tons of info, Im trying to keep these posts shorter so i wont get into the science of why the monitor does this.
But when a CRT needs degaussing, the colors are usually off, to the point where it is very noticeable.
Also, getting magnets too close to the screen can screw up the colors too, so be careful where you place the motor to turn it.
LCD monitors do not suffer from this, just CRTs (Cathode Ray Tubes).
But if you are using a CRT on your rig, you will need to consider how you are going to degauss it.
If your monitor has a degauss button on it, you can remove the cover and solder two wires to this pushbutton.
You can then bring these wires out of the monitor and attach them to a button that is easy to get to on the cabinet.
When the colors mess up, just press the button.
You can also buy a hand held degausser which is a coil that you run over the surface of the tube to degauss it.
But, who really wants to do that every time you rotate the monitor?

And some monitors have the degauss function hidden in an on screen menu. This really complicates things.
Now if you are electronically savvy, and can get a wiring schematic for your monitor, you can still go in and find the relay or transistor that turns on the monitor's degauss coil. Solder a couple of wires to this device and still be able to degauss it by pressing a button.
Just remember that the monitor's circuit has a delay timer that only allows the degauss to happen every so many minutes, to keep from burning up the degauss coil. You do not want to bypass this circuit.

Ok you have two wires that you can touch together to activate the degauss function, but this pushing a button every time really sucks. You want it automated!
This can be done by using a solid state relay to basically short these two wires together.
The relay's input ties back to the printer port and MRotate will activate this relay at the end of each rotation.
See the drawing below.

Sounds like a lot of trouble dont it?
Well there may be yet another way to do this.
Most CRT monitors automatically degauss on power up.
So turn your monitor off while it is rotating. When the rotation stops, monitor turns back on and degauss is activated.
MRotate can automatically turn off your monitor while it is rotating, and MRotate3 can cycle it off and on at end of rotation, in case you want to leave it on while rotating.
More on that in the next post.

Note: Some SSR's require that a current limiting resistor be connected to the input. Since the printer port is only good for around 10 ma, make sure you dont overload it. Check the power requirement on the input of the SSR. Voltage should be 5VDC, current no more than 10 ma.
Also, an opto isolator is a cheaper replacement for the SSR, and you can even use a regular relay, but you will have to use a transistor to switch it, due to the low power of the printer port output.



Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version