CnC Person needs Arduino code Person

Hello my name is Steve Ryan and I'm looking for assistance on a project.
I have built a cnc lathe with a Centroid Acorn controller that I have also built a 8 position tool turret for the lathe.
Centroid has some code for tool turrets but they won't work properly for me.
Arduino is the answer but I can't code.
If done the way I imaging the turret will be better than most because it will not just divide a circle into 8 positions, but it will save tool positions as way points. That allows the tool height to be concidered into the position.

my build threads at Centroid Acorn:

https://www.centroidcncforum.com/viewtopic.php?f=57&t=3068

tool turret thread, my concept is last post:

https://centroidcncforum.com/viewtopic.php?f=60&t=3464&start=70

Thank You
Steve

If you just want someone to write a program for you then you should click Report to Moderator and ask to have this moved to the Gigs and Collaborations section of the Forum. Be prepared to pay for the code writing.

If you want to learn to program yourself then ask the Moderator to move this to the Project Guidance section. And have a look at the examples that come with the Arduino IDE which are a good place to start. There are also many online tutorials. Also see the Useful Links Thread.

...R

I think I'm in the "projects guidance" section.
I'd like to try to learn first.
Steve

Interesting project. How much work does the Arduino have to do?

Thank you for your reply Bill
The acorn controller has a tool turret program that works on 4 input gray logic.
acorn turns on the turret rotation and stops when it see the inputs that correspond to the tool number requested. They were using a reversing contactor to reverse the turret against the pawl and stay on with low voltage.
my turret does not have a pawl it has a sprag.
lathe tools are not all the exact same height.

I would like the Arduino to serve as the source of the input signals to acorn instead of a gray code encoder.
say tool i is input 1 hi and 234 inputs are low so that the acorn input Arduino grounds.
I would like to use a encoder to divide the turret into pulses starting at where i assign tool one. that is zero then hold those inputs on until the next tool is assigned tool two etc.
that way the tool position is not in degrees but pulse count. enabling the tool height to be considered in the position. moving the turret to each position to set up is done in acorn but the position is recorder in Arduino. I store 8 codes and the only other thing may be for Arduino to work a timer relay to reverse to lo9ck turret.

here is a quote from my build thread as to the idea:

"Another Idea:
I have noticed that my lathe tools are not all holding the cutting edge of the inserts at .500 over the base of the tool. This was going to be addressed by finding the highest tool and shimming the others to match when mounting.
I'm now hashing a plan to save the tool positions as way points and naming the way point the tool number. By doing it that way i can set the tool height for each tool with a height gauge. By using a Arduino and a 8000 pulse per rev encoder I should be able to assign a tool number to a saved location. Arduino would then return the proper gray logic code to Acorn for the requested tool and lock the sprag clutch. Arduino does not need to know tool number requested, Acorn is stopping the motor when it see's the location it wants. When the motor forward rotation is stopped, Arduino reverses the turret to lock.
This seems like a really good idea and the Acorn gray 1 output code i have now won't need to be modified. Changing Acorn looks a lot harder than learning Arduino. I will even be able to set tool height automatically by tool touch off.
All my problems I'm having could in the end produce better results and ease of use.
OK only one problem left, I have to learn how to write Arduino code."

Thank You
Steve

ACORN_Gray_Code_1_Motor_Output_Turret_Instructions_rev2.pdf (71.3 KB)

If you are interested we could converse by phone.
It is so hard to put my thought into words properly.
I could give the entire sequence of needed events.
I would post results of conversations for others.
Steve

I assume that there is something that gives you a home position on the turret?

jumps4:
If you are interested we could converse by phone.

Sure call me - I PM'd you my number

parts ordered project underway
thank you WildBill
Steve

ordered 2 Omron E6B2-CWZ1X 2000P/R Rotary Encoder ebay item number 163712212938
should be here by Oct 11
I have a Arduino UNO and a Nano
If you think I need something else please let me know.
I also checked and i do have 5v inputs on the acorn board in the db25 connector so i will not need to do anything special for inputs.

the rotation of the encoder is clockwise with z being 1 pulse per revolution.

e6b2.PDF (125 KB)

Wildbill
I changed the encoder to a E6B2-CWZ6C(2000p/r) because I seen posted issues from others on the E6B2-CWZ1X
Steve

@jumps4, you sent me a PM requesting me to look at this Thread, which I am happy to do. However at the moment I don't see any question that I can answer. I am not a CNC expert.

The only reason to choose a different Arduino is to be able to use some extra features. From what I have read in this Thread an Uno or Nano should be sufficient.

I don't know if you have had a phone conversation with @wildbill. If you had it would be helpful if you could post a summary of the outcome of the discussion so we are all on the same page and so we won't be repeating stuff that has already been covered.

...R

Robin2:
I am not a CNC expert.

More than I am I suspect - IIRC, you do at least have a CNC lathe :wink:

Thanks Robin
the call was covering the concept as listed above and where to start.
Bill suggested I start slow by getting the z pulse that will act as tool position one working first and work up by adding the a and b pulses. adding features as we go will make finding errors easier.
I did have to change the model of encoder to npn because it will be easier to connect.
I have been trying to find other encoder projects and see how they were done.
Steve

I'm reading and trying to get my head around the storage location for each tool since they are not a constant (even tool 1 (z pulse) can be above or below zero).
if I'm using a 2000 ppr encoder and counting each hi and each low of a and b and adding them together that is a 8000 count per cycle.
Then if the cycle is linear and restarts each rotation I will want all 8000 counts to have a unique name (0-7999 are their names) and the ability to store information about each count. (if a tool is there 1 or 0)
then the tool number displayed and the gray code output is in a range of counts because i'm not using degrees or the exact division of 8000 as the position.
The turret will stop rotation at 8 unique locations that have been marked.
the turret needs to hold the same gray code output until the next unique location is reached and motion stops.
when forward motion stops the gray code has to hold even in reverse as it passes in reverse the unique location and not change (The turret has a spring loaded sprag clutch, reverse does not move the tool but it does rotate the encoder back beyond the unique name ). once stored or set a gray code output can only change moving forward and not until the next unique location. The only purpose of each unique name marked "hi" is to stop forward motion. what gray code to output and what tool it is, is handled by logic because it falls within a certain range of numbers/names.

tool numbers are stored in a range of names. If 8000 is divided by 360 that is 22.222 pulses per degree.
and I say the tool difference in height has to stay within 5 degrees hi or low of each 45 degree segment.
so 5 times 22.222 = 111.111. if the unique name 2057 where the turret stops and that is in the range of 1889 and 2111 then the tool name displayed has to be "tool 2"

I need an aspirin...

does this seem right?
I have no idea how to do this but i think this is how it should work.
Please express your opinion and ask questions
Thank You
Steve

as you may see i was a mechanic not a typist

forward and reverse will not be controlled by the Arduino.
when Acorn wants a tool it starts forward rotation ,looking for the unique gray code it wants to see for the desired tool.
The gray code the Arduino puts out tells Acorn when to stop and what tool number to display.
The power that controls the motor will have a reversing timer on it and automatically reverse each time it comes to a stop. (reverse does not change tool height, it only locks the turret)
Steve

how the roller sprag clutch works to lock the turret:

When Acorn is powered up and homed to start up there is no tool displayed and the turret does not rotate to tool one.
After homing Z and X pressing aux11 key on the touch screen rotates the turret and displays the active tool the turret in now on.
Steve

here is an article i was reading about where to store the unique names and their status so it is not lost on reboot.
should i get a Sim card reader and card or maybe something else like a FRAM chip.

Data sheet:https://cdn-shop.adafruit.com/product-files/1895/MB85RC256V-DS501-00017-3v0-E.pdf
video: New Products 5/28/2014 - YouTube
Steve

This is probably not needed since on restart the Arduino will not set gray code outputs until passing the z output for the first time. so pressing aux11 on acorn will start rotation until a gray code is set and everything is back in sync.
Wrong? weren't the locations lost if not written to eeprom or something like it.
I'm getting lost on saving information where.

@jumps4, you have now made 5 posts in succession without waiting for a Reply.

I don't know about other people on the Forum but I find it almost impossible to keep up when a poster does that. Maybe I'm just lazy.

My suggestion is that you take time to frame a specific question and then wait for a Reply before going further.

...R

How fast will the turret rotate? I'd like to have a feel for how many pulses per second the Arduino will have to handle.