spindle speed a negative number when CCW
- hahn_rossman
- Offline
- New Member
Less
More
- Posts: 9
- Thank you received: 1
18 Sep 2013 09:32 #38967
by hahn_rossman
spindle speed a negative number when CCW was created by hahn_rossman
I'm not sure if this is a PNCconf or mesa problem, but when I issue a M04 command the spindle turns in the intended direction but the speed is wrong. When I used the hal probe to look at that pin it showed that the requested speed is negative! Is this a known problem?
Hahn Rossman
Hahn Rossman
Please Log in or Create an account to join the conversation.
18 Sep 2013 09:56 #38969
by cmorley
Replied by cmorley on topic spindle speed a negative number when CCW
Hard to say without more info.
What mesa boards are you using?
what settings for analog/dac scaling?
Posting your HAL and INI may help
Chris M
What mesa boards are you using?
what settings for analog/dac scaling?
Posting your HAL and INI may help
Chris M
Please Log in or Create an account to join the conversation.
18 Sep 2013 17:30 #38982
by andypugh
It is a feature more than a problem.
The negative-value-for-reverse of the spindle speed pin is useful for driving some hardware. This includes the Mesa pwm generators which interpret the magnitude and sign as PWM duty cycle and direction (If you are interested, it happens on line 589 and onwards here: git.linuxcnc.org/gitweb?p=linuxcnc.git;a...76ef3a69e2aeb1c48929 )
What hardware are you using?
You can use the "abs" HAL function to make all values positive, and (rather usefully) the abs function has "is-positive" and "is-negative" outputs that can be used to drive direction control outputs for the hardware.
www.linuxcnc.org/docs/html/man/man9/abs.9.html
Replied by andypugh on topic spindle speed a negative number when CCW
I'm not sure if this is a PNCconf or mesa problem, but when I issue a M04 command the spindle turns in the intended direction but the speed is wrong. When I used the hal probe to look at that pin it showed that the requested speed is negative! Is this a known problem?
It is a feature more than a problem.
The negative-value-for-reverse of the spindle speed pin is useful for driving some hardware. This includes the Mesa pwm generators which interpret the magnitude and sign as PWM duty cycle and direction (If you are interested, it happens on line 589 and onwards here: git.linuxcnc.org/gitweb?p=linuxcnc.git;a...76ef3a69e2aeb1c48929 )
What hardware are you using?
You can use the "abs" HAL function to make all values positive, and (rather usefully) the abs function has "is-positive" and "is-negative" outputs that can be used to drive direction control outputs for the hardware.
www.linuxcnc.org/docs/html/man/man9/abs.9.html
Please Log in or Create an account to join the conversation.
- hahn_rossman
- Offline
- New Member
Less
More
- Posts: 9
- Thank you received: 1
18 Sep 2013 21:20 #38988
by hahn_rossman
Replied by hahn_rossman on topic spindle speed a negative number when CCW
I'm using the 5i25+7i76 to run my series II Bridgeport. Andy I'll try that today at the shop, thanks for the quick reply!
Hahn Rossman
Hahn Rossman
Please Log in or Create an account to join the conversation.
19 Sep 2013 05:02 #39008
by andypugh
Replied by andypugh on topic spindle speed a negative number when CCW
This seems likely to be a bug (my bug). I will try to fix it, but it won't be all that soon. In the meantime the abs function looks like the way to bypass it, and will continue to work after the bug is fixed.
Please Log in or Create an account to join the conversation.
- hahn_rossman
- Offline
- New Member
Less
More
- Posts: 9
- Thank you received: 1
19 Sep 2013 05:06 #39009
by hahn_rossman
Replied by hahn_rossman on topic spindle speed a negative number when CCW
Is it as simple as adding
loadrt abs
to the custom hal config file?
the man page shows :
loadrt abs [count=N|names=name1[,name2...]]
which unfortunately looks like there is some other things I'm supposed to add?
Sorry about my groping around with Linux. I'm trying to get my head around all this stuff, but progress is slow!
Hahn Rossman
loadrt abs
to the custom hal config file?
the man page shows :
loadrt abs [count=N|names=name1[,name2...]]
which unfortunately looks like there is some other things I'm supposed to add?
Sorry about my groping around with Linux. I'm trying to get my head around all this stuff, but progress is slow!
Hahn Rossman
Please Log in or Create an account to join the conversation.
19 Sep 2013 06:30 - 19 Sep 2013 06:31 #39011
by andypugh
Not quite. (but nearly)
Addwhere the other loadrt lines are. Thenwhere the other addf lines are.
Then editto read
Or similar. I have guessed nearly all the signal and pin names. You should use the exact pin names that your HAL file has. You have rather more leeway with the signal names, those are created in the HAL file. The signal names are the first items after a "net" or "newsig" command.
The format of a "net" command iswith one or more pins. Only one pin linked to a signal can be an output pin. You can choose signal names. Pin names are fixed and created by LinuxCNC. The output pins you care about are motion.spindle-speed-out and abs.0.out.
If you ever create your own HAL components (and you can) then you get to choose your own pin names too. But that is for the future.
Replied by andypugh on topic spindle speed a negative number when CCW
Is it as simple as adding
loadrt abs
to the custom hal config file?
Not quite. (but nearly)
Add
loadrt abs count=1
addf abs.0 servo-thread
Then edit
net spindle-speed motion.spindle-speed-out => hm2_5i25.0.7i76.00.spindle-speed
net spindle-speed motion.spindle-speed-out => abs.0.in
net spindle-speed-abs abs.0.out => hm2_5i25.0.7i76.00.spindle-speed
Or similar. I have guessed nearly all the signal and pin names. You should use the exact pin names that your HAL file has. You have rather more leeway with the signal names, those are created in the HAL file. The signal names are the first items after a "net" or "newsig" command.
The format of a "net" command is
net signal_name pin1 pin2 pin3 pin4……
If you ever create your own HAL components (and you can) then you get to choose your own pin names too. But that is for the future.
Last edit: 19 Sep 2013 06:31 by andypugh.
The following user(s) said Thank You: hahn_rossman
Please Log in or Create an account to join the conversation.
Moderators: cmorley
Time to create page: 0.068 seconds