Apologies, I got so excited about the S0 behaviour that I never tested
actually turning the spindle. Naturally the stepgen enable pin needs to
be tied to something other than the brake.

# ################
# Spindle [3]
# ################

newsig spindle-enable bit
sets spindle-enable FALSE

# spindle wiring
net spindle-enable              <= motion.spindle-brake
net spindle-enable              => bb_gpio.p8.out-37
net spindle-velocity            <= motion.spindle-speed-out-rps
net spindle-velocity            => hpg.stepgen.03.velocity-cmd
setp hpg.stepgen.03.dirpin      835
setp hpg.stepgen.03.enable        1
setp bb_gpio.p8.out-37.invert     1

# timing parameters
setp hpg.stepgen.03.dirsetup        [SPINDLE]DIRSETUP
setp hpg.stepgen.03.dirhold         [SPINDLE]DIRHOLD

setp hpg.stepgen.03.steplen         [SPINDLE]STEPLEN
setp hpg.stepgen.03.stepspace       [SPINDLE]STEPSPACE

setp hpg.stepgen.03.position-scale  [SPINDLE]SCALE

setp hpg.stepgen.03.maxvel          [SPINDLE]STEPGEN_MAX_VEL
setp hpg.stepgen.03.maxaccel        [SPINDLE]STEPGEN_MAX_ACC

setp hpg.stepgen.03.control-type     1
setp hpg.stepgen.03.steppin        833


On Sat, 18 Jul 2020 17:31:07 -0700
markus <[email protected]> wrote:

> Hi John,
> 
> motion.spindle_brake - genius! Tried it out and it does exactly how I
> wanted it. BTW, break signal seems to be active when machine is
> off/e-stop.
> 
> Adapted spindle section below. Now I just need to add in a ramp down,
> the servo takes the stop a bit too seriously for my taste ;)
> 
> Thanks a lot!
> Markus
> 
> 
> # ################
> # Spindle [3]
> # ################
> 
> newsig spindle-enable bit
> sets spindle-enable FALSE
> 
> # spindle wiring
> net spindle-enable              <= motion.spindle-brake
> net spindle-enable              => bb_gpio.p8.out-37
> net spindle-enable              => hpg.stepgen.03.enable
> net spindle-velocity            <= motion.spindle-speed-out-rps
> net spindle-velocity            => hpg.stepgen.03.velocity-cmd
> setp hpg.stepgen.03.dirpin      835
> setp bb_gpio.p8.out-37.invert     1
> 
> # timing parameters
> setp hpg.stepgen.03.dirsetup        [SPINDLE]DIRSETUP
> setp hpg.stepgen.03.dirhold         [SPINDLE]DIRHOLD
> 
> setp hpg.stepgen.03.steplen         [SPINDLE]STEPLEN
> setp hpg.stepgen.03.stepspace       [SPINDLE]STEPSPACE
> 
> setp hpg.stepgen.03.position-scale  [SPINDLE]SCALE
> 
> setp hpg.stepgen.03.maxvel          [SPINDLE]STEPGEN_MAX_VEL
> setp hpg.stepgen.03.maxaccel        [SPINDLE]STEPGEN_MAX_ACC
> 
> setp hpg.stepgen.03.control-type     1
> setp hpg.stepgen.03.steppin        833
> 
> 
> 
> On Sat, 18 Jul 2020 16:41:22 -0700
> "John Dammeyer" <[email protected]> wrote:
> 
> > Hi Markus,
> > I've been mulling over the same thing with my new Spindle Servo
> > that's currently running PWM but will eventually be switched over to
> > Step/Dir.
> > 
> > The enable to it is the same one to all the other servos and stepper
> > drive.  
> > 
> > What I was thinking of doing was using the compliment of the brake
> > signal to gate the enable to the drive.  While the BRAKE is ON the
> > ENABLE is OFF.  Set RPM to 0 without an M5 and the BRAKE doesn't
> > come ON and the spindle is still held in position by the servo.
> > Issue an M5 and the brake is ON which shuts off the ENABLE.  An M3
> > with any Sxxx will disable the BRAKE and setting the ENABLE ON. 
> > 
> > In either case I still have to bring out a separate output to the
> > servo enable rather than the common output to all the drives.  And
> > with that said it would be possible to just use the BRAKE as the
> > servo enable. I suspect BRAKE is not asserted during ESTOP so the
> > spindle would continue to spin.  Not a good thing.
> > 
> > John Dammeyer
> >   
> > > -----Original Message-----
> > > From: [email protected]
> > > [mailto:[email protected]] On Behalf Of markus Sent:
> > > July-18-20 2:53 PM To: justin White
> > > Cc: Machinekit
> > > Subject: Re: [Machinekit] question about motion.spindle-on
> > > 
> > > Sorry for my sloppy terminology. My servo has 3 input pins,
> > > enable/step/dir. If enable is asserted it holds the position,
> > > otherwise the shaft can be turned freely. Which is the behaviour I
> > > am looking for. I want the spindle to not be engaged for manual
> > > tool changes, touch offs and such. But then I want the spindle to
> > > hold its position for tightening the drawbar and things like that,
> > > kinda like a poor man's version of a spindle lock.
> > > 
> > > Unfortunately the pin motion.spindle-on does not assert just
> > > because I issue a M3 or M4 command, it also requires S to be non
> > > 0. This is the behaviour I see on the oscilloscope which is not
> > > good because I need the enable pin of the servo to be asserted
> > > for it to hold its position.
> > > 
> > > Hope this makes more sense.
> > > 
> > > 
> > > On Sat, 18 Jul 2020 17:11:20 -0400
> > > justin White <[email protected]> wrote:
> > >     
> > > > motion.spindle-on is a pin, "spindle-enable" is your signal.
> > > >
> > > > You don't need to trip the "....stepgen.NN.enable" pin to have a
> > > > step/direction servo hold position, you just stop sending it
> > > > pulses which "m3 s0" should do with no further interaction.
> > > > disabling the stepgen does not cause the servo to go limp
> > > > because the drive should be setup in position mode and stepgen
> > > > only sends steps to alter position. Holding a position is
> > > > always assumed in position mode servos.
> > > >
> > > > What may be happening that you didn't mention is that when you
> > > > enter M3 S0 it trips the motion.spindle-on pin and since it is
> > > > connected to the stepgen.enable pin it may be causing your drive
> > > > to fault out. If your spindle is at speed and you immediately
> > > > disable the stepgen there is no (de)accelleration curve and your
> > > > drive may fault.
> > > >
> > > > Otherwise you can connect the stepgen.enable to
> > > > "motion.motion-enabled" or motion.power-on(or something like
> > > > that) depending on how you want it to work.
> > > >
> > > > On Sat, Jul 18, 2020 at 12:08 PM markus <[email protected]> wrote:
> > > >    
> > > > > I replaced my spindle with a servo motor and was hoping to use
> > > > > "M3 S0" to hold the current position of the spindle. The
> > > > > signal "motion.spindle-on" however only asserts if S>0, when
> > > > > S==0 the signal is not asserted.
> > > > >
> > > > > Is there a different signal I could use? Should this work?
> > > > >
> > > > > Thanks in advance,
> > > > > Markus
> > > > >
> > > > > ...
> > > > > # ################
> > > > > # Spindle [3]
> > > > > # ################
> > > > >
> > > > > newsig spindle-enable bit
> > > > > sets spindle-enable FALSE
> > > > >
> > > > > # spindle wiring
> > > > > net spindle-enable              <= motion.spindle-on
> > > > > net spindle-enable              => bb_gpio.p8.out-37
> > > > > net spindle-enable              => hpg.stepgen.03.enable
> > > > > net spindle-velocity            <=
> > > > > motion.spindle-speed-out-rps net spindle-velocity
> > > > > => hpg.stepgen.03.velocity-cmd
> > > > >
> > > > > setp hpg.stepgen.03.control-type     1
> > > > > setp hpg.stepgen.03.steppin        833
> > > > > setp hpg.stepgen.03.dirpin         835
> > > > >
> > > > > # timing parameters
> > > > > setp hpg.stepgen.03.dirsetup        [SPINDLE]DIRSETUP
> > > > > setp hpg.stepgen.03.dirhold         [SPINDLE]DIRHOLD
> > > > >
> > > > > setp hpg.stepgen.03.steplen         [SPINDLE]STEPLEN
> > > > > setp hpg.stepgen.03.stepspace       [SPINDLE]STEPSPACE
> > > > >
> > > > > setp hpg.stepgen.03.position-scale  [SPINDLE]SCALE
> > > > >
> > > > > setp hpg.stepgen.03.maxvel          [SPINDLE]STEPGEN_MAX_VEL
> > > > > setp hpg.stepgen.03.maxaccel        [SPINDLE]STEPGEN_MAX_ACC
> > > > >
> > > > > --
> > > > > website: http://www.machinekit.io blog:
> > > > > http://blog.machinekit.io github:
> > > > > https://github.com/machinekit ---
> > > > > You received this message because you are subscribed to the
> > > > > Google Groups "Machinekit" group.
> > > > > To unsubscribe from this group and stop receiving emails from
> > > > > it, send an email to [email protected].
> > > > > To view this discussion on the web visit
> > > > > https://groups.google.com/d/msgid/machinekit/20200716210622.1fcc780f%40yolanda
> > > > > .
> > > > >    
> > > 
> > > --
> > > website: http://www.machinekit.io blog: http://blog.machinekit.io
> > > github: https://github.com/machinekit ---
> > > You received this message because you are subscribed to the Google
> > > Groups "Machinekit" group. To unsubscribe from this group and stop
> > > receiving emails from it, send an email to
> > > [email protected]. To view this discussion
> > > on the web visit
> > > https://groups.google.com/d/msgid/machinekit/20200718145232.7b0800be%40yolanda.
> > >    
> >   
> 

-- 
website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
https://github.com/machinekit
--- 
You received this message because you are subscribed to the Google Groups 
"Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/machinekit/20200718174404.59267d48%40yolanda.

Reply via email to