OK Couldn't resist... #-------------------------------------------------------------------------------------------------------- # load real time a limit2 and a near with names so it is easier to follow loadrt limit2 names=spindle-ramp loadrt near names=spindle-at-speed
# add the functions to a thread addf spindle-ramp servo-thread addf spindle-at-speed servo-thread # set the parameter for max rate-of-change # (max spindle accel/decel in units per second) setp spindle-ramp.maxv 60 # hijack the spindle speed out and send it to spindle ramp in #net spindle-cmd <= motion.spindle-speed-out => spindle-ramp.in # the output of spindle ramp is sent to the scale in #net spindle-ramped <= spindle-ramp.out => scale.0.in # to know when to start the motion we send the near component # (named spindle-at-speed) to the spindle commanded speed from # the signal spindle-cmd and the actual spindle speed # provided your spindle can accelerate at the maxv setting. net spindle-cmd => spindle-at-speed.in1 net spindle-ramped => spindle-at-speed.in2 # the output from spindle-at-speed is sent to motion.spindle-at-speed # and when this is true motion will start #net spindle-ready <= spindle-at-speed.out => motion.spindle-at-speed #-------------------------------------------------------------------------------------------------------- I've commented out the 4 lines that cause it not to start. Not sure where the scale.0.in is from. I don't see it declared anywhere. Is that the display speed indicator? For the "motion." Parameters they are already applied later. So that needs to be changed. Here's the PWM stuff as it is currently configured. #-------------------------------------------------------------------------------------------------------- # PWM dir pin config setp hm2_7i92.0.gpio.005.is_output true net spindle-enable => hm2_7i92.0.pwmgen.00.enable net spindle-vel-cmd-rps => hm2_7i92.0.pwmgen.00.value net spindle-ccw => hm2_7i92.0.gpio.005.out # ---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 #-------------------------------------------------------------------------------------------------------- Not sure what I have to replace... The MESA uses spindle-vel-cmd-rps while the ramping uses spindle-vel-cmd-rpm And removing the net spindle-at-speed also doesn't work since then it's no longer declared. John > -----Original Message----- > From: andy pugh [mailto:[email protected]] > Sent: July-15-20 4:13 PM > To: Enhanced Machine Controller (EMC) > Subject: Re: [Emc-users] New Spindle working. > > On Thu, 16 Jul 2020 at 00:05, John Dammeyer <[email protected]> wrote: > > > > Unless I add stuff to the HAL file apparently there is no accel/deccel > > values that are applied to the PWM output to the spindle. > My scope tells me it goes from 10V to 0V in about 50mS. > > I remember talking about this on IRC, but can't remember who with. > It would be possible to ramp the spindle speed internally to LinuxCNC, > but it would break nearly all the spindle-at-speed setups out there. > (as the spindle would be permanently at commanded speed, but not at > the final speed). > > One answer would be to add a spindle-speed-limited pin. I will bear > this in mind if and when I get round to the plan of adding homing for > spindles too. > > > and some other stuff to hijack the values but so far that hasn't worked and > > LinuxCNC won't start. > > What's the error message? All that you posted looked OK, unless I am > scanning over the same error as you are. > > -- > atp > "A motorcycle is a bicycle with a pandemonium attachment and is > designed for the especial use of mechanical geniuses, daredevils and > lunatics." > � George Fitch, Atlanta Constitution Newspaper, 1912 > > > _______________________________________________ > Emc-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/emc-users _______________________________________________ Emc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-users
