Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Controlling Motor With Computer

Status
Not open for further replies.

Noochstyle

Electrical
Jun 5, 2003
1
0
0
US
Does anyone know if I can use visual basic to regulate the voltage that comes through pins on a serial port I just want one pin to be ground and the others to be basically funtion generators. I want them to output some voltage that I can control... Any ideas?

~Noochstyle
 
Replies continue below

Recommended for you

The serial port generally will only have perhaps two outputs that you can control; the serial output itself and the serial handshake.

You might be able to do what you want on the parallel port. The parallel port has at least 8 outputs that you can control.

TTFN
 
I agree with IRstuff about the serial port, the parallel port is much more usable. The serial port transmits a series of pulses down one wire and receives a series of pulses on another wire. So you would need to convert these from serial to parallel or vice-versa before you used them.
There's also a lot of other stuff you need to do - setting Start Bits, Stop Bits, Parity etc. It's usually not worth the effort.

A quick search on Google will get you more information about using the parallel port but only try this stuff on an old computer that you can afford to break! Also, the latest computers have "enhanced" printer ports - these may not work at all and I think some (newer) operating systems try to stop you accessing the ports directly.

See the following for an example of what is available...
 
It is possible to use either serial or parallel port:
The parallel port may even be shared between the printer
and the controlled circuit.

You regulate the voltade using DAC -- Digital - Analog Converter. Some you can control with two pins/lines
or even one, with additional logic.

<nbucska@pcperipherals.com>
 
As nbucska stated above, it is possible to use either the serial or the parallel port. If you look up serial ports (either on the net or in a decent reference book) you can find out what lines (pins) are inputs and what lines are outputs. Any input line can be read from and any output line can be written to using the appropriate software, no matter what the line or pin is called.

However, if you are hoping to write a Windoze program then you will probably need to learn something like C++ and how to write DLL files because any Operating System like NT,2000 or XP will not allow an application to interact directly with hardware (9x systems may allow some kind of access).

Other options include building external hardware to process 'normal' serial data to achieve what you want, or be satisfied with programming and using plain DOS (not under Windoze).

It may be easier to use the parallel port. Decoding parallel ASCII can be done quite easily and could be controlled using a Windoze application that simply printed to a 'Generic / Text Only' printer. If the size of a parallel cable and/or cable length limitations were a problem, you could use a USB-to-Parallel adapter cable. This would effectively give you a serial connection and be relatively easy to write software (that would run under Windoze or DOS) for.


 
The parallel port is magnitude of order faster and easier
to program -- and you can use two internal timers with
a few microsec. resolution.

<nbucska@pcperipherals.com>
 
Could set up software pwm generators that you connect to an rc network to generate a voltage at the outside for the motors/whatever...or just use the pwm output directly...easier and safer on motors than varying the voltage (i'm assuming you're wanting to change the speed right?).

 
Status
Not open for further replies.
Back
Top