>From the LinuxCNC manual I see an example :

loadrt pwmgen output_type=0
addf pwmgen.update servo-thread
addf pwmgen.make-pulses base-thread
net spindle-speed-cmd motion.spindle-speed-out => pwmgen.0.value
net spindle-on motion.spindle-on => pwmgen.0.enable
net spindle-pwm pwmgen.0.pwm => parport.0.pin-09-out
# Set the spindle's top speed in RPM
setp pwmgen.0.scale 1800


is this sufficient to get the spindle going ?



On Tue, 2017-02-21 at 11:26 -0500, Gene Heskett wrote:
> On Tuesday 21 February 2017 07:33:28 Valerio Bellizzomi wrote:
> 
> > Hello,
> > the SpinX1 manual says it acts like a potentiometer, the figure on
> > page C-13 of the VFD's manual shows the VIA contact to be connected to
> > an external potentiometer
> >
> > is that the right  way to connect the spinx1 ?
> 
> Yes, it has silk screened names. Its a totally isolated thing on the VFD 
> side. The vfd  should have a common, a nominally 12 volt plus source when 
> measured to the common.
> 
> The fwd and rev signals are separated by the spinx1, and generally on the 
> VFD side respond to a closure to this common to enable it to respond to 
> the voltage from the "arm" of the potentiometer.  On the computer side, 
> you will need to dedicate on pin of the BoB as an enable signal and wire
> it up in the hal file.
> 
> You will need, if using the mesa cards, something that faintly resembles 
> this to get the LCNC speed signal hooked to the spinx1:
> ##############################################################
> # Hook pwmgen.00 to the spindle speed and set for PDM output #
> ##############################################################
> setp    hm2_[HOSTMOT2](BOARD).0.pwmgen.00.scale         
> [SPINDLE_9]PWMGEN_S_SCALE
> setp    hm2_[HOSTMOT2](BOARD).0.pwmgen.pwm_frequency    
> [SPINDLE_9]PWMGEN_S_FREQ
> #setp   hm2_[HOSTMOT2](BOARD).0.pwmgen.pwm_freq         
> [SPINDLE_9]PWMGEN_S_FREQ
> setp    hm2_[HOSTMOT2](BOARD).0.pwmgen.00.output-type   
> [SPINDLE_9]PWMGEN_OUTPUT_TYPE
> setp    hm2_[HOSTMOT2](BOARD).0.pwmgen.pdm_frequency    
> [SPINDLE_9]PDMGEN_PDM_FREQUENCY
> 
> The data being referred in the right hand argument to needs assigned 
> in the [SPINDLE_9] section of your .ini file.
> 
> Now, I don't see below, what breakout you are using so I'll just copy and
> paste from my setup. Keep in mind that these will NOT match yours, but 
> will show you approximately what you need.
> First, setup the enable signal which in my case uses a gpio
> pin in my 7i90 card.
> 
> First, you need to set the output pins for all axis's used as inverting and 
> true low,
> 
> # Turn pulses to true low, opendrain so they are closures to ground.
> # stepgen 00
> setp hm2_[HOSTMOT2](BOARD).0.gpio.000.invert_output 1
> setp hm2_[HOSTMOT2](BOARD).0.gpio.000.is_opendrain 1
> setp hm2_[HOSTMOT2](BOARD).0.gpio.001.invert_output 1
> setp hm2_[HOSTMOT2](BOARD).0.gpio.001.is_opendrain 1
> # stepgen 01
> setp hm2_[HOSTMOT2](BOARD).0.gpio.002.invert_output 1
> setp hm2_[HOSTMOT2](BOARD).0.gpio.002.is_opendrain 1
> setp hm2_[HOSTMOT2](BOARD).0.gpio.003.invert_output 1
> setp hm2_[HOSTMOT2](BOARD).0.gpio.003.is_opendrain 1
> # stepgen 03
> setp hm2_[HOSTMOT2](BOARD).0.gpio.018.invert_output 1
> setp hm2_[HOSTMOT2](BOARD).0.gpio.018.is_opendrain 1
> setp hm2_[HOSTMOT2](BOARD).0.gpio.019.invert_output 1
> setp hm2_[HOSTMOT2](BOARD).0.gpio.019.is_opendrain 1
> 
> # the above gpio numbers correspond to the outputs of the canned
> code in the FPGA's installed firmware for the stepgens I use, and
> the PDM signal from the pwmgen module in the cards firmware.
> 
> And the reason I keep calling it PDM is that is a ditherless
> method of getting quite smooth speed signals from a basically
> digital circuit.  That is done as the modules are enabled in 
> the .ini file by a line grouping like this:
> 
> [SPINDLE_9]
> # 16.6 is close to 100 revs per click in low belt position
> PWMGEN_S_SCALE  = 16.6
> # make it run in PDM mode, is self smoothing then
> PWMGEN_S_FREQ           =       1
> PWMGEN_OUTPUT_TYPE      =       3
> PDMGEN_PDM_FREQUENCY            =       10000
> 
> # the SCALE above sets it to run the spindle at 100 rpm per
> click on the + button, when the backgear is not engaged and
> the belt is in the lowest speed grooves of the pulleys. All of 
> these settings are of course your personal choices. PDM_FREQUENCY
> is a balance between update rate and quantization of the speed change.
> A lower frequency is higher resolution but it should be fast enough
> so the motor speed doesn't ripple. 10000 is a good choice for me
> with my fake vfd..
> 
> sets emcmot.00.enable FALSE
> net emcmot.00.enable <= joint.0.amp-enable-out
> net emcmot.00.enable => hm2_[HOSTMOT2](BOARD).0.stepgen.03.enable
> Thats not all of that stuff, but you'll get the idea.
> 
> A gpio pin is an input unless told otherwise, and all signals
> are closures to ground, with 5 volts fed to the + terminals on
> the axis motor drivers, with your step/dirs connected to the - terminal
> on the drivers control plug.
> 
> #################################################################################
> # Setup vfd drive enable yadda yadda, building down from top down forward 
> first #
> # The SpinX1 only needs pwm and dir I thought, but needs an ena(ble) too.
> #################################################################################
> # start with SpinX1's dir which has to be converted to an output of the 
> correct polarity
> setp hm2_[HOSTMOT2](BOARD).0.gpio.071.is_output 1
> setp hm2_[HOSTMOT2](BOARD).0.gpio.071.invert_output 1
> setp hm2_[HOSTMOT2](BOARD).0.gpio.071.is_opendrain 1
> # this is the green jumper wire from the SpinX1's FWD, to 7i90-p3-47
> net reverse_vfd <= motion.spindle-reverse => 
> hm2_[HOSTMOT2](BOARD).0.gpio.071.out
> 
> # and the spinX1 does need an enable, so setup gpio.070 for that
> setp hm2_[HOSTMOT2](BOARD).0.gpio.070.is_output 1
> setp hm2_[HOSTMOT2](BOARD).0.gpio.070.invert_output 1
> setp hm2_[HOSTMOT2](BOARD).0.gpio.070.is_opendrain 1
> # net line moved to be combined with enable_vfd below
> net enable_vfd  <= motion.spindle-on
> net enable_vfd  => hm2_[HOSTMOT2](BOARD).0.pwmgen.00.enable
> net enable_vfd  => hm2_[HOSTMOT2](BOARD).0.gpio.070.out
> 
> The above demonstrates then when a "net" signal is defined, the next
> argument on that line becomes the source for that signal.  The next
> two lines show where that signal is to be sent.
> IF they are in the sequence shown, the => and <= gismo's are optional.
> 
> Currently, do NOT put a comment as a trailing #comment, put it on its 
> own line.
> 
> ###########################################################
> # make the vfd's pdm drive unidirectional, fwd/rev handles that #
> # but the SpinX1 needs a DIR, which is on P1-43
> ###########################################################
> net spindle-vel-cmd-rps  <=  motion.spindle-speed-out-rps 
> net spindle-vel-cmd-rps  =>  spindle-abs.in
> # this come out on P1-41 as the pulse Duration Modulated signal to the 
> SpinX1, red jumper
> net spindle-unispeed <= spindle-abs.out =>      
> hm2_[HOSTMOT2](BOARD).0.pwmgen.00.value
> 
> This is, without a doubt, incomplete, but with the halmeters help, you should 
> see whats missing.  Yell if the water is still rising. :)
> >
> > On Thu, 2017-02-16 at 08:56 -0800, Kirk Wallace wrote:
> > > On 02/16/2017 03:37 AM, Valerio Bellizzomi wrote:
> > > ... snip
> > >
> > > > the VFD is a Toshiba VFS15-4037PL-W, it has a Forward input, a
> > > > Reverse input, and a current speed input (and alternatively a
> > > > 0-10V input). There isn't an enable input. I do not need the
> > > > reverse so it should be two parallel pins, one for forward and one
> > > > for speed.
> > >
> > > ... snip
> > >
> > > I found a manual here:
> > > https://inverterdrive.com/file/Toshiba-VFS15-User-Manual
> > >
> > > I usually first check the overview graphic which seems to be on page
> > > B-4. I see the F terminal which could just be shorted to common to
> > > activate it. The speed potentiometer is shown too. PWM could
> > > simulate that. I also see theRS485 connector. I did a search in the
> > > document for "485" and found page C-4, which shows some control
> > > options; terminal (relay), keypad, RS485 (Modbus?), CAN (cool),
> > > communication(what the heck?). Just below are some speed setting
> > > options. This should be a nice VFD.
> > >
> > > A little farther down from B-4 are the I/O circuit options. Looking
> > > at the F entry, it basically says shorting the F terminal to CC will
> > > start forward rotation. You can use a parallel port pin to control a
> > > small solid state relay or opto-isolator. It just needs to tolerate
> > > 24 Volts on the output.
> > >
> > > It looks like the VIA (voltage, input, analog?) is a speed input.
> > > The same parallel port pin to solid state relay or opto-isolator as
> > > F above may be used, except it only needs 10 Volt tolerence.
> > > Terminal PP is the 10 Volt source (CC common isn't needed, most
> > > likely). The signal from the parallel port pin should use PWM or
> > > PDM.
> > >
> > > If you have a BOB (Break Out Board), post a make/model and/or
> > > picture or other information. It may be useful for the above
> > > connections.
> > >
> > > It looks like page D-3 is a good place to start VFD programing.
> > >
> > > The above may be wrong or missing some information, so study the
> > > manual and decide for yourself what to do. I would get a mains input
> > > noise filter right of the bat, so you don't have to chase down weird
> > > issues while trying to learn how to use your VFD. Hmm... It looks
> > > like your VFD already has a built-in noise filter.
> >
> > ----------------------------------------------------------------------
> >-------- Check out the vibrant tech community on one of the world's
> > most engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> > _______________________________________________
> > Emc-users mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/emc-users
> 
> 
> Cheers, Gene Heskett




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to