CnC Person needs Arduino code Person

Here are a few pics of a tool setup and 2 different chucks.
I'll run calibration tests today

my version

cnclathe010.ino (15.1 KB)

Show step count when calibration fails.

cnclathe010a.ino (14.7 KB)

I was Testing the turret today and I made an axle bolt for my push mowers wheel.
I didn't need three, the video kept messing up so I had to restart 3 times.

click for video:
VIDEO: Making axle bolt

I didn't see any jump in there - just the little pause at each tool to see if the Acorn wants it.

Just as the tool gets to the face of the part it jumps up, it is hard to see but that is why I restart.
I'll have to do more testing to see what is happening.

Oh, I see it now - I was looking at the turret rotation earlier on.

At that point, the AcornRotatePin (11) should be HIGH and there should be no stepping if it is. May need some more debug prints to see if the Arduino thought it should be stepping.

I had a job to do today for a local machine shop but I'll test later.
I switched the stepper driver to full braking. It probably has no effect but it can't hurt.
Steve

Here's a version with sprag locking.

I'm not sure what to do with step count. When I reverse the stepper, I ought to subtract the steps I'm reversing but some of them may not cause any movement as they're locking sprags.

If there is movement, then the next and all subsequent tool positions will be off. I could step forward again to compensate after we're done with the tool, but is it all the reversing steps or a bit less?

Anyway, I've ignored these questions for now and done nothing. When the Acorn indicates that it wants a tool, it steps back two (configurable) steps and that's it.

cnclathe010b.ino (15.2 KB)

Thanks WildBill I'll try it tomorrow

WildBill
there is an accumulated error with each rotation.
after 3 complete rotations stepping one tool at a time, the tool is -.075 lower.
I don't think the step count resets to zero after it passes index each rotation.
I used 0's in the editable line for adjustment.
Steve

jumps4:
I don't think the step count resets to zero after it passes index each rotation.

That's correct. After the initial rotations to find home, the index slot is ignored. Everything relies on counting steps.

Clearly reverse is causing a problem. I can simply unwind those reversing steps when we move on. We can zero on the slot too, but I suggest we figure out how to undo the reverse steps first.

What do you think?

sorry my reply was slow I got Ill and had to rest.
Yes, if you add back in the steps we reverse that may resolve the issue.
If that works OK then I will test the adjustments. but for now I'll leave them at zero.
Steve

This one undoes the reverse steps when the Acorn asks for movement again.

cnclathe010c.ino (15.5 KB)

Thanks WildBill
I was away yesterday but I will run it this afternoon.
Steve

The first tests with already saved tool positions are working well. The editable tool position adjustment works also.
I will test more and then re calibrate and re run tests today.
Looks Good so far WildBill
Steve

Well I think we are at the point I just need to use the machine and note any issues I may see.
I ran all day yesterday with no issues and made 5 parts.
I now need to find work for this machine to test further.
Thank You so much WildBill for hanging in there with me. Your a great guy and I'll keep you posted.
Steve

Regarding our conversation, I took a look at the code this morning to see if there's any complication involved in controlling a brake. There isn't. There's already functions in there to lock and unlock the sprag so the brake would be set and released in the same places. Just need to do them in the right order.

bill bumper

I reviewed the code in version 010c. It looks like it would be simple enough to detect that the Acorn wants the tool whose position the turret arrives at (we already do this) and then do a blind home and return to tool pos at that point. Then any tool prior chatter impacts on the current turret position would be gone.

There's a possible issue though. When the turret arrives at a tool position, it changes the Gray code output to notify the Acorn and then waits briefly for the Acorn to decide whether we should stop at this tool position to do work. If so, I lock the sprag and wait but I don't recall what happens next.

I don't see anything that accounts for telling the Acorn that it is free to start cutting, so I assume that there is a fixed delay in the G-code to let me lock the sprag and then it can spin the lathe and move the cutter.

If at that point I seek index and return to the tool pos, that G-code delay will have to be increased, unless there is an Acorn pin we can use to tell it to wait. I don't remember if there is.

A question: if we cut at tool six and are now going to tool two we will pass index. Is it necessary to rehome and go directly to position two again?