PFM to control spindle speed?

More
30 Dec 2022 12:18 #260542 by OliverLSedlacek
I've acquired a Denford Novamill which is a part complete 'convert to linuxCNC' project. It's come with a SpindleV3 PCB to convert a parallel port signal into the 0V to10V that the spindle speed controller expects. My problem is that the interface board expects PFM, zero to 2000 Hz pulses, but the StepConv wizard only offers PWM or PDM. Can I get LinuxCNC to produce PFM for spindle speed control?

Please Log in or Create an account to join the conversation.

More
30 Dec 2022 14:30 #260545 by PCW
Replied by PCW on topic PFM to control spindle speed?
Yes, you could use either a stepgen (in velocity mode) or the siggen component to generate the PFM

The Stepgen has the advantage that its frequency command scaling is adjustable
so the commanded RPM => frequency translation is done just by setting one parameter.

Please Log in or Create an account to join the conversation.

More
31 Dec 2022 11:42 #260631 by OliverLSedlacek
Great, how do I do this though?

Please Log in or Create an account to join the conversation.

More
31 Dec 2022 17:28 - 31 Dec 2022 17:29 #260665 by PCW
Replied by PCW on topic PFM to control spindle speed?
Basically you edit your hal file to add the additional stepgen (set to velocity mode)
then set the scaling and width parameters for that stepgen and finally "net"
LinuxCNC spindle speed command pin to the spindle stepgens velocity command input
(and possibly net LinuxCNCs spindle on command to the stepgen enable pin)
 (man stepgen)

If you post your current hal/ini files, I can make some examples of the changes needed
Last edit: 31 Dec 2022 17:29 by PCW.

Please Log in or Create an account to join the conversation.

More
01 Jan 2023 16:35 #260711 by OliverLSedlacek
That's brilliant, just the sort of guidance I need. I'll have a crack at it myself to start with.

Please Log in or Create an account to join the conversation.

More
03 Jan 2023 12:03 #260836 by OliverLSedlacek
It's taking me a while to get my head around the 969 pages of documentation, so I'd like to take you up on the offer of editing my hal/ini files (attached).
Attachments:

Please Log in or Create an account to join the conversation.

More
03 Jan 2023 17:17 #260853 by PCW
Replied by PCW on topic PFM to control spindle speed?
First step would be to add the new stepgen
To do that you would change

loadrt stepgen step_type=0,0,0

to

loadrt stepgen step_type=0,0,0,0 ctrl_type = p,p,p,v

(man stepgen)

Please Log in or Create an account to join the conversation.

More
07 Jan 2023 11:22 - 07 Jan 2023 11:47 #261159 by OliverLSedlacek
This isn't going well. I put the following lines in the HAL:

loadrt stepgen step_type=0,0,0,0 ctrl_type = p,p,p,v
net spindle-cmd-rpm => stepgen.3.velocity-cmd
net spindle-on <= spindle.0.on => stepgen.3.enable
net spindle-pfm <= stepgen.3.step
setp stepgen.3.maxvel 5000.0
setp stepgen.3.position-scale 0.4
setp stepgen.3.steplen 230000
setp stepgen.3.stepspace 230000

LinuxCNC terminated immediately with errors below:
Invalid parameter 'ctrl_type'

Follow up edit, after staring at the code for ages I clock the extraeneous space characters either side of the =. I've left the post up for other newbies like me.
Last edit: 07 Jan 2023 11:47 by OliverLSedlacek. Reason: Found my own solution

Please Log in or Create an account to join the conversation.

More
07 Jan 2023 16:12 #261176 by PCW
Replied by PCW on topic PFM to control spindle speed?
Sorry for the spaces in the example, the command line parser is quite picky...

Please Log in or Create an account to join the conversation.

More
07 Jan 2023 16:46 #261179 by OliverLSedlacek
I get that, if a space is a separator then it's a separator. As a veteran C/C++ coder I just don't 'see' spaces.

Please Log in or Create an account to join the conversation.

Moderators: PCWjmelson
Time to create page: 0.133 seconds
Powered by Kunena Forum