''Index_Interface.spin {{ This step motor drive is tuned for a simple step & direction pulsed output for high current and voltage drives It will produce a modulated high frequency ramp up & down with a slewing plato on long drives You must use a drive that can produce 70 to 90 vdc output for the motors to be able to follow the higher frequency out puts The Z drive is tuned for a nema 42 motor drawing 6.3 amps & 400 resolution with a 10:1 gear ratio X & Y drives use nema 34 motors @3.5 amps & 2000 resolution with 3:1 gear ratio This combination will give a high resolution motion with fast movments to targets. You can only move one drive at a time but you can move them accuratly and fast with a simple adjusting ramp for speed adjustments. }} CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 OBJ com1: "FullDuplexSerialPlus" driver: "StepDriver" PUB Interface | pin, lowSp, ramp, rampInc, steps, dir, valueI, valueII com1.start(31, 30, 0, 57600) com1.rxflush com1.str(string("Ready", 10, 13, 10, 13)) 'waitcnt(1_000 + cnt) dira[0] := 1 lowSp := 80_000 '' 80_000 ramp := 1_000 '' 1_000 pin := com1.getdec '' output pin rampInc := com1.getdec '' values between 10 and 79 max slow ramp to fast ramp steps := com1.getdec '' values between 1 and 1,000,000 dir := com1.getdec '' 0 = normal rotation 1 = reverse rotation dir on pin zero if dir > 0 outa[0] := 1 ''rotation ccw else outa[0] := 0 ''rotation cw valueI := steps / 2 - 1 ''calculate ramp if valueI < 2 '' test ramp for min valueI := 2 if ramp > valueI '' made a long drive slew ramp := valueI if steps < 10 '' min steps driver can handle steps := 10 valueII := lowSp / ramp if rampInc > valueII rampInc := valueII - 10 driver.Start(pin, lowSp, ramp, rampInc, steps) Wait Pri Wait | bizy bizy := 0 repeat while bizy := 0 bizy := driver.done if bizy > 0 com1.str(string("Done", 10, 13, 10, 13)) reboot