- Configuring LinuxCNC
- Advanced Configuration
- Is there a bug in the carousel component or am I doing it wrong ATC Denford
Is there a bug in the carousel component or am I doing it wrong ATC Denford
- Aciera
-
- Away
- Administrator
-
Less
More
- Posts: 4409
- Thank you received: 1968
01 May 2025 12:14 - 03 May 2025 04:55 #327420
by Aciera
Replied by Aciera on topic Is there a bug in the carousel component or am I doing it wrong ATC Denford
Looking at these sections in 'carousel.comp' makes met think that the reverse action does not work in 'counts' mode :
Note that there is nothing changing 'counts_target'.
if (rev_pulse > 0){
motor_fwd = 0;
motor_rev = 1;
motor_vel = rev_dc;
timer = rev_pulse;
state = 3;
[snip]
case 3: // timed reverse pulse
timer -= fperiod;
if (timer > 0) return;
Note that there is nothing changing 'counts_target'.
Last edit: 03 May 2025 04:55 by Aciera.
Please Log in or Create an account to join the conversation.
- Aciera
-
- Away
- Administrator
-
Less
More
- Posts: 4409
- Thank you received: 1968
01 May 2025 12:19 - 01 May 2025 12:29 #327421
by Aciera
Replied by Aciera on topic Is there a bug in the carousel component or am I doing it wrong ATC Denford
I once helped a user who needed to get a ATC turret working that used a stepper and needed to lock the tool by rotating backwards against a pawl (which I _think_ is what yours does):
To get this working we modified a component called 'toolchanger'. The final version is attached here:
forum.linuxcnc.org/38-general-linuxcnc-q...lved?start=80#188377
To get this working we modified a component called 'toolchanger'. The final version is attached here:
forum.linuxcnc.org/38-general-linuxcnc-q...lved?start=80#188377
Last edit: 01 May 2025 12:29 by Aciera.
The following user(s) said Thank You: Adam Maszynotwór
Please Log in or Create an account to join the conversation.
- andypugh
-
- Offline
- Moderator
-
Less
More
- Posts: 23362
- Thank you received: 4964
03 May 2025 10:13 - 06 May 2025 11:28 #327590
by andypugh
Replied by andypugh on topic Is there a bug in the carousel component or am I doing it wrong ATC Denford
I don't think that counts mode _can_ work with a Boxford style of toolchanger as the number of steps lost when the motor stalls against the endstop is unknown.
It could be modified to work, but it might be easier to start from scratch as a single-sensor position-mode stepgen changer wasn't really considered when the component was written.
You could even consider doing all the control in the G-code subroutine:
1) Scale the stepgen so that a position shift of 1 is one pocket.
2) Connect motion.analog-in-00 to the stepgen.2.position-fb
3) Connect motion.analog-out-01 to the stepgen.2.posiiton-cmd
4) Connect the home sensor to motion.digital-in-02
(Actually, you can use any numberered analog/digital IO, you would probably use in, out and digital 00 in practice, but I made them different for clarity)
toolchange.ngc:
It could be modified to work, but it might be easier to start from scratch as a single-sensor position-mode stepgen changer wasn't really considered when the component was written.
You could even consider doing all the control in the G-code subroutine:
1) Scale the stepgen so that a position shift of 1 is one pocket.
2) Connect motion.analog-in-00 to the stepgen.2.position-fb
3) Connect motion.analog-out-01 to the stepgen.2.posiiton-cmd
4) Connect the home sensor to motion.digital-in-02
(Actually, you can use any numberered analog/digital IO, you would probably use in, out and digital 00 in practice, but I made them different for clarity)
toolchange.ngc:
O<toolchange> SUB
O100 IF [#<_carousel_homed> EQ 0] ; Do we need to home?
M66 E0 L0 ; read current stepgen pos into #5399
M68 E1 Q[10 + #5399] ; set the carousel in motion, by more than the number of pockets past the current pos
M66 P2 L1 Q20 ; Wait for the home pin
O200 IF [#5399 LT 0]
(abort, home timeout)
O200 ENDIF ; end of timeout check
M66 E0 L0 ; read home pin pos into #5399
M68 E1 Q[#5399] ; goto home pin, might need an offset here
G4 P5 ; wait for stop
#<_carousel_homed> = 1 ; mark homing as done
O100 ENDIF ; end of homing
(Normal toolchange without homing)
M66 E0 L0 ; read current stepgen pos into #5399
#1 = #<_selected+pocket> - #<_current_pocket> ; calculate move distance
O300 IF [#1 LT 0] if moving to a lower number
#1 = [#1 + 8] ; for an 8-pocket changer
O300 ENDIF
M68 E1 Q[#1 + #5399] ; move the requisite number of pockets
G4 P10 ; Wait (should really wait-on-input on a stepgen-in-position signal)
M68 E1 Q[#1 + #5399 - 1] ; move back against the stop
G4 P2 ; wait to stall against the stop
M6 T<_selected_tool> G43 ; change the tool, set offsets
O<toolchange> ENDSUB ; Done
Last edit: 06 May 2025 11:28 by andypugh. Reason: Forgot to set the homing parameter
The following user(s) said Thank You: tommylight, Adam Maszynotwór
Please Log in or Create an account to join the conversation.
- Adam Maszynotwór
-
Topic Author
- Offline
- Junior Member
-
Less
More
- Posts: 39
- Thank you received: 6
03 May 2025 16:51 - 03 May 2025 16:52 #327609
by Adam Maszynotwór
Replied by Adam Maszynotwór on topic Is there a bug in the carousel component or am I doing it wrong ATC Denford
Thank you for presenting other approaches to the subject. It allows me to better understand the general principle of operation of various concepts and HAL structures
I will test your suggestions (it will take me some time) and I will definitely describe it on the forum so that it will be helpful for other and so that they do not bother you with nonsense like me hehe
)
I will test your suggestions (it will take me some time) and I will definitely describe it on the forum so that it will be helpful for other and so that they do not bother you with nonsense like me hehe

Last edit: 03 May 2025 16:52 by Adam Maszynotwór.
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
- Configuring LinuxCNC
- Advanced Configuration
- Is there a bug in the carousel component or am I doing it wrong ATC Denford
Time to create page: 0.069 seconds