Hi again Darren,
I never had any problem with the motors going too slow! There may be hardware differences between our setups. The little CNC machine I made used two 200 step 5.25" floppy drive motors in an electronic gearing configuration. Each motor used a "Ramsey" hobby-kit stepper motor board, capable of 500mA. I don't remember the chip, but to get the motor to move required two things - first, the chip's ENABLE line was taken high and left there. The chip then had more logic options - one line was half/full step; another was CW/CCW. Finally, to actually make the motor take a step, I took a CLOCK line high, then low. The act of toggling the clock line actuated the chip and thus the stepper.
It seemed that the chip was quite fast... I did not have to "hold" the CLOCK high for any length of time, simply cycling the clock high/low did the trick.
'Where bit 4 is the clock
'Take CLOCK high:
Result = Out (Addr, 1111 0000)
'Take CLOCK Low:
Result = Out (Addr, 1110 0000)
These two lines back to back would step the motor. I was using VB6, compiled, not interpreted. The speed of the motor was regulated then by whatever software delays I created between CLOCK pulses. I found to my irritation that a standard timer control was too slow, and without using the Win32 API, just wanting to get the project done, I executed a nested FOR:NEXT loop, varying the duration of the loop. This worked great on an old Pentium 2 computer. Of course, when I moved the software to a 2.6 gig P4, the motors screamed and lost steps!
I rewrote the code, using handy CONSTs to better time the system. It ultimately worked out OK.
You sound like a fairly advanced
VB guy... if you haven't done so already, I would recommend creating a TYPE variable, something like so:
Type MotorVar
Name As String * 32 'User Definable name
PosAbsolute As Long 'Absolute Motor Position
PosRelative As Long 'Relative Motor Position
Target As Long 'Target Position
StepType As Long 'Half or full step
Direction As Long 'FORWARD or REVERSE
Delay As Long 'Looping Delay for motor
Slope As Long 'Ramp, higher = slower
SlopeReg As Long 'Temp math register
BitPattern(0 To 1) As Integer 'Value written to PortAddr
End Type
It makes dealing with the motors MUCH easier overall.
This has been a lengthy post... I don't know if I've been much help. If you'd like, PM me and I will send you the whole project, saved for VB6. The code is well commented and decently structured. There may be some tidbits that might be of use, especially the ramping aspects which were pretty tough.
Again, Good luck!
Swede