Progress report on the WIN-XP/MACH3 to LinuxCNC/7i92H conversion:

With six steppers declared:
loadrt hm2_eth board_ip="192.168.1.121" config=" num_encoders=0 num_pwmgens=0 
num_stepgens=6"

I have control of X,Y,Z and the rotary A.  Additionally a step motor instance 
is used as the charge pump on DB-25-17.  And the last stepper object is on the 
second parallel port creating the correct frequencies to run the Bergerda 1.8kW 
AC Servo up to 3000 RPM.  Still need to create an adaptor board to change the 
TTL into RS422 before I can actually turn the motor but that's a minor point.  
My Agilient programmable waveform generator shows the motor responds nicely all 
the way up to 3000 RPM.

But not everyone has a slick AC Servo for a spindle nor a second parallel port. 
 A VFD like a GS-1 that I have on my South Bend Lathe or a GS-2 that a friend 
has on his Bridgeport clone (run with MACH3) doesn't take step and direction.  
Instead PWM and a PWM to 0-10V signal converter is used.

For some reason I can't convince the pncconf to create a PWM instance with the 
7i92H.  Not sure why.   The 7i92H is programmed with the 7i92_C11Gx2D.pin 
configuration which puts a PWM out onto DB25-14.
14      1   IOPort       PWM              0        PWM             (Out)
And direction
16     5   IOPort       None           

So I can see I have to manually edit the hal file to have 
num_pwmgens=1

But what to do next?
Unfortunately http://linuxcnc.org/docs/html/config/pncconf.html doesn't help.  
At least nothing jumps out 

Instead this is my starting place.
http://linuxcnc.org/docs/html/man/man9/hostmot2.9.html#pwmgen

Here's the hal file information for the stepper based spindle.
I need the PWM allocated to DB25-14 (pin 1 on Mesa board) and the direction 
signal on DB25-16  (pin 5 on the message board)

 
# Step Gen signals/setup
The information needs to be replaced but the rest remains the same I believe.  
Here's what I think I need with PWM scale declared in the .ini file.

# PWM Gen signals/setup
setp   hm2_7i92.0.pwmgen.05.scale  [SPINDLE_9]PWM_SCALE
setp   hm2_7i92.0.pwmgen.05.output_type       1

net spindle-enable              =>  hm2_7i92.0.pwmgen.00.enable
net spindle-vel-cmd-rps         =>  hm2_7i92.0.pwmgen.00.value
net spindle-cw                  => hm2_7i92.0.gpio.005.out

Am I missing anything?  

Specifically if the S3000 command is read in G-Code then that has to be scaled 
by PWM Scale to be what?  As in what should PWM Scale be if the default PWM 
frequency is 20,000Hz.  Should it be 6.666667 to scale 3000 RPM to 20,000Hz?  
Or do we want to scale 3000 RPM down to a percentage by multiplying by 0.0333333
 
Is it really that simple?

Thanks
John


Here's the step gen spindle area.
#*******************
#  SPINDLE S
#*******************

setp   pid.s.Pgain     [SPINDLE_9]P
setp   pid.s.Igain     [SPINDLE_9]I
setp   pid.s.Dgain     [SPINDLE_9]D
setp   pid.s.bias      [SPINDLE_9]BIAS
setp   pid.s.FF0       [SPINDLE_9]FF0
setp   pid.s.FF1       [SPINDLE_9]FF1
setp   pid.s.FF2       [SPINDLE_9]FF2
setp   pid.s.deadband  [SPINDLE_9]DEADBAND
setp   pid.s.maxoutput [SPINDLE_9]MAX_OUTPUT
setp   pid.s.error-previous-target true
setp   pid.s.maxerror .0005

net spindle-index-enable  <=> pid.s.index-enable
net spindle-enable        =>  pid.s.enable
net spindle-vel-cmd-rpm   => pid.s.command
net spindle-vel-fb-rpm    => pid.s.feedback
net spindle-output        <=  pid.s.output

# Step Gen signals/setup
setp   hm2_7i92.0.stepgen.05.dirsetup        [SPINDLE_9]DIRSETUP
setp   hm2_7i92.0.stepgen.05.dirhold         [SPINDLE_9]DIRHOLD
setp   hm2_7i92.0.stepgen.05.steplen         [SPINDLE_9]STEPLEN
setp   hm2_7i92.0.stepgen.05.stepspace       [SPINDLE_9]STEPSPACE
setp   hm2_7i92.0.stepgen.05.position-scale  [SPINDLE_9]STEP_SCALE
setp   hm2_7i92.0.stepgen.05.step_type       0
setp   hm2_7i92.0.stepgen.05.control-type    1
setp   hm2_7i92.0.stepgen.05.maxaccel        [SPINDLE_9]MAX_ACCELERATION
setp   hm2_7i92.0.stepgen.05.maxvel          [SPINDLE_9]MAX_VELOCITY

# connection to the physical port.
net spindle-enable          =>  hm2_7i92.0.stepgen.05.enable
net spindle-vel-cmd-rps     =>  hm2_7i92.0.stepgen.05.velocity-cmd
net spindle-vel-fb-rps      <=  hm2_7i92.0.stepgen.05.velocity-fb

# ---setup spindle control signals---
net spindle-vel-cmd-rps        <=  motion.spindle-speed-out-rps
net spindle-vel-cmd-rps-abs    <=  motion.spindle-speed-out-rps-abs
net spindle-vel-cmd-rpm        <=  motion.spindle-speed-out
net spindle-vel-cmd-rpm-abs    <=  motion.spindle-speed-out-abs
net spindle-enable             <=  motion.spindle-on
net spindle-cw                 <=  motion.spindle-forward
net spindle-ccw                <=  motion.spindle-reverse
net spindle-brake              <=  motion.spindle-brake
net spindle-revs               =>  motion.spindle-revs
net spindle-at-speed           =>  motion.spindle-at-speed
net spindle-vel-fb-rps         =>  motion.spindle-speed-in
net spindle-index-enable      <=>  motion.spindle-index-enable

# ---Setup spindle at speed signals---

sets spindle-at-speed true




_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to