Thread: PWM output on CNC BOB
- 
	23-04-2021 #1Hi 
 
 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 ...
 
- 
	23-04-2021 #2For 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...Clive  
 The more you know, The better you know, How little you know
 
- 
	23-04-2021 #3Thanks. 
 But I don't think I've explained my confusion.
 Assume the bob has the 12v in. There will be a variable DC voltage on the PWM pin. That voltage is controlled by the frequency of a signal on one of the pins, generated by linuxcnc. I can use stepconf to assign the pin that produces the signal. But how does the bob know which pin to expect the on?
 
- 
	23-04-2021 #4You have to tell Lcnc which pin to send it to. 
 
 Can you post the config
 
 #### Spindle stuff ###
 
 net spindle-cmd-rpm => pwmgen.0.value
 net spindle-on <= spindle.0.on => pwmgen.0.enable
 net spindle-pwm <= pwmgen.0.pwm
 setp pwmgen.0.pwm-freq 100
 setp pwmgen.0.scale 1000
 setp pwmgen.0.offset 0.1
 
 setp pwmgen.0.dither-pwm true
 
 net spindle-cmd-rpm <= spindle.0.speed-out
 net spindle-cmd-rpm-abs <= spindle.0.speed-out-abs
 net spindle-cmd-rps <= spindle.0.speed-out-rps
 net spindle-cmd-rps-abs <= spindle.0.speed-out-rps-abs
 net spindle-at-speed => spindle.0.at-speed
 net spindle-cw <= spindle.0.forward
 
 ### Parport Pins ###
 setp parport.0.pin-01-out-invert 1
 net spindle-pwm => parport.0.pin-01-out These are the pins on the bob
 net spindle-cw => parport.0.pin-14-out
 net spindle-on => parport.0.pin-17-outLast edited by Clive S; 23-04-2021 at 03:34 PM. ..Clive  
 The more you know, The better you know, How little you know
 
- 
	23-04-2021 #5But how do I know which pin to send it to? I'm assuming that the bob is looking for a signal on a particular pin, which is determined by the hardware of the board. I don't have a problem with configuing Linuxcnc, but I don't see how I know which pin the board wants. I feel I am either missing some concept or being very stupid. 
 
- 
	23-04-2021 #6But how do I know which pin to send it to? I'm assuming that the bob is looking for a signal on a particular pin, which is determined by the hardware of the board. I don't have a problem with configuing Linuxcnc, but I don't see how I know which pin the board wants. I feel I am either missing some concept or being very stupid. 
 
- 
	24-04-2021 #7
 
- 
	24-04-2021 #8The BoB has a hard-wired interface from one of the discrete outputs (I have a similar board, that's silk-screened "P1 - PWM" - so pin 1 is assigned by hardware design to the PWM circuit. No configuration, no nothing (you could hack the card, of course). There's nothing clever, just assign the same output in LinuxCNC to the hardwired assignment on the board. 
 
 Most BoBs are similar.
 
- 
	24-04-2021 #9
 
- 
	24-04-2021 #10Hi 
 One thing to watch out for: check that your inverter to control the spindle is isolated from the mains that is to say the the 0 to 10v input is not at mains potential.. this should described in you manual for the inverter...
 could be serious risk of electrical shock and the magic smoke will appear...
 
 Best regards
 Paul
 
- 
    The Following User Says Thank You to Paul H For This Useful Post:
 
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
- 
  Question on Servo power output.By Zadig in forum General DiscussionReplies: 6Last Post: 24-08-2017, 01:13 PM
- 
  Output voltage from mains driver?By JW1977 in forum Motor Drivers & ControllersReplies: 8Last Post: 24-03-2017, 01:33 PM
- 
  Output direct to machineBy picyman in forum VectricReplies: 4Last Post: 16-02-2014, 11:04 PM
- 
  HPGL driver outputBy 2006Nobull in forum Computer SoftwareReplies: 6Last Post: 07-10-2012, 08:49 PM
- 
  2 Machines 1 Switch for the output - ConnectionsBy Ian Hart in forum General ElectronicsReplies: 7Last Post: 02-04-2010, 02:33 PM
 
                
 
						
					 
					
						 
		 
		 
 
				
				
				
					 Reply With Quote
  Reply With Quote 
		 
		 
 Originally Posted by jolyonjenkins
 Originally Posted by jolyonjenkins
					
 
		 
 
		
Bookmarks