sam sokolik | 24/08/2022 16:30:47 |
126 forum posts | I grabbed the last Emco that needs a little work... I wanted to show that the printer port is still a cheap way to get into a industrial grade machine controller. Yes - linuxcnc will output step/direction just fine - but I wanted to show that you can also run closed loop setups also. The printer port is reading the encoder and outputting pwm to the drives. Linuxcnc closes the loop and does the PID. Here is how the control loop will work.. The motion will be speed limited - the encoder + gearing will have a resolution of .0005mm... That means a max of around 50ipm no head room. (still faster than the original steppers at 27ipm...) Here is it running at 35ipm... |
sam sokolik | 24/08/2022 16:38:34 |
126 forum posts | I also re-balled the z axis ball nut.. It was pretty cruddy.. The ball recirculation path was swaged in and then hardened.. I had to break the swaged metal to pull the recirculator out. |
mike T | 24/08/2022 17:44:55 |
221 forum posts 1 photos | Hello Sam Nice work on the lathe and also on re-balling that tiny Emco ball nut. I also have an Emco Compact 3 CNC running on LinuxCNC, but stepper motors only. I have three questions for you regarding the ball nut. 1 What is the correct number of balls installed in the Emco ball nut? 2 Did you redo the ball nut and replace the two loose balls. Did they make any difference? 3 How did you retain the circulation tube after the rebuid; I understand it was originally swagged to the body Thanks for your help Mike |
sam sokolik | 24/08/2022 19:20:38 |
126 forum posts | Posted by mike T on 24/08/2022 17:44:55: Hello Sam Nice work on the lathe and also on re-balling that tiny Emco ball nut. I also have an Emco Compact 3 CNC running on LinuxCNC, but stepper motors only. I have three questions for you regarding the ball nut. 1 What is the correct number of balls installed in the Emco ball nut? 2 Did you redo the ball nut and replace the two loose balls. Did they make any difference? 3 How did you retain the circulation tube after the rebuid; I understand it was originally swagged to the body Thanks for your help Mike 1) the few times I have counted them - I get 52.. 2) Yes - I re-balled it with new ones I had at the shop. I think 1 might have snuck out - I just went with it. I don't think a couple short is going to be a problem. 3) Currently I just have a piece of plastic jammed between the ball nut and the housing.. Seems to be working ok. I was thinking maybe a small amount of epoxy on each end might keep them in. Just would have to make sure that the epoxy doesn't flow into the channels.. |
sam sokolik | 24/08/2022 19:22:22 |
126 forum posts | Edit - It was better but still was a bit crunchy. I think moisture got into the nut and pitted it slightly. I might replace them with 12mm ball screws. (these are 8mm) |
sam sokolik | 28/08/2022 16:33:10 |
126 forum posts | Going to replace the existing ball screws with some 12mm diameter 4mm pitch ball screws. The ones on there are just a bit too damaged.. |
sam sokolik | 30/08/2022 04:18:19 |
126 forum posts | replaced these with these... |
Michael Gilligan | 30/08/2022 06:08:25 |
![]() 23121 forum posts 1360 photos | Posted by sam sokolik on 24/08/2022 16:30:47:
... I wanted to show that the printer port is still a cheap way to get into a industrial grade machine controller. Yes - linuxcnc will output step/direction just fine - but I wanted to show that you can also run closed loop setups … . A noble ambition, Sam … and it seems that you have achieved it Well-done, Sir !! MichaelG. |
sam sokolik | 31/08/2022 04:43:01 |
126 forum posts | Looking at the parallel port - it looks like I have a pci version that runs what is called x mode. This balances in's and out's better.. |
Joseph Noci 1 | 31/08/2022 07:09:16 |
1323 forum posts 1431 photos | Sam, you have always done something interesting with CNC - I would enjoy a rundown of all the CNC machines in your shop that you have home-brewed. That printer port allocation is certainly full! The drive you are using says 'brushless motor drive' - shows 3 motor drive outputs which makes sense for a 3ph brushless motor, but you have only ph A&B connected to the motor, so I presume it is a brushed DC motor. How does that drive handle the brushed motor? Could not see a part number on the drive to google its spec sheet. I presume what you called PWM output from Lcnc to the drive is the 'step' signal, so it makes the DC motor look like a stepper with resolution = to the number of encoder lines? In the video there is a green breakout block - the printer port cable plugs into it and then there are screw blocks to take the port signals to the rest - where did you get that block? Very neat device...
Do show more! Joe |
sam sokolik | 31/08/2022 14:14:29 |
126 forum posts | Posted by Joseph Noci 1 on 31/08/2022 07:09:16:
Sam, you have always done something interesting with CNC - I would enjoy a rundown of all the CNC machines in your shop that you have home-brewed. That printer port allocation is certainly full! The drive you are using says 'brushless motor drive' - shows 3 motor drive outputs which makes sense for a 3ph brushless motor, but you have only ph A&B connected to the motor, so I presume it is a brushed DC motor. How does that drive handle the brushed motor? Could not see a part number on the drive to google its spec sheet. I presume what you called PWM output from Lcnc to the drive is the 'step' signal, so it makes the DC motor look like a stepper with resolution = to the number of encoder lines? In the video there is a green breakout block - the printer port cable plugs into it and then there are screw blocks to take the port signals to the rest - where did you get that block? Very neat device...
Do show more! Joe the drive is an BD15A8. It is an brushless DC AMC drive that will also run brushed servos. (most all of the AMC 'B' drives will also work with brushed servos also). It is a 15A peak 7.5A continuous 80v max. Most of these series of amc drives take +/-10 volt input signal. These drives take PWM and Dir. It can be considered an analog signal. (but works well with computer control) It isn't a step signal. You are in effect sending the drive an analog signal based on the pid output. The encoder is read back and the control loop is constantly adjusting the pwm signal to control the servo. 2000 times a second. The terninal block is something we got off of ebay years ago.. I am sure you can get them for mouse or digikey? I have not looked. sam |
sam sokolik | 01/09/2022 00:27:26 |
126 forum posts | more mansplaining.. |
SillyOldDuffer | 01/09/2022 18:03:00 |
10668 forum posts 2415 photos | Excellent!!! If anyone had asked I'd have bet money Parallel Printer ports had gone the way of the Parish Pump! Useful to know they still exist because parallel pins were by far the easiest way of connecting a multi-user/multi-tasking computer to external electronics. Any idea how a parallel port's performance compares with twiddling pins on a Raspberry Pi 4? What's the highest frequency a parallel pin can output, and what's the highest frequency that can be put on an input that a program can reliably work with? I've experimented with a Pi4 in various real-time modes to see how fast it's IO pins can be made to go and results are both good and bad. Output is quick except for awkward pauses due to the scheduler. High-speed input is erratic because there's no way I know of directly handling an IO interrupt in Linux or Windows. Thus inputs are either delayed by the operating system or a CPU has to be dedicated to reading a pin continually in a loop, which is hot, messy and not expandable. And still misses some inputs due to the scheduler taking the CPU out every so often. Does a Parallel Port on a PCI-card overcome these problems, or is a PCI parallel port's performance similar to the original - designed to work a relatively slow printer? My concern isn't CNC specific, it's more a general interest in interfacing computers to fast real-world events without extra hardware. Dave
|
sam sokolik | 01/09/2022 18:38:22 |
126 forum posts | Posted by SillyOldDuffer on 01/09/2022 18:03:00:
Excellent!!! If anyone had asked I'd have bet money Parallel Printer ports had gone the way of the Parish Pump! Useful to know they still exist because parallel pins were by far the easiest way of connecting a multi-user/multi-tasking computer to external electronics. Any idea how a parallel port's performance compares with twiddling pins on a Raspberry Pi 4? What's the highest frequency a parallel pin can output, and what's the highest frequency that can be put on an input that a program can reliably work with? I've experimented with a Pi4 in various real-time modes to see how fast it's IO pins can be made to go and results are both good and bad. Output is quick except for awkward pauses due to the scheduler. High-speed input is erratic because there's no way I know of directly handling an IO interrupt in Linux or Windows. Thus inputs are either delayed by the operating system or a CPU has to be dedicated to reading a pin continually in a loop, which is hot, messy and not expandable. And still misses some inputs due to the scheduler taking the CPU out every so often. Does a Parallel Port on a PCI-card overcome these problems, or is a PCI parallel port's performance similar to the original - designed to work a relatively slow printer? My concern isn't CNC specific, it's more a general interest in interfacing computers to fast real-world events without extra hardware. Dave
Hello! SO - Linuxcnc runs a real time kernel. You test the real time latency of the computer. How fast you can read/twiddle the bits is based on that. So - if you use the printer port you are relying on the computer to do the high speed stuff (PWM, Step generation, encoder reading and so on) So you normally have 2 real time threads when doing it all in the computer. Base thread (fast thread that does the high speed reading and pulse generation) servo thread (usually 1 to 5khz that does the trajectory planning and pid calcs and such) (side note - when you have external interface hardware - like Mesa - the high speed stuff gets moved to the external hardware - so you don't have the base thread anymore. You still have a 1-5khz real time thread in the computer) The base thread speed really depends on how well the computer can run the realtime kernel. The computer I am using in the video is a 3rd gen i5 HP. It has pretty decent latency and allows for a base thread of around 40-50 khz. I have not seen computer hardware get much higher than that with linux/linuxcnc. I have not seen much of a difference between onboard, pci and pci-e printer port cards. (other than some features are there or not depending on how it was made)
I have have tested linuxcnc with gpio on the rpi 4 - the base thread I got was 20khz - but because some functionality is missing in the linuxcnc gpio driver - you can only get 10khz step pulses. (the printer port driver for linuxcnc has a reset function which allows you to output steps at the base period frequency.) The rpi4 does play nice with Mesa hardware - I use an ethernet to run the below machines.. Spi is an option to. Here is the same machine running off the printer port.. (audio even sucks worse than my normal sucky audio)
|
sam sokolik | 01/09/2022 18:48:18 |
126 forum posts | as far as real time threads go.. Say you have a 25us base thread. (40khz) Every 25us (+/- latency) code runs (outputting steps, pwm, setting i/o, reading encoders, whatever) this happens every 25us. (otherwise it isn't real time) Same goes for the servo thread say - 1khz every 1ms
sam |
Frances IoM | 01/09/2022 19:45:18 |
1395 forum posts 30 photos | I used a similar approach with an old 8086 computer running Dos in the 80's - one interrupt - the RTC jacked up to better than 1 ms which code merely read status bits, in my case of several serial lines which if were ready then read or transmitted into or out of a buffer and exited - probably used less than 30% of the extremely limited processor time in this tight code - processing of the data was done by a simple scheduler running a task until it gave up control - obviously buffer lengths needed to be correctly chosen. |
Michael Gilligan | 01/09/2022 21:01:31 |
![]() 23121 forum posts 1360 photos | Useful link, here: **LINK** http://wearcam.org/seatsale/programs/www.beyondlogic.org/index.html#PARALLEL MichaelG. |
sam sokolik | 04/09/2022 19:09:16 |
126 forum posts | When the ball nut doesn't fit.. Grind it. Don't look too close. Don't know if it fits yet - the lathe is at the shop.
sam |
sam sokolik | 07/09/2022 17:51:42 |
126 forum posts | Test fitting.. One of the main reasons for a 3d printer... |
sam sokolik | 09/09/2022 15:17:07 |
126 forum posts | Little update.. Made some 3d printed parts to mock up the new ball screw.. Looks good. I think all I have to do is move the ball screw out about .050" or so. Edited By sam sokolik on 09/09/2022 15:42:33 |
Please login to post a reply.
Want the latest issue of Model Engineer or Model Engineers' Workshop? Use our magazine locator links to find your nearest stockist!
Sign up to our newsletter and get a free digital issue.
You can unsubscribe at anytime. View our privacy policy at www.mortons.co.uk/privacy
You can contact us by phone, mail or email about the magazines including becoming a contributor, submitting reader's letters or making queries about articles. You can also get in touch about this website, advertising or other general issues.
Click THIS LINK for full contact details.
For subscription issues please see THIS LINK.