Andy from Workshopshed | 14/12/2015 14:49:03 |
![]() 50 forum posts 9 photos | I saw this in MEW 235, and I can't work out why it is needed. |
Emgee | 14/12/2015 15:15:04 |
2610 forum posts 312 photos | Andy A bit more info would help !!!!!!!! Emgee
|
Bob Mc | 14/12/2015 15:23:25 |
231 forum posts 50 photos | Hi Andy... I wrote the article about using Arduino's .... if you need any information just let me know on this forum. ..rgds...Bob McMenemie. |
Andy from Workshopshed | 14/12/2015 15:42:02 |
![]() 50 forum posts 9 photos | Hi Bob, I understood the article on your electronic lead screw idea and understand how the common crystal approach works. But the bit I did not understand is why you needed to do that in the first place. Cheers, Andy |
jason udall | 14/12/2015 16:33:49 |
2032 forum posts 41 photos | I too saw this. And wondered why two arduino. Yes if using two then it provides a sync ( mostly) between the two processors . |
Bob Mc | 14/12/2015 16:35:53 |
231 forum posts 50 photos | Hi Andy... A good question...! The reason why synchronisation of the two Arduino's is necessary is that the two motors (one drives the leadscrew and the other the Spindle), need to have their relative speeds constant, notice the term 'relative' . For example if the required ratio of Spindle speed to Leadscrew speed was 1:4 then for 1 turn of the spindle there would be 4 turns of the leadscrew ; if the pitch of the leadscrew was 1mm then 4 turns would produce a pitch of 4mm on the work. Now if the Arduino driving the leadscrew motor began to increase or decrease its speed relative to the Spindle motor speed, the ratio of 1:4 is altered and the required pitch on the work would no longer be 4mm. It is an unfortunate fact that no matter how good the clock circuits are in any two microprocessor systems they will not keep in sychronisation if they are completely separate systems. The Arduino can only provide a minimum clock pulse period of 1microsec duration, using two Arduino's the clock pulse rates will most certainly alter over time which is the root cause of the problem, and so by using only one clock for the two Arduino's the problem of clock drift is eliminated. It might be thought that the difference in speeds would be so small that it really wouldn't amount to much, however when the work requires long pitches to be made all the errors begin to add up, If you have two Arduino's just try the Blink program with a 500ms delay period for switching the Leds on & off... it won't take long for the two Leds to be out of sync. Hope that helps, if you need any more info I am only too glad to help. rgds..Bob. |
jason udall | 14/12/2015 16:50:16 |
2032 forum posts 41 photos | Thaks for taking the trouble to respond Bob . I still wonder why two arduino . why not one device . 3d printers have 4 co-ordinated axis. achived with a single processor. Edited By jason udall on 14/12/2015 16:51:27 |
Andy from Workshopshed | 14/12/2015 16:53:15 |
![]() 50 forum posts 9 photos | Cheers Bob, that all makes sense. There's many ways to crack a nut and it's interesting to see other people's approaches. Jason, I believe most Arduino based 3d printer drivers use the faster and more powerful Mega board. That also has more I/O so could drive 3 steppers. Edited By Andy from Workshopshed on 14/12/2015 16:54:19 |
jason udall | 14/12/2015 18:10:12 |
2032 forum posts 41 photos | Andy... Many three d printer do indeed use mega. But my favourite arduino is the nano.. That has 14 digital I/o 3 at least are pwm hardware It also has 8 analog inputs which can also be used as digital inputs. To control stepper motors You will need two bits per motor..ie four outputs.. That leaves at least ten pins for" ratio" say. And two analog pins for "speed".. But yes heaven forbid use a mega/ramps/stepper kit.. ?32 for 1A stepper |
Andy from Workshopshed | 14/12/2015 18:25:51 |
![]() 50 forum posts 9 photos | Yes, a single Arduino Uno has enough I/O to handle the motors and still have pins left for control signals. I did like Bob's trick of using an analogue input with a resistor ladder to provide the control input. My favourite Arduino is the Pro Micro I used one in my clock project, controlling a couple of stepper motors directly (4 pins each) and getting the time from an RTC module (2 pins). |
Bob Mc | 14/12/2015 18:28:11 |
231 forum posts 50 photos | Hi Jason.... another good question..! Andy has hit the nail on the head in his response. Basically use could have been made of a more powerful processor which would in principle have the capability of providing 2 sets of independent clock pulses from the one processor.... however and unfortunately the Arduino can't do this. I have to admit that although I worked in electronics for many years I was not involved in programming. I decided some time ago that it was rather pointless to start learning programming when I had so many other things to take up my time and interest. the Arduino programming was however much simpler and the open source ideology along with the many forums and articles makes the whole thing less daunting than trying to get to grips with full blown programming. As stated in the article... 'there are I am sure other ways of doing this' ... and I have recently been told that one of the Atmel processors is capable of providing the required pulses, but I have not pursued it. My idea in using this system of two Ard'os just kept it simple and easy to understand although wiring up for one clock is not the easiest thing to do. If you are really considering having a go, I would try to do the wiring of the xtal clock circuit done first and test it using the 'Blink' program ... if the two Leds keep in sync over a minute or so...you are in business...! The other thing that didn't come out in the article very well was the fact that if there are any overall errors in the leadscrew pitch, this can be accommodated with the system and as stated my leadscrew is just a piece of threaded rod, ....will provide details if you need them. Please remember that this is a 'model engineering project' and although I have produced a number of different threaded items such as a spindle end nut for my Atlas lathe, the spindle motor of 3.1Nm is not really capable of taking deep cuts and an amount of experimentation is needed to determine what it will actually cut, in hindsight I should have fitted the next higher power of stepper motor, something of the order of 5Nm, the drivers I mentioned are capable of powering a motor of that size. Any more info required..... I am only too pleased to help. rgds...Bob.
|
Muzzer | 14/12/2015 18:40:55 |
![]() 2904 forum posts 448 photos | I had no idea why you would bother synchronising 2 Arduinos and certainly wouldn't have dreamt of connecting the oscillator pins together like that. Actually a fair chance of them not working correctly with this arrangement. What accuracy are the crystals? And what accuracy do you think is required? Normally crystals are so accurate you'd have difficulty measuring them with normal instruments. Sorry to sound negative but it all seems rather bizarre. |
jason udall | 14/12/2015 18:50:00 |
2032 forum posts 41 photos | Thanks So in summary. It was the processing power limitation that indicated dual processor Which in itself required the common processor clock. And the all thread leadscrew ...well..metric lead screw is 60degree anyway. And as to the pitch accuracy ...how do you think all thread is made? I find if you use a long enough "nut"..many of the worries come to nought High quality ( stainless )seems to be better cut.. |
jason udall | 14/12/2015 18:52:21 |
2032 forum posts 41 photos | Normal micro crystals are 10's of ppm 10 micron in a meter? Btw ever read the step "error" figue for a stepper? Yes 200 per rev..but are they equally spaced.. Edited By jason udall on 14/12/2015 18:56:26 |
jason udall | 14/12/2015 18:54:30 |
2032 forum posts 41 photos | Watch crystals. .. Seconds per week (1:604800) |
Muzzer | 14/12/2015 19:29:09 |
![]() 2904 forum posts 448 photos | 36 pence to replace the ceramic resonator fitted to some Arduinos with a 30ppm crystal - 0.003% |
Andy from Workshopshed | 14/12/2015 20:12:59 |
![]() 50 forum posts 9 photos | On a related note there's a project called the "electronic lead screw" which does something very similar although I think there are rather too many buttons on the control panel. http://autoartisans.com/ELS/
|
frank brown | 15/12/2015 09:09:22 |
436 forum posts 5 photos | .003% sounds very accurate, so I wondered what this would mean in real life. So lets take the spindle as the reference, not disengaging the half nuts and cutting 2" of 40 TPI thread. If the leadscrew is running slow by the .003%, then after the first cut the linear position of the tool would be .003% short of where it should be. i.e. towards the tailstock if cutting towards the chuck. Then running the lathe backwards to get back to the starting position, would also mean that the carriage would run 2" - .003% towards the tailstock which neatly coincides with its starting position. So the error is non accumulative. So the thread will compress by .00006" over 2" this would be extremely accurate! If the lathe could not reverse, so the half nuts have to be disengaged, then the error is accumulative, both on the cut and the number of spindle rotations for winding the carriage back. So if you can wind the carriage back four times faster then the cutting speed and you need 5 cuts to complete the thread then the total error would be 5 times 1.2 times 2" times .003% , still not a lot. But if the spindle was left running half way through the thread cutting exercise while you have a cup of tea, the errors would become gross. Frank |
frank brown | 15/12/2015 09:26:51 |
436 forum posts 5 photos | Second thoughts :- switching the motors to reverse could (will) cause all sorts of problems as the run down of an unpowered pair of motors with different mechanical loading would result in them becoming mechanically out of synchronisation, even if the electrical drives pulses are still synced up. Or just switch off the spindle drive and hope that the leadscrew drive remains in sync. right down to zero speed (so it stops) and will remain in sync when the spindle is restarted in the opposite direction. This sounds like a problem that can not be 100% solved, and disengaging the half nuts is the way to go. Frank |
SillyOldDuffer | 15/12/2015 16:56:49 |
10668 forum posts 2415 photos | Bob's use of a single crystal to drive two oscillators was new to me, but hey it worked! Using two Arduinos rather than one is apparently easier because of a limitation in the standard Arduino library, which is that the tone() function can only be used on one output at a time. Bob's project needs two outputs. There are alternatives that don't require board surgery. It is possible to synchronise two Arduinos using the code below, but they drift apart over time. I tested the code using a Duemilanove and a Mega2560. An oscilloscope shows that the Arduino's start exactly in step but drift apart thereafter. For a nominal 400Hz the Mega2560 outputs 400.7Hz whilst the Duemilanove outputs 400.64Hz. Their 16000kHz crystals are oscillating at slightly different frequencies (16000.30kHz and 16000.48kHz). For Bob's application I doubt this would matter, but his solution fixes that problem. const int input_sync_pin = 6; void setup() { void loop() { Connect GND to GND, and pin 7 on one to pin 6 on the other, twice. Another way is to use one Arduino to produce two tones at the same time. This is possible by installing the third-party library at *LINK*. The library needs a small fix before it will work. After installing the library, find the file "Tone.cpp" and edit it. Change the line reading "#include <wiring.h>" to "#include <Arduino.h>" Don't forget to tell the Arduino IDE to use this library. The tones produced by this example program are based on the same clock and are closely synchronised. #include <Tone.h> Tone t1; int f1 = 500; // Hz void setup() { t1.play(f1); void loop() { delay(1000); //mS
} Kudos to Bob for having a go. Regards, Dave |
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.