VMC related HAL questions.
The command name was changed
Please Log in or Create an account to join the conversation.
Let's see if I got this right..
#loadrt conv_float_s32 (Already loaded in sim_vmc.hal) "ThisIsNeededForRealMachine?"
addf carousel.0 servo-thread
addf conv-float-s32.2 servo-thread # G-code analogue outputs are float-type
net car-enable motion.digital-out-00 carousel.0.enable "??"
net car-ready carousel.0.ready motion.digital-in-00 "??"
net car-fwd carousel.0.motor-fwd "StartCarouselMotorOutput"
#net car-rev carousel.0.motor-rev "StartCarouselMotorOutputReverse"
net car-pos-req motion.analog-out-00 conv-float-s32.2.in "NoChangeNeeded?"
net car-pos-s32 conv-float-s32.2.out carousel.0.pocket-number "NoChangeNeeded?"
net bit0 "CarouselPosSensorFirstPin" for example: hm2_5i25.0.7i77.0.0.input-20-not
net bit1
net bit2
net bit3
net bit4
net car-lock "LockCarouselOutput"
net car-locked "CarouselLockedInput"
net arm-act "MoveCarouselArmOutput"
net arm-in "ArmAtSpindleInput?"
net arm-out "ArmAwayFromSpindleInput"
net tool-release "DrawbarActOutput"
net tool-released "ToolReleasedInput"
net tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared "NoChangeNeeded?"
net tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed "NoChangeNeeded?"
Some thing that I realized when writing that:
I have an hydraulic pump that activates the drawbar and then A valve that releases the pressure and locking the tool in the spindle.
And as far I can tell that is not the way this hal-file is set up?
So for my machine it would be:
*Oriented and arm extended
1. Activate Pump
2. Wait for "tool released" sensor
3. Turn off Pump
4. Move Z
5. Unlock Carousel
6. Move Carousel
7. Lock Carousel
8. Move Z
9. Activate Pressure release valve
10. Retract Arm
Please Log in or Create an account to join the conversation.
Let's see if I got this right..
Warning: Spoiler!loadrt carousel pockets=15 (MyNumOfPockets) dir=1 (2 IfBiDirectionalCarousel?) encoding=gray num_sense=5 (NumOfCarouselSensPins)
In your case you need "encoding=bcd"
Some thing that I realized when writing that:
I have an hydraulic pump that activates the drawbar and then A valve that releases the pressure and locking the tool in the spindle.
And as far I can tell that is not the way this hal-file is set up?
In the demo that sequence is handled in the G-code toolchange routine. You need to make that suit your system, though it is already pretty close. You may need an extra output and an extra phase.
Please Log in or Create an account to join the conversation.
Could you please explain a few things in the .ngc?
G53 G0 Z -100 I know this
M64 P2 ; move arm in What links outputs/inputs like "P2" to a physical connection?
M66 P2 L3 Q5 ; wait for arm-in = true
O104 if [#5399 LT 0] #5399??
(abort, failed to move arm in)
O104 endif
EDIT: I'm stupid.. It's the "motion.digital-out-XX" that specifies that right?
Please Log in or Create an account to join the conversation.
loadrt carousel pockets=15 dir=1 encoding=bcd num_sense=5
loadrt conv_float_s32
addf carousel.0 servo-thread
addf conv-float-s32.2 servo-thread # G-code analogue outputs are float-type
net car-enable motion.digital-out-00 carousel.0.enable
net car-ready carousel.0.ready motion.digital-in-00
net hm2_5i25.0.7i77.0.0.input-16-not carousel.0.motor-fwd #ActivateCarouselMotorOutput
#net car-rev carousel.0.motor-rev
net car-pos-req motion.analog-out-00 conv-float-s32.2.in
net car-pos-s32 conv-float-s32.2.out carousel.0.pocket-number
net hm2_5i25.0.7i77.0.0.input-16-not carousel.0.sense-0
net hm2_5i25.0.7i77.0.0.input-17-not carousel.0.sense-1
net hm2_5i25.0.7i77.0.0.input-18-not carousel.0.sense-2
net hm2_5i25.0.7i77.0.0.input-19-not carousel.0.sense-3
net hm2_5i25.0.7i77.0.0.input-20-not carousel.0.sense-4
net hm2_5i25.0.7i77.0.0.output-08 motion.digital-out-01 #LockCarouselOutput
net hm2_5i25.0.7i77.0.0.input-21 motion.digital-in-01 #CarousellockedInput
net hm2_5i25.0.7i77.0.0.output-09 motion.digital-out-02 #ActivateArmOutput
net hm2_5i25.0.7i77.0.0.input-22 motion.digital-in-02 #ArmExtendedInput
net hm2_5i25.0.7i77.0.0.input-23 motion.digital-in-04 #ArmRetractedInput
net hm2_5i25.0.7i77.0.0.output-10 motion.digital-out-03 #ActivatePumpOutput
net hm2_5i25.0.7i77.0.0.output-11 motion.digital-out-04 #ActivateDrawbarReleaseValveOutput
net hm2_5i25.0.7i77.0.0.input-24 motion.digital-in-03 #ToolReleasedFromSpindleInput
net tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared
net tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed
This is the things I don't know what(or if) to change them to:
net car-enable motion.digital-out-00 carousel.0.enable
net car-ready carousel.0.ready motion.digital-in-00
net car-pos-req motion.analog-out-00 conv-float-s32.2.in
net car-pos-s32 conv-float-s32.2.out carousel.0.pocket-number
To answer my own question:
Parameter #5399 will have a value of -1 if the previous M66 times out. And therefore aborting the routine. Correct me if I'm wrong
But I still don't know where "#<tool_in_spindle>", "#<selected_tool>" and so on get their values from?
Please Log in or Create an account to join the conversation.
]Where does <tool_in_spindle> come from?
Some named parameters are standard:
linuxcnc.org/docs/2.7/html/gcode/overvie...ned-named-parameters
But #<tool_in_spindle> is not one of those. In this case the #<tool_in_spindle> G-code variable is set by the remapping function preamble:
When there is a "remap" setting in the INI file LinuxCNC looks for a file called toplevel.py, then that imports the remap code. In the case of the VMC demo that imports remap.py which is a tiny file that imports a standard part of the LinuxCNC code called stdglue.
github.com/jepler/linuxcnc-mirror/tree/m...smach/VMC_toolchange contains the toplevel and remap files, the stdglue file is here: github.com/jepler/linuxcnc-mirror/blob/m...n-stdglue/stdglue.py
where line 161 is "self.params["tool_in_spindle"] = self.current_tool"
You need to have the topevel and remap files in your own config too.
Please Log in or Create an account to join the conversation.
But what about these, do I need to change them or are they just "internal" connections?
net car-enable motion.digital-out-00 carousel.0.enable
net car-ready carousel.0.ready motion.digital-in-00
net car-pos-req motion.analog-out-00 conv-float-s32.2.in
net car-pos-s32 conv-float-s32.2.out carousel.0.pocket-number
Do the hal-file I posted look good? Or did I net something the wrong way around?
Please Log in or Create an account to join the conversation.
You probably should read the remapping page. Most of it isn't relevant, and there is a lot more there than you need to know, but it gives good background: linuxcnc.org/docs/2.7/html/remap/remap.htmlNo wonder I couldn't find them in your example config
It's one of those things to read through and accept that you won't understand fully, but you will get a feel for what is possible.
But what about these, do I need to change them or are they just "internal" connections?
net [b]car-enable[/b] motion.digital-out-00 carousel.0.enable net [b]car-ready[/b] carousel.0.ready motion.digital-in-00 net [b]car-pos-req[/b] motion.analog-out-00 conv-float-s32.2.in net [b]car-pos-s32[/b] conv-float-s32.2.out carousel.0.pocket-number
Those lines connect the G-code input and output commands to HAL pins, so that the NGC routine can operate the carousel component.
The "net" command automatically sets direction. See it like a bit of wire, the wire doesn't need to know the difference between the current source and the current sink.Do the hal-file I posted look good? Or did I net something the wrong way around?
Do you have spindle orient (M19) working? And does it need to work for your changer?
Please Log in or Create an account to join the conversation.
Yes I need orient and yes it's already working like a charm
I'll give it a try as soon as I figure out how to disable the manual toolchange dialog that I have used so far..
Please Log in or Create an account to join the conversation.
I'll give it a try as soon as I figure out how to disable the manual toolchange dialog that I have used so far..
The manual dialog is activated by being in the ioontrol.0.tool-change -> iocontrol.0.tool-changed loop. If it is not in that loop then it won't be called
Please Log in or Create an account to join the conversation.