Spindel problems in Gmoccapy

More
9 years 6 months ago #92200 by tecno
Spindel problems in Gmoccapy was created by tecno
Have now my lathe running OK in Axis.

In Gmoccapy I can not start the spindle, works OK in Axis.


Obviously I have something set wrong but what can that be, spindle starts at 200rpm in Axis.

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

More
9 years 6 months ago #92207 by rodw
Replied by rodw on topic Spindel problems in Gmoccapy
I don't have a spindle so can't help much. I think there are some .ini file settings that need to be set up as I see some warnings in the terminal window when I start Linuxcnc from the command line. Have a read here:
linuxcnc.org/docs/html/gui/gmoccapy.html#_basic_configuration

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

More
9 years 6 months ago - 9 years 6 months ago #92222 by tecno
Replied by tecno on topic Spindel problems in Gmoccapy
Found the problem that is the slider was locked far left and only restart solved this so now I can command the spindle.


slider far left was locked

But, still no visual rpm display. Copied TURBO and his solution

I mean i just got the gmoccapy spindle meter and led working.

In the ini hal section I added

# Single file that is executed after the GUI has started.
POSTGUI_HALFILE = custom_postgui.hal

in custom_postgui.hal

net spindle-fb-rpm-abs-filtered => gmoccapy.spindle_feedback_bar
net spindle-at-speed => gmoccapy.spindle_at_speed_led


So how can I get some rpm feedback having only INDEX pulse on spindle shaft.

Cheers
Bengt
Attachments:
Last edit: 9 years 6 months ago by tecno.

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

More
9 years 6 months ago #92228 by newbynobi
Replied by newbynobi on topic Spindel problems in Gmoccapy
Here is a simple spindle connection I use for a small machine:
Code:
########################################################## # Spindeldrehzahl messen / mesurement spindle revolution # ########################################################## loadrt encoder num_chan=1 addf encoder.update-counters base-thread addf encoder.capture-position servo-thread setp encoder.1.position-scale 1 # Anzahl der Impulse je Umdrehung setp encoder.1.counter-mode 1 # Wenn 1 gesetzt, wird B-Signal ignoriert # disable 4 times encoder, otherwise each klick will ingreas jogwheel-count by 4 instead of 1 # 4-fach-Auswertung vom Encoder ausschalten, sonst wird jogwheel-count bei jedem Klick um 4 statt um 1 erhoeht setp encoder.0.x4-mode FALSE loadrt scale count=1 # Wird gebraucht, um U/Sekunde in U/min umzurechnen addf scale.0 servo-thread setp scale.0.gain 60 # Ausgang = 60 x Eingang net spindle_index parport.1.pin-12-in => encoder.1.phase-A => encoder.1.phase-Z net spindle-index-enable motion.spindle-index-enable <=> encoder.1.index-enable net spindle-rps encoder.1.velocity => scale.0.in net spindle-rpm scale.0.out # Zum Erkennen ob Geschwindigkeit erreicht wurde # For at Speed detection loadrt near addf near.0 servo-thread # Stellt fest ob zwei Werte in etwa gleich sind # Wahr wenn, in1/scale <= in2 <= in1*scale # oder wenn |in1-in2| <= difference # prooves if two values are roughly the same # true if in1/scale <= in2 <= in1*scale # OR |in1-in2| <= difference setp near.0.scale 1.2 setp near.0.difference 10 net spindle-cmd => near.0.in1 # net spindle-revs motion.spindle-revs => near.0.in1 net spindle-rpm => near.0.in2 net spindle-at-speed near.0.out => motion.spindle-at-speed

After that spindle-rpm must be connected in postgui.hal to gmoccapy.spindle_feedback_bar

May be you need to pass the signal through an ABS to get positive values.

Hope that helps.

Norbert

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

More
9 years 6 months ago #92229 by tecno
Replied by tecno on topic Spindel problems in Gmoccapy
Thank you Norbert,
will give this a try tomorrow.

mfg
Bengt

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

More
9 years 6 months ago #92253 by tecno
Replied by tecno on topic Spindel problems in Gmoccapy
Can somebody clarify the code from Norbert. I have only 1 par port = 0 and only index pulse on pin 10

What lines should be edited to suit above as I get nowhere with the code as-is.

Cheers
bengt

newbynobi wrote: Here is a simple spindle connection I use for a small machine:

Code:
########################################################## # Spindeldrehzahl messen / mesurement spindle revolution # ########################################################## loadrt encoder num_chan=1 addf encoder.update-counters base-thread addf encoder.capture-position servo-thread setp encoder.1.position-scale 1 # Anzahl der Impulse je Umdrehung setp encoder.1.counter-mode 1 # Wenn 1 gesetzt, wird B-Signal ignoriert # disable 4 times encoder, otherwise each klick will ingreas jogwheel-count by 4 instead of 1 # 4-fach-Auswertung vom Encoder ausschalten, sonst wird jogwheel-count bei jedem Klick um 4 statt um 1 erhoeht setp encoder.0.x4-mode FALSE loadrt scale count=1 # Wird gebraucht, um U/Sekunde in U/min umzurechnen addf scale.0 servo-thread setp scale.0.gain 60 # Ausgang = 60 x Eingang net spindle_index parport.1.pin-12-in => encoder.1.phase-A => encoder.1.phase-Z net spindle-index-enable motion.spindle-index-enable <=> encoder.1.index-enable net spindle-rps encoder.1.velocity => scale.0.in net spindle-rpm scale.0.out # Zum Erkennen ob Geschwindigkeit erreicht wurde # For at Speed detection loadrt near addf near.0 servo-thread # Stellt fest ob zwei Werte in etwa gleich sind # Wahr wenn, in1/scale <= in2 <= in1*scale # oder wenn |in1-in2| <= difference # prooves if two values are roughly the same # true if in1/scale <= in2 <= in1*scale # OR |in1-in2| <= difference setp near.0.scale 1.2 setp near.0.difference 10 net spindle-cmd => near.0.in1 # net spindle-revs motion.spindle-revs => near.0.in1 net spindle-rpm => near.0.in2 net spindle-at-speed near.0.out => motion.spindle-at-speed

After that spindle-rpm must be connected in postgui.hal to gmoccapy.spindle_feedback_bar

May be you need to pass the signal through an ABS to get positive values.

Hope that helps.

Norbert

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

Moderators: newbynobi, HansU
Time to create page: 0.338 seconds
Powered by Kunena Forum