Controlling feed with potentiometer

More
10 years 6 months ago #73698 by manuel2
Hi,

i have the same problem. A+B are changing in HAL but no counting :( How did you fix it?

My custom_postgui.hal:
Code:
net poti-a encoder.1.phase-A <= parport.0.pin-13-in-not net poti-b encoder.1.phase-B <= parport.0.pin-15-in-not setp halui.feed-override.scale 0.1 net poti-zaehler encoder.1.counts halui.feed-override.counts

Greets from Germany
Manuel

Please Log in to join the conversation.

More
10 years 6 months ago #73700 by andypugh
Is the encoder update-counters function added to a realtime thread?
There are two functions, one for the base thread and one for the servo thread.
linuxcnc.org/docs/2.7/html/man/man9/encoder.9.html

Is the reset pin set to 1 by any chance?

Please Log in to join the conversation.

More
10 years 6 months ago #73715 by manuel2
Hi Andy,

i think i haven't added the update-counters function to a realtime thread... Because i don't know how to do :S

The only thing I addet to my machine.hal is:
Code:
loadrt encoder num_chan=2

and to my machine.ini
Code:
[DISPLAY] MIN_SPINDLE_OVERRIDE = 0.5 MAX_SPINDLE_OVERRIDE = 2 [HAL] HALUI=halui

I have read the encoder-help you linked 3 times but my english is to bad to understand what I have to do that my encoder counts.

All these things I have changed are from here: wiki.linuxcnc.org/cgi-bin/wiki.pl?Spindleoverride . Not less and not more :whistle:

Greets Manuel

Please Log in to join the conversation.

More
10 years 6 months ago #73716 by andypugh

manuel2 wrote: I have read the encoder-help you linked 3 times but my english is to bad to understand what I have to do that my encoder counts.


The "manpages" such as that linked contain the information about a HAL component in a standard format. If you are lucky the author of the component also gives some explanation of what the component does and how to use it.

"Synopsis" tells you how to load the component in to HAL. In your case this would be
Code:
loadrt encoder num_chan=1
"Functions" tells you which functions need to be added to real-time threads. In your case this would be
Code:
addf encoder.update-counters base-thread addf encoder.capture-position servo-thread
"Pins" lists all the HAL pins created by the component and what they do.
"Parameters" are setting which can be altered by the HAL file but can not be linked to HAL pins.

Please Log in to join the conversation.

More
10 years 6 months ago #73719 by manuel2
You are my man!! Thank you for the explanation, it works perfect! :silly: :silly:

Please Log in to join the conversation.

Time to create page: 0.040 seconds
Powered by Kunena Forum