ATC Project - Debug phase

More
07 Apr 2022 20:17 #239578 by spumco
[LCNC 2.9, Probe Basic GUI (python3 branch), Mesa 7i76ED]

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)
First question: Anyone see anything I'm missing on the hardware or sensor side?

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.

More
07 Apr 2022 22:31 - 07 Apr 2022 22:32 #239605 by andypugh

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.
Last edit: 07 Apr 2022 22:32 by andypugh.
The following user(s) said Thank You: spumco

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

More
07 Apr 2022 22:55 #239610 by spumco
Replied by spumco on topic ATC Project - Planning phase
Very helpful Andy.

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.

More
15 May 2022 01:55 #242996 by spumco
Replied by spumco on topic ATC Project - Planning phase
I've got the mechanicals done to the point where I'm working on the HAL side of the ATC.

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.

More
17 May 2022 00:05 #243118 by andypugh

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.
The following user(s) said Thank You: spumco

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

More
17 May 2022 02:48 #243124 by spumco
Replied by spumco on topic ATC Project - Debug phase
WOO!

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:
Warning: Spoiler!

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

More
17 May 2022 02:56 - 17 May 2022 03:08 #243125 by spumco
Replied by spumco on topic ATC Project - Debug phase
UPDATE
[didn't want to edit the last and hose up the formatting]

carousel.0.jog-fwd seems to work.
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.


Looks like I've got a stepgen config issue.  Unless carousel.0.rev-dc needs to be a negative number?

Anything obvious come to mind?

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.
Last edit: 17 May 2022 03:08 by spumco. Reason: Eureka!

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

More
17 May 2022 03:34 #243126 by spumco

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

More
17 May 2022 15:12 #243169 by andypugh
Replied by andypugh on topic ATC Project - Debug phase

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.

More
17 May 2022 15:16 #243170 by andypugh
Replied by andypugh on topic ATC Project - Debug phase
Actually, this should be a fixed bug, but might not have been released yet.

Download this file:
raw.githubusercontent.com/LinuxCNC/linux...onents/carousel.comp

then issue the command
sudo halcompile --install carousel.comp
and see if that fixes the behaviour

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

Time to create page: 0.104 seconds
Powered by Kunena Forum