Small victory in the war against the Cincinnati cinturn 12u

More
02 Dec 2022 02:15 - 02 Dec 2022 02:21 #258284 by smc.collins
that would be this pin here, that still doesn't explain the abort behavior where the dwell time G4 p4 is clearly being ignored unless the lack of input is causing a recursive type failure ,, sort of a , oh, theres no input signal here, I'll just go do fuck all and ignore the rest of the code before I am called,  and there ZERO debug info or errors about it. That would be VERY troubling

in the hal currently
#assign locked pin
net car-locked <= hm2_5i25.0.7i77.0.0.input-00

should I also

net car-locked motion.digital-in01 
Last edit: 02 Dec 2022 02:21 by smc.collins.

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

More
02 Dec 2022 02:28 #258286 by andypugh
You said that the g-code subroutine was aborting with a message "failed to lock carousel"
If that is the case then it is aborting because motion.digital-in-01 is not going true (L3) within 1 second (Q1) of the carousel lock output being set.
So, yes, you _absolutely_ need to connect motion.digital-in-01 to _something_ which does the right thing at that point.

Of course, you only vaguely hinted once that this was the abort message. So perhaps I am working on a false assumption.

And, whilst it is clear to _you_ that the G4 P4 is being ignored I have no idea why you believe that and can't even see a G4 P4 anywhere in your NGC file.

In the version I am looking at there is a G4 P5 just after the carousel-align check. And I have no idea what you want that to do. What are you waiting for at that point?

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

More
02 Dec 2022 03:00 - 02 Dec 2022 03:15 #258291 by smc.collins
i need the unclamp solenoid to stay on for a few seconds to allow the turret to center in the alignment cam at motor turn of. there's a 6 lobe cam with a hydraulic ram the is fed pressure from the motor hydraulic circuit. so that ram gets oil diverted to the motor, at motor off it goes back to the ram, the carousel needs to settle before the unclamp solenoid turns off so it can align and return to the locking teeth, there are alignment positions in the back if the turret face. if they don't align, the turret fails to clamp fully and the 01 switch will not turn on and 00 will not turn off. 

my NGC file on the machine does have the G4 P4 command

it's either that or i need to cycle the turret clamp solenoid to settle the turret i to position, that doesn't work either. 

as soon as the turret turns off, it ignores all following gcode. 

is there a way to watch gcode execution to see where it aborts or fails. do you have a code execution flowchart ? or even a a signal map for required Io etc ?? 

 
Last edit: 02 Dec 2022 03:15 by smc.collins.

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

More
02 Dec 2022 11:21 #258309 by andypugh

is there a way to watch gcode execution to see where it aborts or fails. do you have a code execution flowchart ? or even a a signal map for required Io etc ?? 


In this case the required IO depends on your G-code subroutine. And only you know what that needs to do.

You can monitor motion.program-line with a halmeter, but that shows zero except when the subroutine is moving an axis so doesn't help very much.

Try adding some (debug, ) statements to your code, for example
(debug, At entry selected tool is #<selected_tool>)
(debug, At entry selected pocket is #<selected_pocket>)
...
(debug, Carousel stopped, P0 = #5399) 

That sort of thing.

Your G-code routine can only abort at the abort points, and those all print a message to the screen, so should be obvious.

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

More
02 Dec 2022 18:15 #258342 by smc.collins
o<toolchange> sub



; only unload the tool if there is a tool in the spindle
; This assumes that the carousel is already aligned correctly.
; It is important to unload the tool before shutting down the machine.


G53 G0 X16.00

O100 IF [#<selected_tool> GT 0]

M65 P1 ; unlock carousel
M66 P1 L4 Q1 ; wait for locked=false

O106 if [#5399 LT 0]
(abort, failed to unlock carousel)
O106 endif

M68 E0 Q#<selected_pocket> ;set the carousel to move to the right pocket

M64 P0 ; start carousel

G4 P5

M64 P1 ; lock carousel
M66 P1 L3 Q1 ; wait for locked=true
O108 if [#5399 LT 0]
(abort, failed to lock carousel)
O108 endif









O100 ENDIF





o<toolchange> endsub [1]


M2

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

More
02 Dec 2022 18:18 - 02 Dec 2022 19:40 #258343 by smc.collins
loadrt carousel pockets=6 dir=1 encoding=bcd num_sense=3
loadrt conv_float_s32
addf carousel.0 servo-thread
addf conv-float-s32.0 servo-thread # G-code analogue outputs are float-type

net car-enable motion.digital-out-00 carousel.0.enable
net car-ready motion.digital-in-00
net car-pos-req motion.analog-out-00 conv-float-s32.0.in
net car-pos-s32 conv-float-s32.0.out carousel.0.pocket-number


#Signal Connections to Hal Components
net car-fwd carousel.0.motor-fwd
net car-lock carousel.0.active
net carousel.0.in carousel.0.strobe


#Digital inputs
net bit0 carousel.0.sense-0 <= hm2_5i25.0.7i77.0.0.input-04
net bit1 carousel.0.sense-1 <= hm2_5i25.0.7i77.0.0.input-05
net bit2 carousel.0.sense-2 <= hm2_5i25.0.7i77.0.0.input-06
net carousel.0.in <= hm2_5i25.0.7i77.0.0.input-03


#Carousel Ready
net car-ready <= hm2_5i25.0.7i77.0.0.input-01-not

#assign locked pin
net car-locked <= hm2_5i25.0.7i77.0.0.input-00

#assign to turret unclamp relay
net car-lock => hm2_5i25.0.7i77.0.0.output-05

#assign to turret rotate motor relay
net car-fwd => hm2_5i25.0.7i77.0.0.output-08


#net tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared
net tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed

loadusr sim_pin carousel.0.jog-fwd
Last edit: 02 Dec 2022 19:40 by smc.collins.

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

More
02 Dec 2022 18:21 - 03 Dec 2022 01:44 #258344 by smc.collins
these are the latest configurations files with all of the changes that have been suggested thus far, I have the exact same issue no matter what I change. The pause at g4 p5 is being ignored and the carousel will not properly align to lock without it. I can manually cycle the carousel unclamp solenoid and it settles and then it resets the switch, it also means that the carousel is out of position mechanically and it will stop in a inconsistent way and this will make tool position unreliable. Whats further more troubling is that this g4 p5 command work in the vismach sim configuration, I know I tested it thoroughly. Is there some other issue with velocity etc that could be causing this issue ?


this might be a new error, but I didn't realize that the toolbar was obscuring the axis window. 

Failed to lock carousel
Position : relative actual

I am also attaching a link video of the carousel in motion and the behavior. at the end of the video you can see the issue with the lack of pause, it doesn't lock properly.  I am starting to suspect that the issue is overshoot after motor shutoff, and it is something I have no idea on how to deal with in software, I don't think a strobe debounce will solve this either unless the debounce period can be several seconds. 

youtube.com/shorts/e_Uikzbdg9Y?feature=share

the halscope.zip is the scope config and a recording of every channel I could think of 16 in total. i don't know exactly how carousel is decoding bcd, i didn't really look that deep at the code, but is is possible that the BCD switches need to be ordered differently ?  ie swap sense 1 and 3??
Attachments:
Last edit: 03 Dec 2022 01:44 by smc.collins.

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

More
05 Dec 2022 17:03 #258614 by smc.collins
does the bcd coding need a parity bit ?? i have a 4th switch on the turret cam, and it's unused by the Arcamatic
900 controls but it could probably be used here, it's for a optional 7 station tool changer per my schematics

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

More
06 Dec 2022 01:50 - 06 Dec 2022 01:51 #258655 by andypugh
Parity probably won't help.

Are you sure that it is BCD and not plain binary or Gray code?
(It's hard to tell from the halscope log as there is only a single sample with a "strobe" bit set.)

"Failed to lock carousel" means that the "wait on input" is timing out.
I already mentioned this, and told you how to fix it... forum.linuxcnc.org/26-turning/47050-smal...12u?start=130#258286
Last edit: 06 Dec 2022 01:51 by andypugh.

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

More
06 Dec 2022 02:57 - 07 Dec 2022 23:11 #258660 by smc.collins
I fixed all of my stupid bugs, I took a few days off and got some sleep, really helped. So, now it's down to carousel position failures. this pattern looks difficult to contend with. Failed to align
Last edit: 07 Dec 2022 23:11 by smc.collins.

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

Moderators: piasdom
Time to create page: 0.100 seconds
Powered by Kunena Forum