Cheap DIY "laser" screw compensation

All things related to the Centroid Acorn CNC Controller

Moderator: cnckeith

farmerjohn
Posts: 7
Joined: Sat Jun 15, 2019 3:25 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Cheap DIY "laser" screw compensation

Post by farmerjohn »

Hey all,

Just wanted to share a method that I came up with to dial in my screw compensation as accurately as possible without having to sit there writing down a bunch of figures..

Using a cheap DRO from amazon, I set it up on each of my axis to be measured

I then hooked up the DRO to an ardunio using 2 interrupt pins

To the arduino - the DRO looks like a rotary encoder with simple pulses. I used a simple encoder library that was listed in the IDE to read the values and then output them in the serial console

Then I just copy and pasted the output to a file called input.txt

I then wrote a simple PHP script to read that input file and converts the data to the dot TAB files that centroid looks for that contains the screw compensation.

I used the laser menu item under PID to move the axis for me. If I knew what the optedyne laser files looked like - I could make it even better. But what I do is to run the compensation and follow the directions. After the axis homes - I reset the arduino and open the serial monitor. Then let the laser operation do its thing. When its done I just copy and paste the info from the arduino serial monitor. I set my interval to 0.10 and the dwell time to 2 seconds. The code I wrote will output the position read from the DRO if there has been no change in movement in one second. So when all goes well, centroid will move 0.1" and pause for 2 seconds while the arduino records the position and so on till it goes all the way back and forth.

I've attached my arduino sketch and php code to this posting as well as an example input & output

If you have PHP installed on your system like I do (I am using OSX) - you just run "php laser.php > cnc-z.tab"

It is crude but I have my system repeatable to under 0.00015 on all axis

Hope it helps others

Thanks

John
Attachments
cnc_V2.zip
(4.05 KiB) Downloaded 140 times
cnc.zip
(4.63 KiB) Downloaded 152 times
Last edited by farmerjohn on Wed Jun 19, 2019 8:59 pm, edited 1 time in total.
Muzzer
Posts: 728
Joined: Mon Feb 19, 2018 2:52 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 38D269594F9C-0110180512
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: UK
Contact:

Re: Cheap DIY "laser" screw compensation

Post by Muzzer »

Interesting. As a matter of interest, what does the range of correction values actually look like? Presumably that is easily visible from your data file. Apart from achieving the end result accuracy, it would be very interesting to see what compensation was actually implemented to get there.

Could you share the correction data for your system so we can see "before" vs "after"?
farmerjohn
Posts: 7
Joined: Sat Jun 15, 2019 3:25 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: Cheap DIY "laser" screw compensation

Post by farmerjohn »

Muzzer,

I included my Z axis .tab file in the zip file there - it shows the correction values for the whole length and back. Open it in notepad

I have a 30+ year old machine that I have upgraded. The ballscrews on Z have over 7 thou of backlash yet I was able to dial it in very close by mapping it out at 0.100 thou at a time

Will be running some parts on the machine soon that will pay for new precision ground screws. Then I will have a 100% machine

Till then - it is incredibly close with the software compensation alone - even with my crappy ballscrews

John
cnckeith
Posts: 7166
Joined: Wed Mar 03, 2010 4:23 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: Yes
CNC Control System Serial Number: none
DC3IOB: Yes
CNC11: Yes
CPU10 or CPU7: Yes
Contact:

Re: Cheap DIY "laser" screw compensation

Post by cnckeith »

john,
cool! (Alan has done a similar thing with a dro).
thanks for posting. got a few pics of the machine?
Need support? READ THIS POST first. http://centroidcncforum.com/viewtopic.php?f=60&t=1043
All Acorn Documentation is located here: viewtopic.php?f=60&t=3397
Answers to common questions: viewforum.php?f=63
and here viewforum.php?f=61
Gear we use but don't sell. https://www.centroidcnc.com/centroid_di ... _gear.html
farmerjohn
Posts: 7
Joined: Sat Jun 15, 2019 3:25 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: Cheap DIY "laser" screw compensation

Post by farmerjohn »

cnckeith,

I will post some pictures after work tomorrow

It is a 1986 Leadwell MCV-550E which used to have a Meldas system in it

I replaced everything with acorn and dyn4 servos

Quick question - when doing the "laser" screw compensation - is there still a requirement to enter backlash compensation? Or will the screw compensation account for that? I've done a bunch of searches here on the forum but cannot seem to get a straight answer on the subject

Right now I am working out the RPI with the dro, then the backlash and then doing the screw compensation on top

Can I set the backlash comp to zero?

Thanks

John
tblough
Posts: 3072
Joined: Tue Mar 22, 2016 10:03 am
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: Yes
CNC Control System Serial Number: 100505
100327
102696
103432
7804732B977B-0624192192
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: Boston, MA
Contact:

Re: Cheap DIY "laser" screw compensation

Post by tblough »

The towards and away screw compensation does away with the need for backlash compensation. Backlash should be set to 0 before starting screw comp and should remain at 0 when screw comp is active.
Cheers,

Tom
Confidence is the feeling you have before you fully understand the situation.
I have CDO. It's like OCD, but the letters are where they should be.
farmerjohn
Posts: 7
Joined: Sat Jun 15, 2019 3:25 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: Cheap DIY "laser" screw compensation

Post by farmerjohn »

Tom,

Thats what I was hoping - thanks for the confirmation.

I am going to re-do all my axis tomorrow with the backlash set at zero
AMHKnives
Posts: 19
Joined: Tue Aug 08, 2017 5:10 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: B0D5CCFC8F3C-0126170013
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Re: Cheap DIY "laser" screw compensation

Post by AMHKnives »

Quick tip. i have found you do the laser map first with the lash comp off, after check your backlash and then change that comp to match. the ball screw will still have backlash even after laser mapping, easiest way to think about it is your mapping the screw in one direction the the other for the whole length and it cannot compensate for a stop and change in direction say in the middle of the ball screw without needing compensation for the backlash in the ball nut witch has not changed do to the laser mapping. Its in the Centroid tech bulletin #222 https://www.centroidcnc.com/dealersuppo ... ds/222.pdf Hope this helps answer your question. Even after i did my laser mapping with a hp laser interferometer and then did a renishaw ballbar test i still had to compensate for the backlash.

Alan
farmerjohn
Posts: 7
Joined: Sat Jun 15, 2019 3:25 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: Cheap DIY "laser" screw compensation

Post by farmerjohn »

Alan,

Thanks for the input.. I have been working off the TB048 pdf - did not notice the newer one!

That makes it much easier! Also looks like they made it super easy to do the pitch adjustment.. no more math!

I'll follow those steps tomorrow and hopefully will have it all calibrated and ready to run some parts!

Any feedback on the increment that I should be using? I've read various places that Centroid suggests 0.5".. I have been using 0.100"

But as I understand its also a function of your revs per inch and step pulses.. Since I have it automated now - I can do whatever increment that makes sense. I'll have to do the math

John
Muzzer
Posts: 728
Joined: Mon Feb 19, 2018 2:52 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 38D269594F9C-0110180512
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: UK
Contact:

Re: Cheap DIY "laser" screw compensation

Post by Muzzer »

Nicely done, although you'd still be advised to try to fix the backlash rather than compensate for it. Imagine if you your car had half a turn of lost motion on the steering wheel and you were trying to drive in a straight line along an uneven road. Sure enough, you could dial in a half turn on top of each change in steering input direction but controlling the vehicle would be pretty hard work.

The reality is that the spindle / tool is still able to move by that 7 thou - if the vertical force on the tool is in the same direction as the last compensation movement. It may not be quite so frequent an issue on a Z axis which generally advances into the work as it cuts but it's not always the case. Certainly, applying this process on the X and Y would be more disappointing, as the directions of typical X & Y loads vary frequently along the toolpath.

The same issue arises if you try to compensate for backlash by using positional feedback from a linear encoder with a closed loop servo system - it's a similar control issue in many ways. PID controllers aren't able to handle plant models with significant hysteresis so the end result may be quite a way short of what you might hope for.

In my understanding, ballscrew compensation is primarily provided as a means of compensating for small manufacturing errors in the pitch of the ballscrew rather than taking up wear and backlash.
Post Reply