Mehrere Rotray Encoder

More
20 Nov 2019 15:29 #150767 by Tchefter
Replied by Tchefter on topic Mehrere Rotray Encoder
Was ich jetzt geschafft habe, eigentlich nicht das was ich wollte :)
Ich habe diesen Beitrag von andypugh gefunden. Ich habe so einiges anpassen müssen das es in der 2.8 Master läuft. Dank pl7i92 mit der Info, aus seinem oben verlinkten Video, das die Variablen unter der 2.8 teilweise anders heißen, hat es relativ gut funktioniert.
Den Ausschnitt dazu hier, die ganze HAL im Anhang (die ist noch etwas chaotisch, wird aber noch bereinigt)
#######################################

loadrt select8 count=1
loadrt updown count=1

#addf encoder.update-counters base-thread
#addf encoder.capture-position servo-thread
addf select8.0 servo-thread
addf updown.0 servo-thread

net encA encoder.2.phase-A <= parport.1.pin-10-in
net encB encoder.2.phase-B <= parport.1.pin-11-in
net enc-counts encoder.2.counts => axis.x.jog-counts axis.y.jog-counts axis.z.jog-counts
net jog-button updown.0.countup <= parport.1.pin-13-in
net jog-choice updown.0.count => select8.0.sel
net jogX axis.x.jog-enable <= select8.0.out0
net jogY axis.y.jog-enable <= select8.0.out1
net jogZ axis.z.jog-enable <= select8.0.out2

setp encoder.2.counter-mode 0
setp updown.0.max 2
setp updown.0.min 0
setp updown.0.wrap 1

setp axis.x.jog-scale 0.5
setp axis.y.jog-scale 0.5
setp axis.z.jog-scale 0.5

#######################################

Kann mir Jemand sagen/schreiben wie man das setp axis.x.jog-scale mit einem Encoder regeln kann?
Also quasi mit den Auflösungen: 0.5 / 0.1 / 0.01 / 0.001

Des weiteren bin ich immer noch am suchen und probieren wie ich diesen Slider der Schrittgeschwindigkeit / JOG-SPEED mit einem Encoder ändern kann.

Gruß Fritz

File Attachment:

File Name: test.hal
File Size:5 KB
Attachments:

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

More
20 Nov 2019 19:55 #150789 by pl7i92
Replied by pl7i92 on topic Mehrere Rotray Encoder
nicht das du jetzt ausflippst
hier die combination die ich benutze
DA ist auch eilgang JOG mit drinn
# jog Speed
loadrt mux8 count=2
addf mux8.0 servo-thread
addf mux8.1 servo-thread
#wheel speed per tick
setp mux8.0.in0 0
setp mux8.0.in1 0.1
setp mux8.0.in2 0.5
setp mux8.0.in3 0
setp mux8.0.in4 1
#speed for moving axes  
setp mux8.1.in0 0 # this one must be 0 to prevent motion unless a button is pressed
setp mux8.1.in1 250
setp mux8.1.in2 1000
setp mux8.1.in3 0
setp mux8.1.in4 2500

# step logic
loadrt updown count=1
addf updown.0 servo-thread
setp updown.0.wrap true
setp updown.0.min 0
setp updown.0.max 6
net stepcount updown.0.countup <= xhc-hb04.button-step => xhc-hb04.stepsize-up
#reset step to zero
net updownreset updown.0.reset <= click_mode.single-click
#convert count s32 to float 
loadrt conv_s32_float count=1
addf conv-s32-float.0 servo-thread
net conv-step  conv-s32-float.0.in updown.0.count
#step signal compare
loadrt comp count=7
addf comp.0 servo-thread
addf comp.1 servo-thread
addf comp.2 servo-thread
addf comp.3 servo-thread
addf comp.4 servo-thread
addf comp.5 servo-thread
addf comp.6 servo-thread

setp comp.0.in0 0
setp comp.1.in0 1
setp comp.2.in0 2
setp comp.3.in0 3
setp comp.4.in0 4
setp comp.5.in0 5
setp comp.6.in0 6
loadrt or2 count=5
addf or2.0 servo-thread
addf or2.1 servo-thread
addf or2.2 servo-thread
addf or2.3 servo-thread
addf or2.4 servo-thread

net stepcounter-out conv-s32-float.0.out => comp.0.in1 comp.1.in1 comp.2.in1 comp.3.in1 comp.4.in1 comp.5.in1 comp.6.in1
#jog scale selector from step to mux 
net scale-selectorA mux8.0.sel0 <= comp.1.equal => or2.0.in0 
net scale-selectorB mux8.0.sel1 <= comp.2.equal => or2.0.in1
net scale-selectorC mux8.0.sel2 <= comp.3.equal => or2.1.in0
net led-wheel-sectorA or2.1.in1 <= or2.0.out
# postgui net pyvc-led-wheel or2.1.out => pyvcp.wheel_select 
net jog-scale mux8.0.out => axis.0.jog-scale axis.1.jog-scale axis.2.jog-scale axis.3.jog-scale
net joy-speed-1 mux8.1.sel0 <= comp.4.equal => or2.2.in0
net joy-speed-2 mux8.1.sel1 <= comp.5.equal => or2.2.in1
net joy-speed-3 mux8.1.sel2 <= comp.6.equal => or2.3.in0
net led-button-sectorA or2.3.in1 <= or2.2.out
# postgui net pyvc-led-button or2.3.out => pyvcp.button_select 
net joy-speed-final halui.jog-speed <= mux8.1.out

und die Connection ist bei dir ja schon da
#logic for Button velomotion
loadrt and2 count=12
addf and2.0  servo-thread #Jog positiv X
addf and2.1  servo-thread
addf and2.2  servo-thread
addf and2.3  servo-thread #jog negativ X
addf and2.4  servo-thread 
addf and2.5  servo-thread
addf and2.6  servo-thread # Zeroing X
addf and2.7  servo-thread
addf and2.8  servo-thread
addf and2.9  servo-thread #a plus
addf and2.10  servo-thread #a minus
addf and2.11  servo-thread #azero

# Jog wheel and axis selection button
net jog-x axis.0.jog-enable <= xhc-hb04.jog.enable-x => and2.0.in0 and2.3.in0 and2.6.in0
net jog-y axis.1.jog-enable <= xhc-hb04.jog.enable-y => and2.1.in0 and2.4.in0 and2.7.in0
net jog-z axis.2.jog-enable <= xhc-hb04.jog.enable-z => and2.2.in0 and2.5.in0 and2.8.in0
net jog-a axis.3.jog-enable <= xhc-hb04.jog.enable-a and2.9.in0 and2.10.in0 and2.11.in0

net joy-pos xhc-hb04.button-macro-7 and2.3.in1 and2.4.in1 and2.5.in1 and2.9.in1
net joy-neg xhc-hb04.button-macro-6 => and2.0.in1 and2.1.in1 and2.2.in1 and2.10.in1

net jog-counts xhc-hb04.jog.counts => axis.0.jog-counts axis.1.jog-counts 
net jog-counts-neg xhc-hb04.jog.counts-neg => axis.2.jog-counts
#net jog-speed halui.jog-speed <= halui.max-velocity.value

net joy-xpos-jog halui.jog.0.plus <= and2.3.out 
net joy-xneg-jog halui.jog.0.minus <= and2.0.out 
net joy-ypos-jog halui.jog.1.plus <= and2.4.out 
net joy-yneg-jog halui.jog.1.minus <= and2.1.out 
net joy-zpos-jog halui.jog.2.plus <= and2.5.out 
net joy-zneg-jog halui.jog.2.minus <= and2.2.out 
net joy-apos-jog halui.jog.3.plus <= and2.9.out 
net joy-aneg-jog halui.jog.3.minus <= and2.10.out 
The following user(s) said Thank You: Tchefter

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

More
20 Nov 2019 20:30 #150792 by Tchefter
Replied by Tchefter on topic Mehrere Rotray Encoder
WOW sehr cool! Da habe ich ja die nächsten Tage was zum probieren!
Vielen Dank pl7i92!

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

More
21 Nov 2019 10:13 #150818 by pl7i92
Replied by pl7i92 on topic Mehrere Rotray Encoder
ich möchte darauf hinweisen das ich die Plasma mit dem Handrad in den kleine auflösungen fahre
und mit einer Zusatztaste dann auf 500-2500 mm/min fahren kann sind immerhin bis zu 7meter fahrweg da kurbelst du dich bei 0,2mm Dämlich

die STEP / auswahltaste steuert das über den counter
anzeige am Handrad via icon MPG oder Taste (xhc Gehackt) comp

Ich wollte nur sagen man kann viel zusammenbasteln

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

More
21 Nov 2019 19:24 #150853 by Tchefter
Replied by Tchefter on topic Mehrere Rotray Encoder
Alles gut, "so langsam" komme ich hinter die Materie, zwar mit noch vielen ->???
Aber Rom wurde ja auch nicht an einem Tag gebaut :)

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

More
22 Nov 2019 16:28 #150944 by pl7i92
Replied by pl7i92 on topic Mehrere Rotray Encoder
das wird
du brauchst ja auch nur einen mux8
The following user(s) said Thank You: Tchefter

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

More
24 Nov 2019 19:42 - 24 Nov 2019 19:43 #151132 by Tchefter
Replied by Tchefter on topic Mehrere Rotray Encoder
Hallo und sorry,
ich muss nochmal nachfragen.
Ich habe mir jetzt das Script des MPG Pendant genommen und an die 2.8 angepasst.
Eigentlich funktioniert es gut bis auf die JogScale Sache 0.1 / 0.01 / 0.001
Das kann ich doch mit einem Encoder regeln, dieser wird doch hier angeschlossen

# The inputs to the mux4 component
net scale1 mux4.0.sel0 <= parport.1.pin-09-in
net scale2 mux4.0.sel1 <= parport.1.pin-10-in

Sehe ich das richtig?
Normalerweise doch schon, da z,B. 0.1 und 0.01 funktionieren nur 0.001 geht nicht.

Ich habe jetzt für mich gelernt das der MUX4 ein Multiplexer ist, somit müsste er doch die Leitungen handeln können.
Ich versteh das irgendwie nicht richtig, wie die 3. Leitung also in2 hier geschaltet werden muss

# This sets the scale that will be used based on the input to the mux4
setp mux4.0.in0 0.1
setp mux4.0.in1 0.01
setp mux4.0.in2 0.001

Oder muss Hardwareseitig doch was anderes verbaut werden? Ich steh grade mega auf dem Schlauch.

Hat mir Jemand einen Tipp?

Gruß Fritz
Last edit: 24 Nov 2019 19:43 by Tchefter.

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

More
24 Nov 2019 20:53 #151139 by Mike_Eitel
Replied by Mike_Eitel on topic Mehrere Rotray Encoder
Hier der Auszug aus der Dok:

FUNCTIONS
mux4.N (requires a floating-point thread)

PINS
mux4.N.sel0 bit in
mux4.N.sel1 bit in

Together, these determine which inN value is copied to out.
mux4.N.out float out

Follows the value of one of the inN values according to the two sel values
sel1=FALSE, sel0=FALSE out follows in0
sel1=FALSE, sel0=TRUE out follows in1
sel1=TRUE, sel0=FALSE out follows in2
sel1=TRUE, sel0=TRUE out follows in3

mux4.N.in0 float in
mux4.N.in1 float in
mux4.N.in2 float in
mux4.N.in3 float in

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

More
25 Nov 2019 05:22 #151190 by Tchefter
Replied by Tchefter on topic Mehrere Rotray Encoder
Hallo Mike,
vielen Dank, diese Seite hab ich schon x-mal durch gelesen.
Ich raff es iwi nicht. Wie wird diese Zeile aktiv?

sel1=TRUE, sel0=FALSE out follows in2

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

More
25 Nov 2019 05:30 #151191 by Mike_Eitel
Replied by Mike_Eitel on topic Mehrere Rotray Encoder
Die zwei Leitungen sind binär. D. H. sie ermöglichen vier Positionen.
Deswegen wählst Du mit MUX4.N.IN0 bis MUX4.N.IN3 auch vier Zahlen aus.

Deine Leitungen mit einem 4 Positionen Schalter machen dann 00 01 10 11.
Gruss Mike

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

Time to create page: 0.163 seconds
Powered by Kunena Forum