Spindle speed variation ssv for chatter control

More
5 years 8 months ago #197689 by PCW
A _very_ minimal example:

loadrt siggen
addf siggen.0.update servo thread

setp siggen.0.frequency 1 # 1 Hz
setp siggen.0.amplitude 50 # +-50 RPM

net spindle-speed => siggen.0.offset
net mod_spindle_speed <= siggen.0.sine
net mod_spindle_speed => your-spindle-hardware-speed-pin

Please Log in to join the conversation.

More
5 years 8 months ago #197705 by rodw
I started to look at this but PCW has done it already. If you read the docs
linuxcnc.org/docs/devel/html/man/man9/siggen.9.html
and review what each pin does will clarify what is happening.

Please Log in to join the conversation.

More
5 years 8 months ago #197722 by robertspark

PCW wrote: A _very_ minimal example:

loadrt siggen
addf siggen.0.update servo thread

setp siggen.0.frequency 1 # 1 Hz
setp siggen.0.amplitude 50 # +-50 RPM

net spindle-speed => siggen.0.offset
net mod_spindle_speed <= siggen.0.sine
net mod_spindle_speed => your-spindle-hardware-speed-pin


thanks

this shows just what I needed as I sort of get linuxcnc but with the above example it shows how to load the component, add it to the thread, set the parameters, and then apply those to an existing net / wire and output it.

thanks, invaluable (it's one thing reading the manual but another to see a simple example of just the one element instead of all the other bits / components which can obfuscate what you are trying to understand or break it down to )

Please Log in to join the conversation.

More
5 years 8 months ago #197723 by andypugh
The next step would be to set up some custom M-codes to turn the behaviour on and off.

For example a file called M100 to turn it on.
Code:
#! /bin/bash #!/bin/bash frequency=$1 amplitude=$2 halcmd setp siggen.0.reset 0 halcmd setp siggen.0.frequency $frequency halcmd setp siggen.0.amplitude $amplitude exit 0

Save that code to a file called "m100" in your nc_files folder (probably. I am not at a LinuxCNC machine at the moment. Check the docs above as regards the search path). Then make the file executable. (right-click on it in the GUI and select properties)
Then
Code:
M100 P2 Q20
would enable the feature at 2Hz and 20 rpm amplitude.

You might also want an M101 to turn it off
Code:
#! /bin/bash halcmd setp siggen.0.reset 1 return 0

Please Log in to join the conversation.

More
5 years 8 months ago #197724 by robertspark
thanks Andy, again invaluable for a simple thing and to see how it's implimented

Please Log in to join the conversation.

More
5 years 8 months ago #197729 by andypugh

robertspark wrote: thanks Andy, again invaluable for a simple thing and to see how it's implimented


It would have been better if it was correct.

siggen does not have an "enable" but it does have a "reset" which locks the output to (offset + 0) which is what we want.

I have edited my example.

Please Log in to join the conversation.

More
5 years 8 months ago #197730 by rodw
Andy has proposed a nice elegant solution but you could also use M67/M68 and M62/M63 or M64/M65 which would not require the bash scripts
Code:
net frequency <= motion.analog-output-00 net amplitude <= motion.analog-output-01 net frequency => siggen.0.frequency net amplitude => siggen.0.amplitude net sigenable <= motion.digital-output-00 net sigenable => siggen.0.reset
Ref:
Digital output linuxcnc.org/docs/html/gcode/m-code.html#mcode:m62-m65
Analog output linuxcnc.org/docs/html/gcode/m-code.html#mcode:m67

It just goes to show there are many ways to skin a cat in Linuxcnc.

Wait till we show you how to write your own components if you are that way inclined!

Please Log in to join the conversation.

More
5 years 8 months ago #197731 by andypugh

rodw wrote: It just goes to show there are many ways to skin a cat in Linuxcnc.


Including, it seems, remapping the "S" command.
linuxcnc.org/docs/html/remap/remap.html#...ng_codes_s_m0_m1_m60

So with a bit of work behind the scenes you could use "M3 S1000 P2 Q20" (or, possibly, any other letters as the control words, but probably not the obvious "F" and "A" as those have specific meanings.)

Please Log in to join the conversation.

More
5 years 8 months ago #197733 by rodw

andypugh wrote: So with a bit of work behind the scenes you could use "M3 S1000 P2 Q20"


Steady up Andy, you'll have poor old Robert's head spinning!

But it is an interesting concept to explore... If you tried them all, you would learn a lot about Linuxcnc.

Please Log in to join the conversation.

More
5 years 8 months ago #197742 by robertspark

rodw wrote:

andypugh wrote: So with a bit of work behind the scenes you could use "M3 S1000 P2 Q20"


Steady up Andy, you'll have poor old Robert's head spinning!

But it is an interesting concept to explore... If you tried them all, you would learn a lot about Linuxcnc.


Thanks Gents

Not too many options please, head is already spinning and I am just starting out. Give it 6-12m and maybe I'll get to advance to the next class.

(too many options in Linux (not just the cnc bit) that becomes overwhelming to new users, yes I know it's flexibility and options.... sometimes just learning the basics is useful [I only learnt to use TAB in terminal to auto fill in the file names a month ago + '&' to start an instance using the same terminal window....... {I just can't remember how you start multiple instances from 1 terminal {something like '&6' but it didn't like that when I tried it}) All new stuff and good stuff to learn.

(I'd like to get into components but its baby steps + need, LCNC has so many options / components already, I can't think of something I need that doesn't already exist {yet})

Please Log in to join the conversation.

Time to create page: 0.070 seconds
Powered by Kunena Forum