Is there a bug in the carousel component or am I doing it wrong ATC Denford

  • Adam Maszynotwór
  • Adam Maszynotwór's Avatar Topic Author
  • Away
  • Junior Member
  • Junior Member
More
30 Apr 2025 14:10 - 30 Apr 2025 14:15 #327342 by Adam Maszynotwór
Hello, I'm starting to restore a lathe from scrap.


My problem is ATC (we'll get to the original ATC when I start the model)
Test model:
Step PIN8 dir PIN9 LPT stepper motor
Microstep 1600
4 pockets
1 gome sensor (pocket 1)
Head lock by left rotation (example video from the web)

Component linuxcnc.org/docs/html/man/man9/carousel.9.html
Basic lathe configuration

Symptoms:

T1M6 after starting linuxcnc looks for HOME and rewinds (strangely but it does rewind)
Each successive tool, e.g. T3M6, no longer rewinds
When I start from T2 M6 it passes HOME (activating it) but no longer rewinds while in position

My observations:
Dir changes but there is no movement. which means that there are no pulses flowing to PIN 8.
M66 waits for READY signal even though nothing is happening. Only after time has elapsed does the DIR state change and then it is READY

all files below
As you know I am not strong in HAL and in English please write as if to a child

O<changetool> sub
(debug, Tool change to T#<_selected_tool>)

M68 E0 Q#<_selected_tool>  ; Wybierz kieszeń
M64 P0                     ; Włącz karuzelę
G4 P2
; Czekaj max 15s na ready (z timeoutem)
M66 P0 L3 Q15

; Jeśli timeout, zatrzymaj karuzelę i zgłoś błąd
O100 if [#5399 EQ 0] (if timeout)
  M65 P0
  (msg, Toolchange FAILED - Timeout)
  M99
O100 endif

M65 P0                     ; Wyłącz karuzelę
(debug, Tool change OK)
O<changetool> endsub
M2

[code][code]loadrt stepgen step_type=0,0,0
loadrt carousel pockets=4 encoding=counts dir=1 num_sense=1

addf carousel.0 servo-thread

setp stepgen.2.steplen 1
setp stepgen.2.stepspace 0
setp stepgen.2.dirhold 35000
setp stepgen.2.dirsetup 35000
setp stepgen.2.maxvel 100
setp stepgen.2.maxaccel 150
setp stepgen.2.position-scale 1
net astep stepgen.2.step => parport.0.pin-08-out
setp parport.0.pin-08-out-reset 1
#net adir stepgen.2.dir => parport.0.pin-09-out
net adir carousel.0.motor-rev => parport.0.pin-09-out
#Konfiguracja carousel

setp carousel.0.scale 400
setp carousel.0.width 10
setp carousel.0.fwd-dc 10
setp carousel.0.rev-dc 100
setp carousel.0.rev-pulse 10
#Połączenie carousel z stepgen


net carousel-pos-cmd carousel.0.counts-target => stepgen.2.position-cmd
net carousel-counts carousel.0.counts <= stepgen.2.counts

net carousel-ready carousel.0.ready => iocontrol.0.tool-changed motion.digital-in-00

#net carousel-dir stepgen.2.dir <= carousel.0.motor-rev
net carousel-enable carousel.0.enable <= motion.digital-out-00
net carousel-enable stepgen.2.enable <= motion.digital-out-00
net carousel-pocket carousel.0.pocket-number <= iocontrol.0.tool-prep-number
net carousel-ready carousel.0.ready => iocontrol.0.tool-changed
net home-signal carousel.0.sense-0 <= parport.0.pin-10-in
#Toolchange
net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared



all files below
[/code][/code]
Attachments:
Last edit: 30 Apr 2025 14:15 by Adam Maszynotwór.

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

More
30 Apr 2025 14:22 #327346 by langdons
What languages are you good at?

I have encountered issues with the G4 command before.

HAL ≠ G-CODE

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

More
30 Apr 2025 14:26 - 30 Apr 2025 14:54 #327347 by langdons
For some reason, when I wrote G4 P1000, the program paused for far longer than 1000ms or 1 second.

No clue why.

What GUI are you using?

In theory, it should not matter, but it might make a difference.

I think QtDragon has toolchanger functionality.
Last edit: 30 Apr 2025 14:54 by langdons. Reason: Fixed typos

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

More
30 Apr 2025 14:54 #327354 by langdons
Don't worry about the toolchanger until the rest of the machine works.

It's not a 100% essential component.

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

  • Adam Maszynotwór
  • Adam Maszynotwór's Avatar Topic Author
  • Away
  • Junior Member
  • Junior Member
More
30 Apr 2025 16:42 #327369 by Adam Maszynotwór
I'm not good at typical programming languages. I'm best at G-code.

Here, G4 has to be because after reaching the pocket, the READY pin is active so the toolchange procedure runs without moving the engine

Yes, I know that ATC is not a priority, but I'm asking in advance (I'll eventually write ATC on CL .. I think that thanks to the knowledge I've gained from trying to start CAROUSEL, I'll manage, and if not, I'll treat it as an axis and use g-code)

This machine is a challenge because:
I've never used a tool magazine
I've never done anything on servos
I didn't have a Mesa card either
and here it will be all

GUI AXIS

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

Time to create page: 0.090 seconds
Powered by Kunena Forum