![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| OpenSource Software For the Discussion of Opensource CAD/CAM and NC shareware software etc) |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
| How to code a step motor axis move? Hi! I'd like to code a program that simply rotate a stepper motor in a direction and in the opposite using the lpt interface. I know I need to give a square waveform for every step and a square waveform for the direction (or nothing for the opposite direction) but I don't know the timings/frequency for each one and for each step how much the signal should be in high state and low state, can you help me? For example, my motor is 200 step/seconds so the frequency of the step signal should be 0,005 seconds but in this time which is the % of high state and lower state? Thanks in advance! |
|
#2
| |||
| |||
| Make a variable that you can adjust to control the pulse width. The speed of different cpu's will effect the speed of the data string out.
__________________ www.bigbearcnc.com |
|
#3
| |||
| |||
|
#4
| |||
| |||
| I am doing a simple setup with a parallel port for a motor at the moment. I will do it in fortran or c. But I didn't have a dos complier on the laptop I was going to use , well i didn't think it had but it seems to have qbasic on it so I have had the motor running unipolar with qbasic it's a simple as.. out 888,[first step] out 888,[first step, and second step] out 888,[second step] out 888,[second step, third step] out 888,[third step] out 888,[third step, fourth step] out 888,[fourth step] out 888,[fourth step, first step] 888 is lpt1[378h] look up 'parallel port qbasic' I had the above in a loop with a couple of nested delay loops wasting time between steps .. not pretty but I had the motor spinnning within a few minutes of turning the laptop on.. Once you have seen it working it's pretty simple.. I am not sure if i shoud stick with unipolar, or go bipolar. For testing I have 4 IRF540 fets bolted to an old bike swinging arm[well it was the only 'heatsink' in my junk] and am running the motor off car batteries with 2 car ballast resistors to limit the current. I have just cobbled together an old printer lead with some LED's for testing.. Last edited by integerspin; 08-13-2007 at 11:51 PM. Reason: spelling |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |