- Posts: 17
- Thank you received: 0
PFM to control spindle speed?
- OliverLSedlacek
- Topic Author
- Offline
- New Member
-
Less
More
3 years 10 months ago #260542
by OliverLSedlacek
PFM to control spindle speed? was created 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 to join the conversation.
3 years 10 months ago #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.
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 to join the conversation.
- OliverLSedlacek
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 17
- Thank you received: 0
3 years 10 months ago #260631
by OliverLSedlacek
Replied by OliverLSedlacek on topic PFM to control spindle speed?
Great, how do I do this though?
Please Log in to join the conversation.
3 years 10 months ago #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
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
Please Log in to join the conversation.
- OliverLSedlacek
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 17
- Thank you received: 0
3 years 9 months ago #260711
by OliverLSedlacek
Replied by OliverLSedlacek on topic PFM to control spindle speed?
That's brilliant, just the sort of guidance I need. I'll have a crack at it myself to start with.
Please Log in to join the conversation.
- OliverLSedlacek
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 17
- Thank you received: 0
3 years 9 months ago #260836
by OliverLSedlacek
Replied by OliverLSedlacek on topic PFM to control spindle speed?
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).
Please Log in to join the conversation.
3 years 9 months ago #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)
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 to join the conversation.
- OliverLSedlacek
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 17
- Thank you received: 0
3 years 9 months ago #261159
by OliverLSedlacek
Replied by OliverLSedlacek on topic PFM to control spindle speed?
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.
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.
Please Log in to join the conversation.
3 years 9 months ago #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 to join the conversation.
- OliverLSedlacek
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 17
- Thank you received: 0
3 years 9 months ago #261179
by OliverLSedlacek
Replied by OliverLSedlacek on topic PFM to control spindle speed?
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 to join the conversation.
Time to create page: 0.055 seconds
