carousel.comp - jog-FWD still an issue
- tommylight
- Away
- Moderator
- Posts: 19460
- Thank you received: 6529
Tool 1 = sensor 1 active
How does the system know that it is at tool 1?What do i use for sensors on each tool.
No index or home,
tool 2 = sensor 2 active
etc.
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
- Posts: 23162
- Thank you received: 4860
101
011
101
011
101
...
All the way round.
An individual sensor for each position is mode "single" (possibly I could have chosen a more descriptive term)
Please Log in or Create an account to join the conversation.
- spumco
- Offline
- Platinum Member
- Posts: 1829
- Thank you received: 738
B.T.W. is it recomended to stop the spindle when changing tools on a lathe?
Never seen it stop. So how do i stop that.
It is if you switch from an M3 tool to an M4 tool
But no, normally it isn't stopped for same-direction tools. I have to edit my lathe programs because my F360 post calls an M5 at every tool change regardless of next-tool direction - and I haven't taken the time to try to edit the post.
-R
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
- Posts: 19460
- Thank you received: 6529
took a look at other stuff on the link provided by Andy, added also the line to send Z to machine 0 on tool change, as far as i can tell that is safer than changing them near the spindle/part.
Just finished soldering a lot of resistors and found 2 of TD62083 so made things a bit easier and quicker, still took 4 hours with wiring! Ouch!
Please Log in or Create an account to join the conversation.
- spumco
- Offline
- Platinum Member
- Posts: 1829
- Thank you received: 738
If you're not sick of this yet, the same problem is back. [Fresh install of MX21 & LCNC 2.10]
After a long hiatus and a new operator console, I'm at the point where I can finish up my ATC. Using the same ATC settings as last summer I attempted to do some testing.
Discovered that the carousel only moves in one direction. Jog-FWD & jog-REV both cause REV movement, and commanding a pocket change by setting carousel.0.pocket-number to a value which should result in FWD movement results in REV rotation.
As I mentioned last July all the pocket pins have been removed - just a home pin and a single sensor. Carousel still set to counts.
loadrt carousel pockets=18 encoding=counts num_sense=2 dir=2
setp carousel.0.scale [ATC]ATC_SCALE #stepgen pulses per pocket
setp carousel.0.width 5 #[ATC]ATC_WIDTH #width is tolerance 'window'; set higher for faster speeds
setp carousel.0.fwd-dc 50 #[ATC]ATC_VEL_FWD #degrees/second if stepgen position-scale set to degrees
setp carousel.0.rev-dc -50 #[ATC]ATC_VEL_REV #degrees/second if stepgen position-scale set to degrees
setp carousel.0.decel-time 0.05 #[ATC]ATC_DECEL #time to wait for carousel to stop before final alignment
setp carousel.0.align-dc 10 #[ATC]ATC_ALIGN_DC #slow speed for alignment to sense-0 or sense-1
After homing and unhoming, and trying to jog fwd/rev and setting the pocket number then 'enable' a few times, it gets stuck at state = 20 and won't respond at all.
I tried setting num_sense=1 but got an RTAPI_MP_ARRAY_INT error.
I see you made some edits to carousel.comp around September based on an issue reported on github - that would have been after I had my last configuration sort-of working. Anything obviously wrong you see in my above settings?
I was under the impression that in counts mode only an index pin is required. Is this not the case?
Thx,
R
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
- Posts: 23162
- Thank you received: 4860
Try setting that to zero and see what happens.
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
- Posts: 23162
- Thank you received: 4860
andypugh post=262472 userid=723I don't think that align-dc can be used with only an index pin.
Try setting that to zero and see what happens.
No, that isn't true:
case 'C': // encoder or stepgen counts.
new_pos = current_position;
if (homed){
int c;
int t;
int w = width / 2;
c = (counts - base_counts);
t = floor(((float)c + w) / scale);
if (c >= (t * scale - w) && c <= (t * scale + w)) {
new_pos = 1 + t - inst_pockets * floor((float)t / inst_pockets);
}
align_pin = (c % scale <= 2 && c % scale >= -2); // don't try to align to an exact count.
}
}
If it is stuck in state 20 then it is waiting for exact alignment to the stepgen counts.
case 20: //jogging fwd/rev
if (current_position != target) return;
if (align_dc != 0 && ! align_pin) return;
motor_fwd = 0;
motor_rev = 0;
motor_vel = hold_dc;
active = 0;
if (jog_fwd || jog_rev) return; // require button release to jog again
if (align_dc != 0) {
motor_vel = -align_dc;
timer = decel_time;
state = 5;
} else {
state = 0;
}
break;
}
Can you grab a snapshot of the pin states when it is stuck?
Open a terminal and "halcmd show pin carousel*" and paste the result here.
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
- Posts: 23162
- Thank you received: 4860
Please Log in or Create an account to join the conversation.
- spumco
- Offline
- Platinum Member
- Posts: 1829
- Thank you received: 738
I guess it's possible the DIR pin came loose... I can test this by connecting directly to drive with usb and seeing if it'll move in both directions.
halcmd attached.
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
- Posts: 23162
- Thank you received: 4860
I guess it's possible the DIR pin came loose... I can test this by connecting directly to drive with usb and seeing if it'll move in both directions.
Another way (the stepgen pin name will need to be changed to suit your actual system)
With LinuxCNC loaded.
halcmd unlinkp stepgen.0.velocity-cmd
halcmd setp stepgen.0.velocity-cmd 20
halcmd setp stepgen.0.velocity-cmd -20
halcmd setp stepgen.0.velocity-cmd 0
halcmd attached.
And that was with it stuck in state 20? That's wierd...
Please Log in or Create an account to join the conversation.