Author Topic: Electronic Leadscrew for the New Lathe  (Read 94443 times)

Offline Bigbadbugga

  • Full Member
  • ***
  • Posts: 141
  • Country: england
  • Whiston (nr Liverpool)
Re: Electronic Leadscrew?
« Reply #75 on: March 31, 2015, 08:40:32 PM »
I've been researching the electronic leadscrew options for my boxford, I've found one I'd like to replicate but can't seem to get any of the details from the git hub site. It's open source, can anyone on here get the pcb schematics for the board?

http://muck-solutions.com/?page_id=186

Google translate is your friend.

Tools: Boxford CSB lathe, Chester 20v mill, Portamig 185. Lots of ideas, No motivation.

Offline sparky961

  • Hero Member
  • *****
  • Posts: 844
  • Country: ca
Re: Electronic Leadscrew?
« Reply #76 on: March 31, 2015, 08:48:51 PM »
I've been researching the electronic leadscrew options for my boxford, I've found one I'd like to replicate but can't seem to get any of the details from the git hub site. It's open source, can anyone on here get the pcb schematics for the board?

http://muck-solutions.com/?page_id=186

Google translate is your friend.

Did you try downloading the project ZIP file?  Bottom right corner of the page you referenced, there's a button.  It's a bit hard to see but it's there.

I didn't download it, so if it's just the files you're having a problem with I can't help with that.

The more I read this thread, the more I get interested in doing this to my machine instead of full CNC.  I've had 3 axes under computer control (it's a combo mill/lathe) but found it to be very limiting when you just want to whip off a part.  Not to mention the lack of ballscrews and lots of backlash adds another dimension to the hurdles.

Going semi-automatic seems like a nice compromise, as I too hate changing gears and my machine isn't set up well for threading in the first place.

Offline vtsteam

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6466
  • Country: us
  • Republic of Vermont
I love it when a Plan B comes together!
Steve
https://www.youtube.com/watch?v=4sDubB0-REg

Offline vtsteam

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6466
  • Country: us
  • Republic of Vermont
Re: Electronic Leadscrew?
« Reply #78 on: March 31, 2015, 08:53:10 PM »
Sparky seems like since you are familiar with the Teensy and programming it, you could try it out pretty easily.

I have to learn arduino coding to do it (if an arduino is fast enough re. Dave's comment). Probably trying out some of the programming tutorials tonight.
I love it when a Plan B comes together!
Steve
https://www.youtube.com/watch?v=4sDubB0-REg

Offline Bigbadbugga

  • Full Member
  • ***
  • Posts: 141
  • Country: england
  • Whiston (nr Liverpool)
Re: Electronic Leadscrew?
« Reply #79 on: March 31, 2015, 08:57:06 PM »
I've already downloaded the zip.

The problem is, there are loads of files containing all the code for the arduino and the display, but there are no schematics for the pcb as far as I can see. There are a few files I can't seem to open though, they seem to be database files and I just can't find a program to open them on my Mac, it just displays a text box foll of gibberish.

:(
Tools: Boxford CSB lathe, Chester 20v mill, Portamig 185. Lots of ideas, No motivation.

Offline vtsteam

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6466
  • Country: us
  • Republic of Vermont
Re: Electronic Leadscrew?
« Reply #80 on: March 31, 2015, 10:48:14 PM »
I can open all of the files. Which files can't you open, BB, and I'll tell you what they are, and how to open them. (The ODG file is an Open Office/Libre Office spreadsheet). Most others are code files, and stock images of the display and ATMega board.

The connections are between existing Arduino board, some switches, encoders, and stepper driver, so it's just given as a pin list referencing the Arduino's numbered pins. There is no schematic or circuit board info. You'd have to hard wire it. Maybe write to him -- he seems to speak English on the video.

Here is the Pin List:

Code: [Select]
Pins - Funktion RJ45 (Encoder A,A' / B, B' / Z,Z')
8- GND BR
7- 5V BR/W
6- B+ GR
5- Z- BL/w
4- Z+ BL
3- B- GR/W
2- A- OR
1- A+ OR/W
---------------
Pins - Funktion RJ45 (Encoder A/B/Z und Eingänge (Endschalter) )
8- GND
7- 5V
6- B+
5- Arduino 41
4- Z+
3- Arduino 39
2- Arduino 38
1- A+
--------------
Pins - Funktion RJ45 (Endstufe)
8- GND
7- Arduino 11 (Status Eingang)
6- 5V
5- Arduino 8 Dir Pin
4- 5V
3- Arduino 9 Step Pin
2- GND
1- Arduino 10 Enable

----------------
S1- Arduino 42
S2- Arduino 43
S3- Arduino 44
S4- Arduino 45
S5- Arduino 46
S6- Arduino 47
S7- Arduino 48
S8- Arduino 49
S9- Arduino 50
S10- Adruino 51
S11- Arduino 40 (Encoder Taster)
S12 - Reset

Encoder A- Arduino 19 Int4
Encoder B- Arduino 20 Int3

Externer Encoder A- Arduino 2 Int0
Externer Encoder B- Arduino 3 Int1

Endschalter - 38
Endschalter - 39
Endschalter - 41

LED Status 1- Arduino 53
LED Status 2- Arduino 52
LED Status 3- Arduino 30
LED Status 4- Arduino 31
Summer- Arduino 32

Edit:

On his website there is this in the Downloads section:

Quote
ZyklenAutomatik b2.02 comming soon

In his video he shows an older version (probably the pin list above) and a newer version of his board. The newer version is probably what he's working on.

« Last Edit: March 31, 2015, 11:21:26 PM by vtsteam »
I love it when a Plan B comes together!
Steve
https://www.youtube.com/watch?v=4sDubB0-REg

Offline vtsteam

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6466
  • Country: us
  • Republic of Vermont
Re: Electronic Leadscrew?
« Reply #81 on: March 31, 2015, 11:27:34 PM »
That project is for automatic thread cutting, I believe, and so it's kind of a subset of a CNC program, requiring a couple axes, and acceleration deceleration, a display and lots of button functions.

What I'm thinking of doing is MUCH simpler (or more primitive, depending on your point of view) --- simply replacing the change gears. 

Cutting threads exactly as you would on a manual lathe, otherwise. No second axis, no acelertion deceleration factors, etc. You engage the half nut with the spindle and leadscrew already turning, just as you would with change gears. You feed the slide in as multiple passes, in the manual way.

I love it when a Plan B comes together!
Steve
https://www.youtube.com/watch?v=4sDubB0-REg

Offline PekkaNF

  • Hero Member
  • *****
  • Posts: 2523
  • Country: fi
Re: Electronic Leadscrew?
« Reply #82 on: April 01, 2015, 02:44:31 AM »
I like the direction you are heading. Keep it clean and simple.

Very long time ago I used EPROM as a look uptable - without using a uP. Really simple. Incremental encoder to address lines (all extras pulled), data lines were output. Eprom was mostly wasted but small partion of was this lookup table. You need reset and clock, but they could be generated from index and quadrature count pulses?

Few posts back:
.....Ideally a rotary switch with a big metal knob would be a great "old school" solution to fit a traditional looking lathe, I think. You'd have to make one with a PC board and wipers, but it could be done as a later project in itself!

Thank you all for your replies! :beer: :beer: :beer: :beer: :beer:

Are you thinking of binary code rotary switch? Make the disc/code GRAY-code. You probably know this, but unsuspected person could find very unstable readings with ordinary binary code. Reason being that two (nearly) simultaneous bit changes are often required to happen. In real world on transition you get whatever code.

http://en.wikipedia.org/wiki/Gray_code

In this application software filtering is possible to see that the input is stable.

CNC Hand Wheel MPG uses similar type encoder than you are planning to use on spindle. It is handy feeding in all sort of numbers. I had camera that had that sort of handwheel, only circumfere sticking out and number or menu item was scrolled by rotating that hand wheel on thumb and then the hand wheel was pressed to lock/choose value. This will ofcourse require rather coarse resolution and definate detent, but for most of the people this is desirable on menu selection. On feed you want fine resolution.

Bit of OT sometimes goes far. :lol:

Pekka

Offline RussellT

  • Hero Member
  • *****
  • Posts: 520
  • Country: gb
Re: Electronic Leadscrew?
« Reply #83 on: April 01, 2015, 05:12:20 AM »
I'm not familiar with commercial rotary encoders so I've had a quick look on ebay.  It seems that for not much more you can get 2000 pulses/rev.  Presumably whichever encoder you choose for your purpose you could double the number of pulses by using two inputs and counting both sets of pulses - or possibly all three, A B and Z.  I'm not sure whether they've already done that to claim 2000p/r.

Here's an example http://www.ia.omron.com/product/item/e6b27090f/index.html

Looking at the output diagram you might be able to count 5000 p/r which ought to improve accuracy.  I've tried playing with your spreadsheet but adding to the encoder disc sectors doesn't affect the accuracy.  I must be missing something there  I think doubling the pulse output ought to halve the error.

You can program PICs in basic.  I use mikrobasic which has a free version.

Russell
Common sense is unfortunately not as common as its name suggests.

Offline PekkaNF

  • Hero Member
  • *****
  • Posts: 2523
  • Country: fi
Re: Electronic Leadscrew?
« Reply #84 on: April 01, 2015, 05:43:39 AM »
I'm not familiar with commercial rotary encoders so I've had a quick look on ebay.  It seems that for not much more you can get 2000 pulses/rev.  Presumably whichever encoder you choose for your purpose you could double the number of pulses by using two inputs and counting both sets of pulses - or possibly all three, A B and Z.  I'm not sure whether they've already done that to claim 2000p/r.....

Russell

I used work some time with rotary encoders (incremental and absolute) and my experience is that at some point in the system more P/R does not produce any gain. Specially when you start counting leadin/trailin edeges as a pulses you are stepping on thin ice. A little interface mismatch, threshold, not that crisp edges, not to mention little mechanical vibration when pulse is setting between 0/1 states and sometimes the count drifts even when nothing moves. Same goes to single channel encoders. They can't detect directional change. Some might think that in this case it does not matter. But it does. Even when you think that you rotate spindle on one direction only, but funny stuff happens when you start/stop at pulse transition.

I tried to shed some light on this issue few posts back.

Pekka

Offline Bigbadbugga

  • Full Member
  • ***
  • Posts: 141
  • Country: england
  • Whiston (nr Liverpool)
Re: Electronic Leadscrew?
« Reply #85 on: April 01, 2015, 05:45:30 AM »
I can open all of the files. Which files can't you open, BB, and I'll tell you what they are, and how to open them. (The ODG file is an Open Office/Libre Office spreadsheet). Most others are code files, and stock images of the display and ATMega board.

The connections are between existing Arduino board, some switches, encoders, and stepper driver, so it's just given as a pin list referencing the Arduino's numbered pins. There is no schematic or circuit board info. You'd have to hard wire it. Maybe write to him -- he seems to speak English on the video.

Here is the Pin List:

Code: [Select]
Pins - Funktion RJ45 (Encoder A,A' / B, B' / Z,Z')
8- GND BR
7- 5V BR/W
6- B+ GR
5- Z- BL/w
4- Z+ BL
3- B- GR/W
2- A- OR
1- A+ OR/W
---------------
Pins - Funktion RJ45 (Encoder A/B/Z und Eingänge (Endschalter) )
8- GND
7- 5V
6- B+
5- Arduino 41
4- Z+
3- Arduino 39
2- Arduino 38
1- A+
--------------
Pins - Funktion RJ45 (Endstufe)
8- GND
7- Arduino 11 (Status Eingang)
6- 5V
5- Arduino 8 Dir Pin
4- 5V
3- Arduino 9 Step Pin
2- GND
1- Arduino 10 Enable

----------------
S1- Arduino 42
S2- Arduino 43
S3- Arduino 44
S4- Arduino 45
S5- Arduino 46
S6- Arduino 47
S7- Arduino 48
S8- Arduino 49
S9- Arduino 50
S10- Adruino 51
S11- Arduino 40 (Encoder Taster)
S12 - Reset

Encoder A- Arduino 19 Int4
Encoder B- Arduino 20 Int3

Externer Encoder A- Arduino 2 Int0
Externer Encoder B- Arduino 3 Int1

Endschalter - 38
Endschalter - 39
Endschalter - 41

LED Status 1- Arduino 53
LED Status 2- Arduino 52
LED Status 3- Arduino 30
LED Status 4- Arduino 31
Summer- Arduino 32

Edit:

On his website there is this in the Downloads section:

Quote
ZyklenAutomatik b2.02 comming soon

In his video he shows an older version (probably the pin list above) and a newer version of his board. The newer version is probably what he's working on.

Thanks Vsteam, it was the odg files I couldn't see. The pinout is very helpful, thanks. I should be able to design a board from that. It's been a while since I dabbled, but I'll have fun having a go.
Tools: Boxford CSB lathe, Chester 20v mill, Portamig 185. Lots of ideas, No motivation.

Offline RussellT

  • Hero Member
  • *****
  • Posts: 520
  • Country: gb
Re: Electronic Leadscrew?
« Reply #86 on: April 01, 2015, 06:07:22 AM »
Hi Pekka

I wasn't thinking of counting leading and trailing edges but just using both trains of pulses - the fact that they are slightly out of phase won't make much difference.

I can see how spurious pulses could come as you stop, start, and change direction which means that you would struggle to use this to reset each cut on the thread.  However once it is running then the more input pulses you have the more accurate it should become - I've been trying to work out the errors and I think that with 1200 pulses per rev of the spindle it should be possible to do all the inch threads that Steve suggests with no error.

Pekka, is it feasible to use the 600 p/r encoder on two channels to get 1200 p/r?

Russell







Common sense is unfortunately not as common as its name suggests.

Offline PekkaNF

  • Hero Member
  • *****
  • Posts: 2523
  • Country: fi
Re: Electronic Leadscrew?
« Reply #87 on: April 01, 2015, 06:51:04 AM »
Hi Pekka

I wasn't thinking of counting leading and trailing edges but just using both trains of pulses - the fact that they are slightly out of phase won't make much difference.

I can see how spurious pulses could come as you stop, start, and change direction which means that you would struggle to use this to reset each cut on the thread.  However once it is running then the more input pulses you have the more accurate it should become - I've been trying to work out the errors and I think that with 1200 pulses per rev of the spindle it should be possible to do all the inch threads that Steve suggests with no error.

Pekka, is it feasible to use the 600 p/r encoder on two channels to get 1200 p/r?

Russell

Hi, I linked this before, hote it answers your guestion better than my limited englis would do:
http://www.dynapar.com/Technology/Encoder_Basics/Quadrature_Encoders/

Latest question, Yes and it is often done. Just have a eye on mechanical system and don't let that errors accumulate too long. "index pulse" or other reference is routinely used.

Pekka

Offline vtsteam

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6466
  • Country: us
  • Republic of Vermont
Re: Electronic Leadscrew?
« Reply #88 on: April 01, 2015, 08:26:33 AM »
Russell, my spreadsheet will show you the errors for any inch size thread at any encoder resolution, any stepper to leadscrew ratio, any encoderr to spindle ratio and any leadscrew pitch (phew!)

And it will do it for both the encoder disk method of dividing, and the digital method of dividing.


It will also show you the data throughput rate needed (all computational time). Right now I'm at 5khz w/ a 600 line encoder running at 5 times spindle speed ( running at spindle motor speed, in other words).

I love it when a Plan B comes together!
Steve
https://www.youtube.com/watch?v=4sDubB0-REg

Offline vtsteam

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6466
  • Country: us
  • Republic of Vermont
I love it when a Plan B comes together!
Steve
https://www.youtube.com/watch?v=4sDubB0-REg

Offline RussellT

  • Hero Member
  • *****
  • Posts: 520
  • Country: gb
Re: Electronic Leadscrew?
« Reply #90 on: April 01, 2015, 10:42:17 AM »
Steve

I think I understand the spreadsheet, but if in your spreadsheet I increase the spindle pulses per revolution, then I think that should reduce the error.  For example if I was trying to take a step every 1.7 pulses and I increased the pulse count by a factor of 10 then I would need to take a step every 17 pulses - doing away with the error.  I think the  error will be much smaller than your calculations suggest.

For example for a 36tpi thread there will be 3000 pulses per spindle rev and you need 166.67 steps to advance the leadscrew 1/36".  That works out you need to advance the stepper one step every 18 pulses exactly.  No error apart from the stepping nature of the advance.

In a worse scenario (27tpi) you need to advance the stepper once for every 13.5 pulses.  As long as your software takes care of the half pulses then the maximum error at any point on the tread will be one step or 0.0001666 inches.

Russell

Edited to remove my percentage error calculation which was wrong.
« Last Edit: April 01, 2015, 11:34:32 AM by RussellT »
Common sense is unfortunately not as common as its name suggests.

Offline vtsteam

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6466
  • Country: us
  • Republic of Vermont
Re: Electronic Leadscrew?
« Reply #91 on: April 01, 2015, 11:15:33 AM »
Oops....almost killed your last post, Russell -- I hit edit insted of reply -- luckily the cache had a copy......phew!


Checking the spreadsheet Russell -- i'll post a corrected version......
I love it when a Plan B comes together!
Steve
https://www.youtube.com/watch?v=4sDubB0-REg

Offline RussellT

  • Hero Member
  • *****
  • Posts: 520
  • Country: gb
Re: Electronic Leadscrew?
« Reply #92 on: April 01, 2015, 12:10:58 PM »
Steve

I realised that my percentage error calculation was wrong so I removed it.  The difficulty with the error calculation is that if the software keeps track of the accumulated errors then over a long thread the error will be eliminated.  However it will correct by adding a step when the error accumulates and it should do that when it has fallen one step behind.  That means that the line of the thread will show waviness a maximum of one step from peak to trough or oscillate by a maximum of half a step either side of a mean line.

Where I am having trouble is working out over what length the maximum deviation from the mean line will occur to get a percentage error. 

To take the 27tpi example the stepper should step at 14, 27, 41, 54, 68, 81, 95, 108 etc pulses.  The error is zero over two steps but the error in the middle is only by mistiming the step by half a pulse.

I need to think about how to calculate the error some more.

Russell
Common sense is unfortunately not as common as its name suggests.

Offline awemawson

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8966
  • Country: gb
  • East Sussex, UK
Re: Electronic Leadscrew?
« Reply #93 on: April 01, 2015, 12:38:27 PM »
I was thinking about something like this:

http://www.ebay.com/itm/Encoder-600P-R-Incremental-Rotary-Encoder-AB-2-phase-6mm-Shaft-5V-24V-coupling-/321160456974

Amazing encoder that Steve, according to the description it has an 'output triode' - now valves, that's my vintage of electronics  :lol:
« Last Edit: April 01, 2015, 02:15:47 PM by vtsteam »
Andrew Mawson
East Sussex

Offline vtsteam

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6466
  • Country: us
  • Republic of Vermont
Re: Electronic Leadscrew?
« Reply #94 on: April 01, 2015, 01:58:37 PM »
I think I've got it-- please check!

If correct, one thing that looks doable in it is dropping the stepper/leadscrew reduction to 1.5 to 1, and running the 600 line encoder at 5 to 1 reduction. What this does with my particular leadscrew, is match the encoder pulses per revolution with the steps per inch. That's 3000 each.

It looks like that means that the number of pulses per encoder revolution equals the thread pitch. That means no errors percentage. And the reduction on leadscrew is easy to do (small gear ratio) and the encoder can run at spindle motor speed (also easy).

Unless I'm wrong in any (or all of the above) -- which is a distinct possibility......



I love it when a Plan B comes together!
Steve
https://www.youtube.com/watch?v=4sDubB0-REg

Offline vtsteam

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6466
  • Country: us
  • Republic of Vermont
Re: Electronic Leadscrew?
« Reply #95 on: April 01, 2015, 02:16:49 PM »
I was thinking about something like this:

http://www.ebay.com/itm/Encoder-600P-R-Incremental-Rotary-Encoder-AB-2-phase-6mm-Shaft-5V-24V-coupling-/321160456974

Amazing encoder that Steve, according to the description it has an 'output triode' - now valves, that's my vintage of electronics  :lol:

Andrew, which wire is the grid?  :lol:
I love it when a Plan B comes together!
Steve
https://www.youtube.com/watch?v=4sDubB0-REg

Offline awemawson

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8966
  • Country: gb
  • East Sussex, UK
Re: Electronic Leadscrew?
« Reply #96 on: April 01, 2015, 02:55:40 PM »
Joking apart - that is an amazing price for what looks to be a good encoder.
Andrew Mawson
East Sussex

Offline RussellT

  • Hero Member
  • *****
  • Posts: 520
  • Country: gb
Re: Electronic Leadscrew?
« Reply #97 on: April 01, 2015, 03:48:53 PM »
Hi Steve

I agree with your revised spreadsheet.  The error isn't zero but the cumulative error is zero and the periodic errors are similar to the errors produced by the saw tooth profile of the stepper controlled cut.

My inclination would be to retain the 3:1 leadscrew gearing for smaller steps and more torque, and to increase the number of pulses, either with a different encoder or using the rising and falling edge method of frequency doubling as mentioned by Pekka and the ebay description you linked to.

I would do that because it would give more flexibility for cutting other threads - such as metric.

It would make the software more complicated, but if you built the hardware with more pulses then you could always upgrade the software and user interface when you needed an odd thread.

Russell
Common sense is unfortunately not as common as its name suggests.

Offline vtsteam

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6466
  • Country: us
  • Republic of Vermont
Re: Electronic Leadscrew?
« Reply #98 on: April 01, 2015, 04:26:11 PM »
Hi Steve

I agree with your revised spreadsheet.  The error isn't zero but the cumulative error is zero and the periodic errors are similar to the errors produced by the saw tooth profile of the stepper controlled cut.

For Integer inch pitch threads, there is no error in the ability to send steps on time in relation to the spindle position. which is what counts as far as the thread is concerned. There is no periodic error in those threads.

It has nothing to do with the stepper's steps per inch. Only the spindle and step timing matters.

re.  increasing encoder fineness -- I don't want to do rising and falling edges for the reason Pekka mentioned, and for practical purposes a 1.5 to 1 reduction to the leadscrew will fit the lathe better. This is a small lathe, and I think a 400 oz.In stepper will handle it.

If for any reason that doesn't work well, it would be easy to change, so I think that's the way I'll go.



I love it when a Plan B comes together!
Steve
https://www.youtube.com/watch?v=4sDubB0-REg

Offline vtsteam

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6466
  • Country: us
  • Republic of Vermont
Re: Electronic Leadscrew?
« Reply #99 on: April 01, 2015, 04:35:48 PM »
Joking apart - that is an amazing price for what looks to be a good encoder.

Sent for one. :beer:
I love it when a Plan B comes together!
Steve
https://www.youtube.com/watch?v=4sDubB0-REg