- Configuring LinuxCNC
- Advanced Configuration
- Preparation for the self-construction of a carousel changer
Preparation for the self-construction of a carousel changer
05 Dec 2022 13:10 - 05 Dec 2022 13:20 #258593
by mgm
Replied by mgm on topic Preparation for the self-construction of a carousel changer
the line in the hal
net car-ready carousel.0.ready motion.digital-in-04
I need, because otherwise the carousel does not stop when it has found the right pocket!
OK now I found out why the ready does not go to false at the start of the carousel!
It depends if you choose unidirectional or bidirectional .....
With unidirectional ready goes immediately after exit to false
but if bidirectional is selected ready stays high.
net car-ready carousel.0.ready motion.digital-in-04
I need, because otherwise the carousel does not stop when it has found the right pocket!
It depends if you choose unidirectional or bidirectional .....
With unidirectional ready goes immediately after exit to false
but if bidirectional is selected ready stays high.
Last edit: 05 Dec 2022 13:20 by mgm.
Please Log in or Create an account to join the conversation.
05 Dec 2022 13:49 #258596
by andypugh
Replied by andypugh on topic Preparation for the self-construction of a carousel changer
Sorry, yes, I was tired and mis-reading moton.digital-in-04 as a GPIO pin whereas it is actually a signal to the NGC routine.
Can you explain what each of your actual digital outputs do? Regardless of the NGC routine the carousel motor should stop when it is in-position (motor-fwd and motor-rec will go false, motor-vel will go to zero)
I wonder if you have the motor turning whenever the carousel is enableed rather than only when the component commands it.
Can you explain what each of your actual digital outputs do? Regardless of the NGC routine the carousel motor should stop when it is in-position (motor-fwd and motor-rec will go false, motor-vel will go to zero)
I wonder if you have the motor turning whenever the carousel is enableed rather than only when the component commands it.
Please Log in or Create an account to join the conversation.
05 Dec 2022 15:49 - 05 Dec 2022 21:13 #258606
by mgm
Replied by mgm on topic Preparation for the self-construction of a carousel changer
hm2_7i76e.0.7i84.0.1.output-13
das schaltet ein Relais das den Antriebsmotor ein- und ausschaltet
hm2_7i76e.0.7i84.0.1.output-14
das schaltet ein Relais das die Drehrichtung des Motors bestimmt
M64 P12 lässt nur zu einen Zylinder aus- und einfahren, sonst nichts.
Ich habe den PWM-Ausgang in der Haupthälfte fest auf true gesetzt, damit ich den Motor am Motortreiber über den Enable-Pin ein- und ausschalten kann!
Wenn der Enable-Pin des Carousel Comp auf True geht ist folgendes:
die zu suchende Tasche wird angezeigt
enable = true
active = true
motor-vol =
0.025 motor-fwd = true
state = 2
wenn die rechte Tasche gefunden wird passiert folgendes :
aktivieren = falsch
active = false
ready = true
motor-vol = 0
motor fwd = false
state = 0
wenn ich jetzt enable vom carousel comp wieder auf true setze ready wird false aber sonst passiert nichts!
Erst jetzt, wenn ich deine neue Tasche rufe, wird diese angezeigt und das Karussell startet.
Es sieht also so aus, als wäre der Karussell-Comp noch nicht fertig, aber warum?
Das interessante an der ganzen Geschichte ist:
ändere ich die hal, so startet das Programm mit dem Fehler
O100 if [#5399 EQ -1]
(DEBUG, failed to carousel pocket)
M65 P10
O100 endif
abbricht geht auch ready to false!
das schaltet ein Relais das den Antriebsmotor ein- und ausschaltet
hm2_7i76e.0.7i84.0.1.output-14
das schaltet ein Relais das die Drehrichtung des Motors bestimmt
M64 P12 lässt nur zu einen Zylinder aus- und einfahren, sonst nichts.
Ich habe den PWM-Ausgang in der Haupthälfte fest auf true gesetzt, damit ich den Motor am Motortreiber über den Enable-Pin ein- und ausschalten kann!
Wenn der Enable-Pin des Carousel Comp auf True geht ist folgendes:
die zu suchende Tasche wird angezeigt
enable = true
active = true
motor-vol =
0.025 motor-fwd = true
state = 2
wenn die rechte Tasche gefunden wird passiert folgendes :
aktivieren = falsch
active = false
ready = true
motor-vol = 0
motor fwd = false
state = 0
wenn ich jetzt enable vom carousel comp wieder auf true setze ready wird false aber sonst passiert nichts!
Erst jetzt, wenn ich deine neue Tasche rufe, wird diese angezeigt und das Karussell startet.
Es sieht also so aus, als wäre der Karussell-Comp noch nicht fertig, aber warum?
Das interessante an der ganzen Geschichte ist:
ändere ich die hal, so startet das Programm mit dem Fehler
O100 if [#5399 EQ -1]
(DEBUG, failed to carousel pocket)
M65 P10
O100 endif
abbricht geht auch ready to false!
Last edit: 05 Dec 2022 21:13 by mgm.
Please Log in or Create an account to join the conversation.
05 Dec 2022 16:02 #258609
by andypugh
Is your carousel bidirectional or single direction? The motor should be turned on or off by motor-fwd/rev. If it is a single-direction changer then just use:
net motor-on carousel.0.motor-fwd hm2_7i76e.0.7i84.0.1.output-13 hm2_7i76e.0.7i84.0.1.output-14
If it is bidirectional than you can try
net motor-on carousel.0.active hm2_7i76e.0.7i84.0.1.output-13
net motor-fwd carousel.0.motor-fwd hm2_7i76e.0.7i84.0.1.output-14
In either case, the motor needs to be turned on/off by the component not by the G-code.
That's odd, if it is still in position it should go back to ready. What is the "state" when that happens?
Replied by andypugh on topic Preparation for the self-construction of a carousel changer
hm2_7i76e.0.7i84.0.1.output-13
this switches a relay which switches the drive motor on and off
hm2_7i76e.0.7i84.0.1.output-14
this switches a relay which determines the direction of rotation of the motor
Is your carousel bidirectional or single direction? The motor should be turned on or off by motor-fwd/rev. If it is a single-direction changer then just use:
net motor-on carousel.0.motor-fwd hm2_7i76e.0.7i84.0.1.output-13 hm2_7i76e.0.7i84.0.1.output-14
If it is bidirectional than you can try
net motor-on carousel.0.active hm2_7i76e.0.7i84.0.1.output-13
net motor-fwd carousel.0.motor-fwd hm2_7i76e.0.7i84.0.1.output-14
In either case, the motor needs to be turned on/off by the component not by the G-code.
if i now set enable from the carousel comp back to true ready becomes false but nothing else happens!
That's odd, if it is still in position it should go back to ready. What is the "state" when that happens?
Please Log in or Create an account to join the conversation.
05 Dec 2022 16:40 - 05 Dec 2022 18:16 #258612
by mgm
Replied by mgm on topic Preparation for the self-construction of a carousel changer
i have now changed the hal as suggested:
net motor-on carousel.0.motor-fwd hm2_7i76e.0.7i84.0.1.output-13
now i have the following status:
-enable = true
- active = false
- state = 9
the carousel comp is now blocked, i can't do more!
- enable = false
- active = false
- state = 0
and ready = true
enable I have connected so that I can start the carousel
car-enable motion.digital-out-10 carousel.0.enable
this is the current hal for the changer
net motor-on carousel.0.motor-fwd hm2_7i76e.0.7i84.0.1.output-13
now i have the following status:
-
- active = false
- state = 9
the carousel comp is now blocked, i can't do more!
- enable = false
- active = false
- state = 0
and ready = true
this is the current hal for the changer
Attachments:
Last edit: 05 Dec 2022 18:16 by mgm.
Please Log in or Create an account to join the conversation.
06 Dec 2022 00:46 #258643
by andypugh
Replied by andypugh on topic Preparation for the self-construction of a carousel changer
Answering the crossed-out parts
It stays in state 9 until the enable is taken low again.
It stays in state 9 until the enable is taken low again.
Please Log in or Create an account to join the conversation.
06 Dec 2022 08:55 #258682
by mgm
Replied by mgm on topic Preparation for the self-construction of a carousel changer
so after I slept a night over it, I tested again this morning and what can I say:
hardly makes it right it also works ....
It does exactly what it should!
Show bag with M68 E0 Qx
start carousel with M64 Px
!!! wait until carousel is ready !!!
carousel beebden with M65 Px
select new pocket and straten again Perfeckt!
Thanks Andy for the patient support !!!
My problem is with the test program!
hardly makes it right it also works ....
It does exactly what it should!
Show bag with M68 E0 Qx
start carousel with M64 Px
!!! wait until carousel is ready !!!
carousel beebden with M65 Px
select new pocket and straten again Perfeckt!
Thanks Andy for the patient support !!!
My problem is with the test program!
Please Log in or Create an account to join the conversation.
06 Dec 2022 09:57 #258685
by mgm
Replied by mgm on topic Preparation for the self-construction of a carousel changer
I have now changed my program as follows:
o<test_carousel>sub
M68 E0 Q#<selected_tool>
M64 P10 ; start carousel
M66 P10 L3 Q30
G4 P2
O100 if [#5399 EQ -1]
(DEBUG, failed to carousel pocket)
M65 P10
O100 endif
M65 P10 ; stop carousel
o<test_carousel> endsub
M2
M66 P10 L3 Q30
has only the disadvantage that I must always wait so long until Q30 is expired!
If I shorten the time, it can happen that the carousel is not yet ready and the time is already expired.
How could I design this, or what can I still query to continue in the program after the carousel is ready?
o<test_carousel>sub
M68 E0 Q#<selected_tool>
M64 P10 ; start carousel
M66 P10 L3 Q30
G4 P2
O100 if [#5399 EQ -1]
(DEBUG, failed to carousel pocket)
M65 P10
O100 endif
M65 P10 ; stop carousel
o<test_carousel> endsub
M2
M66 P10 L3 Q30
has only the disadvantage that I must always wait so long until Q30 is expired!
If I shorten the time, it can happen that the carousel is not yet ready and the time is already expired.
How could I design this, or what can I still query to continue in the program after the carousel is ready?
Please Log in or Create an account to join the conversation.
06 Dec 2022 10:25 #258686
by andypugh
Replied by andypugh on topic Preparation for the self-construction of a carousel changer
M66 should return as soon as the condition is true. If it gets to the end of the set time then that is when it sets the error flag.
ie, it will wait _at_most_ for Q seconds.
I think there is a mismatch betweenand
Should the P10 be P4 ?
ie, it will wait _at_most_ for Q seconds.
I think there is a mismatch between
net car-ready carousel.0.ready motion.digital-in-04
M66 P10 L3 Q30
Should the P10 be P4 ?
Please Log in or Create an account to join the conversation.
06 Dec 2022 10:45 #258687
by mgm
Replied by mgm on topic Preparation for the self-construction of a carousel changer
Andy you are the greatest guy in the world
thank you so much for your help!
yes after I changed it from P10 to P4 everything works great ...
thank you so much for your help!
yes after I changed it from P10 to P4 everything works great ...
Please Log in or Create an account to join the conversation.
- Configuring LinuxCNC
- Advanced Configuration
- Preparation for the self-construction of a carousel changer
Time to create page: 0.226 seconds