Control an ac motor using parallel port in visual basic

A

Thread Starter

Anonymous

I need some help controlling the motor using vb and it must be controlled with parallel port. it needs to move clockwise in one button and counterclockwise in another button. the last button is to halt the motors movement.. if homing is possible it will be an advantage. any help and guidance is greatly appreciated... thanks.
 
C

Curt Wuollet

Look at relay cards available from Jameco, MPJA and other electronics retailers. Once you have a relay card this becomes simply a matter of interfacing to an AC Drive. Most will have these functions available. Most of the cards come with example programs which are mostly VB these days. KB makes economical drives for small 3PH motors. Altermately you can use the relay card to switch windings in a single phase reversable motor. Here you might need to drive bigger relays (contactors).

Regards cww
 
B

Baltasar Bassol

I´d like to know what motor you are using. For standard AC motors the solution is usually with relays as you have been suggested by Curt.

If it is possible to replace the motor by a brush DC motor you can also control speed by using a diode bridge and a triac.

The printer port of any modern PC has a bidirectional 8 bit port (depending on how it is configured), 4 bits available for output and 5 bits available for input. For a full description of this ports check the notes in the net or a good book like the PC PROGRAMMER´S BIBLE by Peter Norton.

Although I do most of my programming in assembler I´m sure it can be done in other languages as long as you restrict your program to no more than Windows 9X. I read somewhere that the newer Windows versions do not allow direct access to the ports but I have not confirmed it.

For my systems I use a small circuit board connected to the printer port. In my programs I use one input bit to read one half of an LM358 configured as a comparator looking for the zero crossing of an AC signal, usually a transformer with a diode bridge powered from the same line driving the motor. A timing loop in the program measures the width of the zero crossing pulse and the width of the available period for powering the motor. The available period is divided by the number of bits of resolution I need. In fact the timing loop sampling frecuency is defined by the number of bits of resolution. After all that it is a matter of waiting for the zero crossing pulse to finish. Then you start a timer using the measured values and then use one of the available output bits to trigger the triac. I use one BC548 or BC558 as buffer depending on the bit used (some are logically inverted in the port) and a MOC3011 to isolate the PC from the power.

It is not recommended to trigger the triac at the point where the motor is required to run. You must give an acceleration ramp. To do this you must write the procedure to take care of this by starting the timing count at the value defined by the length of the available powering period (for zero speed) and then reduce the count by certain amount at predetermined intervals until you reach the desired speed.

The second half of the LM358 is also configured as a comparator. One input comes from the tachogenerator I use with the motor and the other input comes from my reference. Usually a DAC circuit driven by the same port or an averaging circuit (RC) driven by another output bit.
Once the accelerating ramp finishes another procedure takes over reading that comparator. If the feedback speed is less than the desired speed the motor will be accelerated. If it is faster then the motor is decelerated. No PID is required but the speed adjustment must be limited and an acceleration factor must be included so that the motor speed does not oscilate.

I hope my english is good enough to make it understandable.

If I can be of help let me know.
 
Is there a simple solution to bidirectional control DC motor without relays? Is there any way to paste link to schematics of solution with diode bridge and triac?
Or be so kind and send me any additional info on [email protected]

I am good in programing, but new in electronics...

Thank you
 
Top