Quote Originally Posted by jolyonjenkins View Post
Hi

I have a cheap generic Chinese breakout board - like this https://www.ebay.co.uk/itm/333905827471
but it has no documentation and the listing is obscure.

It has a pin marked 0-10V PWM output, which is good - my CNC spindle controller board wants a variable DC voltage to control the spindle speed. However, I'm not at all clear how that variable voltage is produced. I'm using LinuxCNC, and the setting for the parallel port is that pin 16 is PWM output. I presume that LinuxCNC produces a high frequency square wave on pin 16, but I can't get my head round how the BOB knows that pin 16 is the one that controls the voltage on the PWM output. If if does ...
For the bob you are using you will have to put 12-24V on the centre two terminals ( near the relay) in order to get the 0-10V out as well. It also need the 12-24v for the inputs to work

I know this is not the same bob but it might give you a clue


# 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

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

# ---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--- on bob relay pin DB 17

setp hm2_7i92.0.gpio.024.is_output 1

net spindle-enable hm2_7i92.0.gpio.024.out
sets spindle-at-speed true

#Below sets position of relay contacts on power up
setp hm2_7i92.0.gpio.024.invert_output true

#PWM Generator signal/setup

setp hm2_7i92.0.pwmgen.pwm_frequency 1500

setp hm2_7i92.0.pwmgen.00.output-type 1
setp hm2_7i92.0.pwmgen.00.scale 5000
setp hm2_7i92.0.pwmgen.00.enable true

net spindle-speed motion.spindle-speed-out-abs hm2_7i92.0.pwmgen.00.value

############

It might be easier to make another stepconf junk config then copy from that junk hal file the bits you need.