Some curve stepper motor steering C-programs for plotters ========================================================== and milling machines with the PCI-DIO24 digital I/O card ======================================================== Document version 1.01 First version: 2017-11-10 Latest update: 2017-11-11 By: Stefan Spännare, Lund Sweden Email: stefan.sp@outlook.com Home page: http://www.spaennare.se Project web page: http://www.spaennare.se/techproj/tmplotter.html ======================================================================= Contents: 1. Introduction 2. PCI-DIO24 I/O card installation and setup 3. Hardware setup and stepper motor drives signal connection 4. Plotter or milling machine stepper motor aspect ratio calibration 5. How to run the computer programs 6. Links and references 1. Introduction =============== This document is under construction. This is only a brief users guide. At present C-programs for plotting or millig a (possibly elliptical) spiral and a Dragon curve of arbitrary order. Programs for the Cocoon curve and Lorenz attractor will come soon. Lorenz curve might have some problems for steering stepper motors due to it's fast chaotic behavior. Treadmills (se my web page) and old digital typing machines can quite easily be converted to use as plotters with these computer programs. 2. PCI-DIO24 I/O card installation and setup ============================================ It is asumed that you have a desktop computer (PC) with Windows XP (or higher) with PCI slot and a PCI-DIO24 digital I/O card. 1. Install the software and driver for the I/O card that comes on CD/DVD with the board. 2. Turn of your computer and carefully put the PCI-DIO24 I/O card into a PCI slot. 3. Turn on the computer again and run the Instacal program under Start/Programs/Measurements to activate the I/O card at Port 0. 4. Run the I/O card test with the Instacal program. If it passes the test the I/O card is now ready for use. 3. Hardware setup and stepper motor drives signal connection ============================================================ The PCI-DIO24 I/O card has three 8-bit digital I/O-ports with +5V logic. Each pin can rise or sinc around 2 mA. If your stepper motor drives has opto coupler inputs +5V driver circuits must be used in between. I use six TC428CPA MOSFET drivers for this purpose. They are fast, works perfekt at 5V, and can deliver transient currents of several 100 mA. However many other good such drivers are available and they are cheap. The stepper motor drives are connected to Port A of the PCI-DIO24 card with the following pins at the 37-pin D-SUB connector of it. Pin 19: Signal ground. Pin 37: Stepper motor 1 clock/step. Pin 36: Stepper motor 1 dir cw/ccw. Pin 35: Stepper motor 1 enable (active high). Pin 34: Stepper motor 2 clock/step. Pin 33: Stepper motor 2 dir cw/ccw. Pin 32: Stepper motor 2 enable (active high). 4. Plotter or milling machine stepper motor aspect ratio calibration ==================================================================== This step is very important. The computer programs are run in a console window under Windows. Right click on the mapp with the programs and press shift at the same time. Then choose Command promt at the pop up menu. First run the program zeroio.exe that sets all output pins of port A in the I/O card to zero. Otherwhise the signals to the stepper motor drives can fluctuate att high frequencies. Note, don't turn on the power to the stepper motor drives before you have run this program! Then run the small program tgb.exe that runs the stepper motors 100 steps at the time manuvred from the keyboard. Follow the short instructions in the program wich keys to use. If both stepper motors moves everything is ok. The C computer programs use a short file called "stepcfg2.txt" that contains information for setting upp aspect ratio for the machine and start directions for the stepper motors. If you know that your machine moves 1.0 mm for 200 steps of the stepper motors you can simply type these two lines in the file: 200 1.0 1 200 1.0 1 or 200 1.0 0 200 1.0 0 depending on your start direction of your stepper motors. Otherwise run the program tgb.exe again and run the stepper motors so the machine moves at least 50 mm in each direction. See with the programs how many stepper motor steps this is in each direction. Of course no milling tool should be used when this is done! It can be dangerous. If you have a plotter you can simply plot a line. If for example stepper motor 1 moves 75 mm for 2800 steps and stepper motor 2 moves 56 mm for 4000 steps type the following lines into the stepcfg2.txt file. As ussual the start direction can be either 0 or 1. 2800 75.0 1 4000 56.0 1 5. How to run the computer programs. ==================================== As ususual first run the program zeroio.exe that sets all output pins of port A in the I/O card to zero. Otherwhise the signals to the stepper motor drives can fluctuate att high frequencies. Note, don't turn on the power to the stepper motor drives before you have run this program! The computer programs have quite self explonatory input and output and do not start before you ask them to do so. The delay of the stepper motor stepping is a loop that depends on the speed of the computer. Use a small curve and a high value of the stepper motor delay the first times you run the programs. It can be wise to have the delay >= 1000. It is a good idea to start first with the "plotspiral.exe" program that plots or milles a spiral going outwards from the center. The plotdragon.exe program (that plots or mills a Dragon curve) is more difficult to adjust because it doesn't start in the middle of the curve or paper. Start with a small curve for example of order 5. Especially for milling machines high curve orders can not be used. Happy milling or plotting! 6. References ============= http:/www.jor.se A place to buy the PCI-DIO24 I/O card in Sweden. To be updated. ================================================================= End of document.