ATC Project - Debug phase
All,
Starting a tool changer build and could use some assistance with the LCNC side of things. Maybe the mechanical stuff, too, but I think I've got that figured out.
Here's the plan:
- Design - bog-standard carousel disk arrangement
- Disk rotation - stepper motor controlled by Mesa 7i76 in pulse/dir mode.
- Carriage slide - 2-way air cylinder
- Spindle - encoder w/index, connected 1:1 via belt.
- Encoder & index already connected to Mesa.
- Motor driven by VFD
- VFD has no internal homing or positioning functions.
- Drawbar - pneumatic PDB
- Air valve is currently connected to Mesa through a relay
- Cylinder has a piston position sensor connected to Mesa
- Working fine now manually (both sensor and actuation)
- Sensors - separate PNP-NC for each of
- PDB Cylinder up (tool clamped)
- Slide in
- Slide out
- Disk index/home (one pulse per rev)
- Disk position (one pulse per slot)
As far as LCNC goes, I'm planning to use the ORIENT and CAROUSEL components. I've browsed through a few sample configs posted here and I think I've got a very basic idea.
Second question - how do I connect the CAROUSEL pins to the joint pins in HAL? Or is there no joint? I'm unclear on the basic scheme of connecting CAROUSEL to the Mesa step outputs. I sort of get using a couple of relays connected to carousel.N.motor-fwd or carousel.N.motor-rev pins for a 'dumb' DC motor, but the connections from "T1M6" to the stepper drive inputs is hazy.
Third question: should I be using some other Lcnc control scheme than CAROUSEL?
Note - I have no idea how to code anything in python or C or other computer language, and I'm very reluctant to expend time & energy stumbling through yet another foreign language. Yes, I'm sure it's insanely powerful but I've got limited brainpower. I kinda understand HAL now, a little Classic Ladder, and G-code - that's about it.
Comments & suggestions are most welcome.
-Ralph
Please Log in or Create an account to join the conversation.
Second question - how do I connect the CAROUSEL pins to the joint pins in HAL? Or is there no joint?
There is no joint.
I'm unclear on the basic scheme of connecting CAROUSEL to the Mesa step outputs. I sort of get using a couple of relays connected to carousel.N.motor-fwd or carousel.N.motor-rev pins for a 'dumb' DC motor, but the connections from "T1M6" to the stepper drive inputs is hazy.
Use a stepgen in velocity mode, and then wire the carousel.N.motor-vel to stepgen.N.velocity-cmd
Adjust the speed with the fwd-dc and rev-dc pins of carousel.
Please Log in or Create an account to join the conversation.
I'm sure I'll be back with more questions as I get to the bench testing phase.
-R
Please Log in or Create an account to join the conversation.
Having a bit of a struggle finding an example of a simple velocity mode stepgen arrangement. There are plenty of control-type "1" examples for axis/joints (PnCconf does a nice job), but I can't seem to find a basic example to use for simple FWD/REV in the carousel function.
I've got this from my A-axis section of HAL:
setp [HMOT](CARD0).stepgen.03.dirsetup [JOINT_3]DIRSETUP
setp [HMOT](CARD0).stepgen.03.dirhold [JOINT_3]DIRHOLD
setp [HMOT](CARD0).stepgen.03.steplen [JOINT_3]STEPLEN
setp [HMOT](CARD0).stepgen.03.stepspace [JOINT_3]STEPSPACE
setp [HMOT](CARD0).stepgen.03.position-scale [JOINT_3]STEP_SCALE
setp [HMOT](CARD0).stepgen.03.step_type 0
setp [HMOT](CARD0).stepgen.03.control-type 1
setp [HMOT](CARD0).stepgen.03.maxaccel [JOINT_3]STEPGEN_MAXACCEL
setp [HMOT](CARD0).stepgen.03.maxvel [JOINT_3]STEPGEN_MAXVEL
Do I just replace the [JOINT...} INI file values with values right in HAL, then add:
net Carousel-vel <= carousel.0.motor-vel
net Carousel-vel => [HMOT](CARD0).stepgen.03.velocity-cmd
Missing anything?
-R
Please Log in or Create an account to join the conversation.
Do I just replace the [JOINT...} INI file values with values right in HAL,
You can do that, or add your own INI entries and reference those in the HAL.
net Carousel-vel <= carousel.0.motor-vel
net Carousel-vel => [HMOT](CARD0).stepgen.03.velocity-cmd
Looks right.
Please Log in or Create an account to join the conversation.
It's spinning now - very satisfying.
I'm doing basic testing now, no toolghange.ngc or remap yet. Just manually triggering the various hardware bits to check function and I've encountered the next problem:
The carousel is index mode, so according to the document triggering carousel.0.enable starts a homing routine. It should then start rotating until both the index and pulse pins go high and then it stops and considers that location to be pocket 1.
M64 P0 starts the rotation, and carousel.0.enable goes high, but the carousel just keep rotating forever. Both sense-0 and sense-1 go high each time it rotates past, but it doesn't seem to conclude the homing process.
carousel.0.ready goes high the first time sense-0 and sense-1 go high
carousel.0.active goes high whenever it's rotating
carousel.0.current-position changes to 1 after the first sense-0 & -1 trigger.
M68 E0 Qnnn changes carousel.pocket-number, but it still keep rotating.
Is this a hal mis-wire or a misunderstanding on my part on how it's supposed to work?
HAL snippet:
net ATC_PULSE <= [HMOT](CARD0).7i76.0.0.input-05-not #pulse proximity sensor; 1/per pocket
net ATC_PULSE => carousel.0.sense-1
net ATC_INDEX <= [HMOT](CARD0).7i76.0.0.input-06-not #index proximity sensor; 1/per rev
net ATC_INDEX => carousel.0.sense-0
net ATC_RETRACT_SENS <= [HMOT](CARD0).7i76.0.0.input-08 #retracted proximity sensor
net ATC_RETRACT_SENS => motion.digital-in-02
net ATC_EXTEND_SENS <= [HMOT](CARD0).7i76.0.0.input-07 #extended proximity sensor
net ATC_EXTEND_SENS => motion.digital-in-01
net PDB_PROXY-UP <= [HMOT](CARD0).7i76.0.0.input-09-not #draw bar cylinder UP proximity sensor
net UNCLAMP_TOOL_BUTTON <= [HMOT](CARD0).7i76.0.0.input-04 #manual pushbutton
net UNCLAMP_TOOL_BUTTON => xor2.0.in0
net UNCLAMP_TOOL_TOOLCHANGE <= motion.digital-out-03
net UNCLAMP_TOOL_TOOLCHANGE => xor2.0.in1
net PDB_RELEASE <= xor2.0.out
net PDB_RELEASE => [HMOT](CARD0).7i76.0.0.output-08 #draw bar cylinder solenoid valve
net ATC_POS_REQ <= motion.analog-out-00
net ATC_POS_REQ => conv-float-s32.0.in
net ATC_POS_S32 <= conv-float-s32.0.out
net ATC_POS_S32 => carousel.0.pocket-number
net ATC_ENABLE <= motion.digital-out-00
net ATC_ENABLE => carousel.0.enable
#net ATC_ENABLE => [HMOT](CARD0).7i76.0.0.output-00
net ATC_READY <= carousel.0.ready
net ATC_READY => motion.digital-in-00
net ATC_EXTEND_VALVE <= motion.digital-out-01
net ATC_EXTEND_VALVE => [HMOT](CARD0).7i76.0.0.output-03 #rodless cylinder extend solenoid valve
net ATC_RETRACT_VALVE <= motion.digital-out-02
net ATC_RETRACT_VALVE => [HMOT](CARD0).7i76.0.0.output-02 #rodless cylinder retract solenoid valve
net ATC_PREP_LOOP <= iocontrol.0.tool-prepare
net ATC_PREP_LOOP => iocontrol.0.tool-prepared
net ATC_CHANGE_LOOP <= iocontrol.0.tool-change
net ATC_CHANGE_LOOP => iocontrol.0.tool-changed
setp carousel.0.fwd-dc 5
setp carousel.0.rev-dc 5
## Step Gen signals/setup
setp [HMOT](CARD0).stepgen.03.dirsetup 10000 #[JOINT_3]DIRSETUP
setp [HMOT](CARD0).stepgen.03.dirhold 10000 #[JOINT_3]DIRHOLD
setp [HMOT](CARD0).stepgen.03.steplen 2500 #[JOINT_3]STEPLEN
setp [HMOT](CARD0).stepgen.03.stepspace 2500 #[JOINT_3]STEPSPACE
setp [HMOT](CARD0).stepgen.03.position-scale 340.0 #[JOINT_3]STEP_SCALE
setp [HMOT](CARD0).stepgen.03.step_type 0
setp [HMOT](CARD0).stepgen.03.control-type 1
setp [HMOT](CARD0).stepgen.03.maxaccel 225 #[JOINT_3]STEPGEN_MAXACCEL
setp [HMOT](CARD0).stepgen.03.maxvel 500 #[JOINT_3]STEPGEN_MAXVEL
net CAROUSEL-VEL <= carousel.0.motor-vel
net CAROUSEL-VEL => [HMOT](CARD0).stepgen.03.velocity-cmd
Please Log in or Create an account to join the conversation.
[didn't want to edit the last and hose up the formatting]
carousel.0.jog-rev rotates the carousel in the same direction.
I stopped it in a random spot (after carousel.0.enable) with M65 P0. I then set jog-fwd to high in hal-show and it moved forward to the next pin.
carousel.0.current-position counted up (Yay!)
Clearing jog-fwd and setting jog-rev cause the carousel to rotate in the same direction and stop at the next pin. Current position went DOWN by one increment.
loadrt carousel pockets=18 encoding=index num_sense=18 dir=2 (means it should be bi-directional, right?)
This motor & drive was working fine (CW/CCW) as my A-axis until recently, so no hardware concerns.
So carousel.comp is moving and counting up and down, but the motor is only rotating one direction.
Why yes, in fact, carousel.0.rev-dc DOES need to be a negative number. Ignore the above...
Still have an issue with the homing - keep rotating indefinately until I kill it with an M65 P0.
Please Log in or Create an account to join the conversation.
forum.linuxcnc.org/38-general-linuxcnc-q...t-home?start=0#75754
and
forum.linuxcnc.org/49-basic-configuratio...carousel-comp#190966
Please Log in or Create an account to join the conversation.
Still have an issue with the homing - keep rotating indefinately until I kill it with an M65 P0.
Looking at the code, it shouldn't...
What is the "state" pin showing in this scenario? Does the "homed" pin set?
Please Log in or Create an account to join the conversation.
Download this file:
raw.githubusercontent.com/LinuxCNC/linux...onents/carousel.comp
then issue the command
sudo halcompile --install carousel.comp
Please Log in or Create an account to join the conversation.