Analog Overrides? 5i25+7i77 Mode 3

More
08 Sep 2017 01:16 #98650 by B.Reilly01
I would like to have analog overrides for spindle, rapid, and feed. I would like to use the Analog inputs connected to potentiometers. I would like to use PNCConf for this so I don't hose something up. Is this possible? My 7i77 is set to Mode3, which should allow 4 analog inputs (0-3) as well as 2 MPGs (only using 1 on 16-17). Under this mode, I don't seem to be able to select analog input in PNCCONF. Any help would be appreciated.

Thank you
The following user(s) said Thank You: Ichzwei

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

More
08 Sep 2017 15:42 - 08 Sep 2017 15:45 #98696 by andypugh
I think that this level of complexity is beyond the capability of PnCConf.
You will have to configure this by hand in the HAL file.

Something like:
net spindle-override hm2_7i77.0.analog0 => halui.spindle-override.scale
setp halui.spindle-override.counts 100
setp halui.spindle-override.direct-value 1

linuxcnc.org/docs/2.7/html/man/man1/halui.1.html
Last edit: 08 Sep 2017 15:45 by andypugh.
The following user(s) said Thank You: Ichzwei

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

More
28 Dec 2017 23:39 #103805 by Ichzwei
Hi, i have search the forum for help with a potentiometer as spindle override, and find this post.
but it don't work for me.

i have this in my HAL-file:

loadrt scale names=spindle-scale
addf spindle-scale servo-thread

net spindle-analogue hm2_5i25.0.7i77.0.0.analogin0 => spindle-scale.in
net spindle-override spindle-scale.out => halui.spindle-override.value
setp halui.spindle-override.direct-value 1
setp spindle-scale.gain 1
setp spindle-scale.offset -2.5


it shows this error:

Debug file information:
./my_LinuxCNC_machine.hal:318: Signal 'spindle-override' can not add OUT pin 'halui.spindle-override.value', it already has OUT pin 'spindle-scale.out'
16983

what is my mistake?

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

More
29 Dec 2017 05:09 #103812 by Henk
Hi
It seems that the signal spindle-override exists somewhere else in your hal file and you are trying to connect another out pin which is not allowed.

henk
The following user(s) said Thank You: Ichzwei

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

More
29 Dec 2017 09:45 - 29 Dec 2017 09:50 #103817 by Ichzwei
Thanks henk.

I have chanced the name of the pin, so it definitely only on this position in the HAL-file.
but it shows the same error.

i add the hal file, maybe i overlooking something

thanks for your help
michael


Warning: Spoiler!
Attachments:
Last edit: 29 Dec 2017 09:50 by Ichzwei.

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

More
29 Dec 2017 16:38 #103823 by Henk
HI
I think you are trying to write to a signal that is an "out" pin. not an "in" pin in halui


From the halui man-page

spindle override
halui.spindle-override.count-enable bit in (default: TRUE)

When TRUE, modify spindle override when counts changes.

halui.spindle-override.counts s32 in

counts X scale = spindle override percentage

halui.spindle-override.decrease bit in

pin for decreasing the SO (-=scale)

halui.spindle-override.direct-value bit in

pin to enable direct spindle override value input

halui.spindle-override.increase bit in

pin for increasing the SO (+=scale)

halui.spindle-override.scale float in

pin for setting the scale of counts for SO

halui.spindle-override.value float out

current FO value


You need to connect to halui.spindle-override.counts and set the scale pin so that scale x counts = %override.

eg: net spindle-override spindle-scale.out => halui.spindle-override.counts

But halui.spindle-override.counts is a s32 pin and spindle-scale.out is float, so you will have to convert the out from spindle-scale to s32 using conv_float_s32 component.

in short: analog-in (from pot) => spindle-scale => conv_float_s32 => halui.spindle-override.counts.

You will also have to set the gain of the scale and maybe offset to achieve the desired counts

Hope this helps

Henk
The following user(s) said Thank You: Ichzwei

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

More
29 Dec 2017 19:07 - 29 Dec 2017 19:55 #103825 by Ichzwei
thanks henk,
you helpt me solving the problem.

i add this to the hal file... now i can chance the spindle override from 50%-100% on the potentiometer.
loadrt conv_float_s32 count=1
loadrt scale names=spindle-scale
addf spindle-scale servo-thread
addf conv-float-s32.0 servo-thread

setp halui.spindle-override.direct-value false
setp halui.spindle-override.count-enable true
setp spindle-scale.gain 4.16666
setp spindle-scale.offset 0
setp halui.spindle-override.scale 0.005
net spindle-analogue hm2_5i25.0.7i77.0.0.analogin0 => spindle-scale.in
net spindle-convert spindle-scale.out conv-float-s32.0.in
net spindle-override conv-float-s32.0.out  halui.spindle-override.counts

but i notice that on the start of linuxcnc the override is not the absolute value of the poti.
i need to rotate it and then the value in linuxcnc chanced.

greetings
michael
Last edit: 29 Dec 2017 19:55 by Ichzwei.

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

More
12 Jan 2018 16:41 #104341 by andypugh

setp halui.spindle-override.direct-value false


I think this should be "true"

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

More
10 Sep 2020 15:28 - 10 Sep 2020 15:37 #181647 by xenon-alien
Can you help me out?
Did the same for feed override and have a halui.feed−override.direct−value not found error

loadrt conv_float_s32 count=2
loadrt scale names=spindle-scale,feed-scale

# analog 0 
addf spindle-scale servo-thread
addf conv-float-s32.0 servo-thread

# analog 1 
addf feed-scale servo-thread
addf conv-float-s32.1 servo-thread

setp halui.feed−override.direct−value false
setp halui.feed−override.count−enable true
setp feed-scale.gain 4.16666
setp feed-scale.offset 0
setp halui.feed−override.scale 0.005
net feed-analogue hm2_7i76e.0.7i76.0.0.analogin0 => feed-scale.in
net feed-convert feed-scale.out conv-float-s32.1.in
net feed-override conv-float-s32.1.out  halui.feed−override.counts 
The spindle part working, when I comment out the "Analog in 1 Feed" part.
www.instagram.com/p/CE9VqzCJiAx/
For now I'm using one input for both.
Attachments:
Last edit: 10 Sep 2020 15:37 by xenon-alien.

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

More
10 Sep 2020 16:27 #181653 by cmorley
hyphen looks different in direct-value
The following user(s) said Thank You: xenon-alien

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

Moderators: cmorley
Time to create page: 0.152 seconds
Powered by Kunena Forum