|
![]() |
This document is
intended to provide basic yet complete informations to the guy who wants to control up to
eight servo motors with one LPT (printer) port. Soldering ability is needed, and some
programming skills are needed, although full exe and source is provided for free. This little project could be used by teachers, as it is quite simple and cheap. With this, you can control 8 independent axis (!) and so build a good robot. You should use a PC running win95 with Delphi 3.0. But any other computer with precise timer should do the job. The programming tool used here is Delphi 3.0 (turbo Pascal + windows + object oriented programming) because it's easy and quite as powerful as C. The cost of this project is max 1$ (wires...) without any servo... |
1. Introduction, remarks. | a positive alimentation (5V) often RED | |
| A ground (0V) often black or white :>( | |
| a data line often brown or violet or... |
You need to give them permanent power. Is so, they will stay in one position. To unlock them, turn the power off. To control the arm's position, you need to send , every 20Msec (no critical) a pulse of 1.5 -> 2 Msec length. The length of the signal gives the position of the arm. Sending this signal is exactly what a computer can do. But the most complicated task is to set up a high-res timer (1/100 Msec). Windows provides all the API needed to do so. We'll use the // port of the PC to control up to 8 motors (1 motor for 1 data line)
2. The electronic You simply have to connect all the grounds and +5V together, and each motor's data line to the LPT port data output. The LPT data lines are pins 2 to 10.
There are no buffer or transistors. You can safely omit them if you are using standard servo. Keep in mind that the computer needs only to control the servo's, through the data line, and that he doesn't need to power them.
3.1 A basic soft (with Delphi 3.0)
No need to break your head against the walls, we only have to make a good delay routine, and a good LPT control routine. Some assembly needed, as win32 doesn't allow direct outputs controls.
We simply create a timer which sends a signal every 20 Msec of a length between 1.5 and 2 Msec.
This soft is not available for downloading because it's not very useful and because I've lost it. You'd better download the full version...
3.2 The full version (also with Delphi)
This one can control up to 4 servo's (upgradable to 8) with the mouse or a joystick. You can program difference steps and save them in a text file.
It's not very useful to add a lot of comments, see the source for details...
| servosource.zip (17k) : the Delphi 3.0 sources | |
| servo.zip(162k) : the compiled version (win32 .exe) |
Branchez tout le bazar et lancez le programme de base:
|
Je vous propose dès maintenant un
service de création de pages Internet à très bon prix. Visitez le site "Clair et Net" pour
vous en convaincre. This site has been created by Philippe Jadin. Contact me for any information Cette page a été créée par Philippe Jadin. Contactez-moi pour toute information complémentaire
|