MPG Benutzung ohne dauert Knopf drücken?

More
02 Oct 2020 04:02 #184531 by Jetiman
MoinMoin,

ich habe mir ein MPG gebaut. Als Config Beispiel habe ich diese verwendet. LINK

Da muss man wenn man das Handrad nutzen möchte den entsprechenden Knopf der Achse gedrückt halten.

Gibt es eine Möglichkeit die Achse einfach anzuwählen ohne den Knopf gedrückt zu behalten?

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

More
02 Oct 2020 16:42 #184582 by Tchefter

Gibt es eine Möglichkeit die Achse einfach anzuwählen ohne den Knopf gedrückt zu behalten?


Moin Moin,
dafür brauchst Du einen Stufenschalter. Ich habe es allerdings zusätzlich über einen Arduino gelöst.
Evtl. hilf dir mein Thema von letztem Jahr etwas weiter. Nur als Anregung, keine Endlösung :)

Gruß

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

More
02 Oct 2020 18:10 #184599 by Jetiman
Anders geht's nicht?


Ich habe 3 Taster mit Beleuchtung.
Wenn ich in LINUXCNC die einzelnen Achsen auswähle leuchtet die jeweilige Taste. Das habe ich hinbekommen.

Nur finde ich kein hal pin den ich belegen kann.
Quasi drücke ich X soll X ausgewählt werden. Und mein Encoder steuert X.

Muss halt jetzt X gedrückt halten damit der Encoder funktioniert. axis.x.jog-enable

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

More
02 Oct 2020 18:37 #184602 by Aciera
Musst du dir eine logik überlegen und entweder in HAL oder CLASSICLADDER umsetzen.

linuxcnc.org/docs/2.4/html/hal_components.html

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

More
02 Oct 2020 18:38 - 02 Oct 2020 18:41 #184603 by MalteS
Natürlich geht das anders.
Ich habe das mit Flipflops gelöst die zurückgesetzt werden wenn eine andere Taste gedrückt wird. Zurücksetzen ist nicht ganz offensichtlich über die zwei lut5 und die and gelöst.

Das Handrad ist das von Einfach CNC. HAL File zur Orientirung hängt an. Die Funktion ist für die Achsen und die Schrittweite (1.0, 0.1, 0.01) im Prinzip die gleiche

Gruß
Malte
# The mux8 component will be used to switch jog increment
loadrt mux8 count=1
loadrt flipflop count=6
loadrt lut5 count=2
loadrt encoder
loadrt and2 count=6

addf lut5.0 servo-thread
addf lut5.1 servo-thread
addf mux8.0 servo-thread
addf flipflop.0 servo-thread
addf flipflop.1 servo-thread
addf flipflop.2 servo-thread
addf flipflop.3 servo-thread
addf flipflop.4 servo-thread
addf flipflop.5 servo-thread
addf encoder.capture-position servo-thread
addf encoder.update-counters base-thread
addf and2.0 servo-thread
addf and2.1 servo-thread
addf and2.2 servo-thread
addf and2.3 servo-thread
addf and2.4 servo-thread
addf and2.5 servo-thread

# Input pin config
net x_axis <= parport.1.pin-02-in-not
net y_axis <= parport.1.pin-03-in-not
net z_axis <= parport.1.pin-04-in-not
net x_axis_not <= parport.1.pin-02-in
net y_axis_not <= parport.1.pin-03-in
net z_axis_not <= parport.1.pin-04-in

net 1_step <= parport.1.pin-05-in-not
net 01_step  <= parport.1.pin-06-in-not
net 001_step   <= parport.1.pin-07-in-not
net 1_step_not <= parport.1.pin-05-in
net 01_step_not  <= parport.1.pin-06-in
net 001_step_not   <= parport.1.pin-07-in

net set_x halui.mdi-command-00 <= parport.1.pin-08-in-not
net set_y halui.mdi-command-01 <= parport.1.pin-09-in-not
net set_z halui.mdi-command-02 <= parport.1.pin-10-in-not

# Add OR groups to clear flipflops
setp lut5.0.function 0xFE
setp lut5.1.function 0xFE

net x_axis => lut5.0.in-0 
net y_axis => lut5.0.in-1 
net z_axis => lut5.0.in-2 

net 001_step => lut5.1.in-0 
net  01_step => lut5.1.in-1 
net   1_step => lut5.1.in-2 


# Set flipflops
net x_axis => flipflop.0.set 
net y_axis => flipflop.1.set
net z_axis => flipflop.2.set

net 001_step => flipflop.3.set
net  01_step => flipflop.4.set
net   1_step => flipflop.5.set

net buf_x_axis <= flipflop.0.out 
net buf_y_axis <= flipflop.1.out
net buf_z_axis <= flipflop.2.out

net buf_001_step <= flipflop.3.out
net buf_01_step  <= flipflop.4.out
net buf_1_step   <= flipflop.5.out


net reset_axis lut5.0.out => and2.0.in0 and2.1.in0 and2.2.in0
net x_axis_not => and2.0.in1
net y_axis_not => and2.1.in1
net z_axis_not => and2.2.in1

net reset_x and2.0.out => flipflop.0.reset 
net reset_y and2.1.out => flipflop.1.reset 
net reset_z and2.2.out => flipflop.2.reset 

net reset_step lut5.1.out => and2.3.in0 and2.4.in0 and2.5.in0
net 001_step_not => and2.3.in1
net 01_step_not  => and2.4.in1
net 1_step_not   => and2.5.in1

net reset_001 and2.3.out => flipflop.3.reset 
net reset_01  and2.4.out => flipflop.4.reset 
net reset_1   and2.5.out => flipflop.5.reset 


# When jog-vel-mode is set to 0 the axis will move jog-scale
# When jog-vel-mode is set to 1 the axis will stop when the 
# handwheel stops turning 

setp axis.0.jog-vel-mode 0
setp axis.1.jog-vel-mode 0
setp axis.2.jog-vel-mode 0

# This sets the scale that will be used based on the input to the mux4
# This mill reads in metric units so jog scale is 1mm, 0.1mm, and 0.01mm
# Encoder count will always be a muliple of 4 so dividing this is by 4
setp mux8.0.in0 0.0025
setp mux8.0.in1 0.25
setp mux8.0.in2 0.025
setp mux8.0.in4 0.0025

#The inputs to the mux4 component
net buf_1_step   => mux8.0.sel0  
net buf_01_step  => mux8.0.sel1 
net buf_001_step => mux8.0.sel2 

#The output from the mux4 is sent to each axis jog scale
net mpg-scale <= mux8.0.out
net mpg-scale => axis.0.jog-scale 
net mpg-scale => axis.1.jog-scale 
net mpg-scale => axis.2.jog-scale 

#The Axis select inputs
net buf_x_axis => axis.0.jog-enable  
net buf_y_axis => axis.1.jog-enable
net buf_z_axis => axis.2.jog-enable

#The encoded output counts to the axis. Only selected axis will move.
net encoder-counts <= encoder.0.counts
net encoder-phase-A encoder.0.phase-A parport.1.pin-13-in
net encoder-phase-B encoder.0.phase-B parport.1.pin-15-in
net encoder-counts => axis.0.jog-counts
net encoder-counts => axis.1.jog-counts
net encoder-counts => axis.2.jog-counts
Last edit: 02 Oct 2020 18:41 by MalteS.
The following user(s) said Thank You: Tchefter, Aciera

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

More
02 Oct 2020 20:08 #184616 by Jetiman
Okay, damit kann ich was anfangen.

Werde ich mich morgen früh gleich ran setzen.

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

Time to create page: 0.323 seconds
Powered by Kunena Forum