# Arduino RPM Application for Sieg Lathes and Mills



## Jennifer Edwards (Nov 27, 2018)

I recently purchased from Axminster a Sieg SC2 Lathe, and SX2 Milling Machine. To my dismay there was no way to tell how many RPM's the spindles were turning. When I looked at the price of the add on LCD display, I was shocked to learn that they sell for £150 each!

Thinking that a simple chip and LCD display in a tacky white plastic box should cost more like £15 I set off on a quest to build my own.

I began by posting a thread on this forum inquiring about the "pinout" of the RPM port on these machines and was lucky enough to get a response that directed me to "macpod.net" where a guy named Jeffery Nelson had done the grunt work of analyzing the data on the seven pin "RPM" port located on a number of Sieg machines including mine. BTW he sells an Arduino kit to make your own for £50. Alas me being the cheapskate I am decided to go it on my own,

So I started by hitting up Amazon and purchasing an Arduino R3 clone, an LCD display, a couple of enclousures for them, a few Arduino jumpers, and a seven pin plug to match the port on my machines.

My next issue was learning how to program in the Arduino language, which was suprisingly easy as I spent the last 20 years of my career working in the "C++" language which is very similar.

I began by taking a bit of code that Jeffery had written and modified it to write to the I2C type LCD I had chosen, which used two wires for data as compared to the many that the older LCD's use. It was an interesting journey thru the world of port addresses and interrupts. Having that sorted I uploaded the code to my Arduino R3 clone, and to my amazment it looked as though it may work. I had added some debugging display statements in the code that output to the LCD at each step and to my amazment it ran!

Here is the Pinout from Jeffery's web site:







This is the "pinout" of the RPM port on the Seig machines.  The drawing is as if you were looking into the port.  As you can see there are three data lines, pins 1,2, and 3, and two sets of 5V DC power on pins 4 thru 7. Which Arduino pins to jumper from the Seig RPM port to your Arduino board are defined in the documentation included in my code.

 I scoped out the power on pins 4 & 5 and determined it is very clean regulated power at 4.96 Vdc on my lathe and 4.98 Vdc on my mill, perfect to power an arduino board, which solved the issue of needing an external power source to run the board and LCD.

So I hit up good old Amazon and searched for a  GX16 type 7  female plug. To my dismay it was the only part of the project I could not find there. Fortunately good ole E-Bay came thru for me, I was able to purchase two of them for a mere £3.

While on Amazon I purchased te remainder of the hardware needed for the project including an Arduino UNO R3 clone, Some arduino jumpers, a bit of heat shrink tubing, an LCD display, and enclosures for the board and display. the total investment for everything was just shy of £30. I am sure you can do even better if you shop around.

This is everything I purchased for the project:






First I tackled soldering the five Arduino jumpers to the seven pin connector, which turned out to be tedious. I am sure some choice expletives echoed around my shop while using my antique underpowered soldering iron.







Before assembling the plug I placed a dab of hot glue in the center of the soldered wires and also placed a strip of electrical tape around the outside to insulate the wires from one another and the metal casing on the plug. I finally used a little heat shrinkable tubing to make it  pretty.

The next step was to assemble the LCD enclosure, which to be honest I do not like as the back is open to the elemens, which in my shop can incluse flying metal chips. it will be replaced when I re-engineer this prototype and build a single enclosure for the whole project.






Following this step I placed the R3 clone into its enclosure, attached all the jumpers to the proper pins (which are defined in the code I will place at the end of this post). I put a dab of hot glue on the enclosure where the jumpers were attached just to keep them in place, but still be removable when I disassemble this prototype and build the final enclosure.






I was now ready to test my code for the first time, a scary moment for any progrmmer. for the forst test i chose t use my lathe. I inserted my seven pin plug into the port which is labeled "RPM" and to my amazment the boards LED lit, the display came to life, and displayed my first step message "LCD Found":






Things were looking good. After another second or so the program header message which is displayed when all the pins are defined and the program is ready to begin looping scanning the port was dislayed:






I just had to see my name in lights! Now the program entered its looping and began reading the four packet groups theat are sent by the Seig controller board. the first message i saw was the "Stopped" message, which I have since changed to "Spindle Stopped" for clairification:

View attachment 105574


I was really getting excited, the program was behaving as it should, but could it actually read the spindle speed when the packets began to fly? I gingerly twisted the speed control knob a little and to my great pleasure recieved the following:











I was in business! the darn thing worked like a charm. Just to be certain I Checked the spindle speed with the strobe application that i mentioned in an earlier post and clocked it at 322 RPM's not too shabby.

The Sieg controller board transmits the  thousands, hundreds and tens column out the RPM port and always leaves the fourth  "ones" column at zero. By playing with the strobe I had determined that The controller board rounds the RPMs up the tens column when the ones column speed gets to a six, so from one to 5 rpm you would see a zero displayed, from six to sixteen you would see 10 dispayed and etc... so accuracy of the Sig data is never more than 5 RPM's in error. Way more than accurate enough for the model engineer.

Here is an image of the final product. I attached the Arduino board on the back side of the lathes motor enclosure (visible on back left) and the LCD on top where I can easily see it. Notice the port on the Arduino enclosure is facing upwards, so I can easily attach my printer cable to it when and if I apply updates to the program.






Conclusion:

This is one way you can beat the high price of the ready made RPM display available from Axminster and other supliers, and have some fun learning to use the Arduino system.

This project was to build myself a prototype to verify that I had the coding to run the two wire I2c type LCD and that the code I located on the net was still viable. With this done I will now build a permamant home for my little Arduino project. I will post the final product when i have built its permamant enclosure.

Thank you to Jeffery Nelson for making all the information needed to buld this project on his web site: www.macpod.net available under his "Hacking the SX2 mini mill" heading.

here is the latest non inclusive list of machines that this code works with:


_Sieg Industries - SX2 Mini Mill Drill_
_Sieg Industries - SX2L Mini Mill Drill_
_Sieg Industries - SX2P Mini Mill Drill_
_Sieg Industries - SX2LF Mini Mill Drill_
_Sieg Industries - SC2 Mini Lathe_
_Little Machine Shop - 4190 HiTorque Mini Mill, Deluxe_
_Little Machine Shop - 3990 HiTorque Mini Mill, Solid Column with Air Spring_
_Little Machine Shop - 3990 HiTorque Mini Mill, Solid Column_
_Little Machine Shop - 3960 HiTorque Mini Mill, Solid Column_
_Little Machine Shop - 3900 HiTorque Mini Mill, Tilting Column_
_Little Machine Shop - 4100 HiTorque 7x12 Mini Lathe, Deluxe_
_Little Machine Shop - 4200 HiTorque 7x12 Mini Lathe_
_Little Machine Shop - 5100 HiTorque 7x16 Mini Lathe_
_Craftex - CX-Series CX612 - 3/4 HP Mini Mill with Brushless Motor_
Finally, I attempted to list the code here in this forum but it was too long to post here.

If you want a copy of the code please e-mail me at:  [email protected]

Thanks for reading, I look forward to your coments,
Jenny

I have added the code as an attachment.


----------



## chucketn (Nov 27, 2018)

Well done, Jenny!
Do you have a rotary table? I used an Arduino Uno to control my 4" RT. The same circuit/sketch can be altered to automate a dividing head. I also designed a case for the Arduino, LCD, keypad, and stepper driver board, but haven't printed it yet.
The RT controller setup is detailed on this forum, including the code.


----------



## Jennifer Edwards (Nov 27, 2018)

chucketn said:


> Well done, Jenny!
> Do you have a rotary table? I used an Arduino Uno to control my 4" RT. The same circuit/sketch can be altered to automate a dividing head. I also designed a case for the Arduino, LCD, keypad, and stepper driver board, but haven't printed it yet.
> The RT controller setup is detailed on this forum, including the code.



Thank you for the nice comment.

Yes I do have a rotary table, but alas and alak it is but a manual one. I have done a lot of CNC work in the past so perhaps one day I will attach a stepper motor and play with it. i use it so infrequently that it is not high on my "to do" list.


----------



## Jennifer Edwards (Nov 27, 2018)

chucketn said:


> Well done, Jenny!
> Do you have a rotary table? I used an Arduino Uno to control my 4" RT. The same circuit/sketch can be altered to automate a dividing head. I also designed a case for the Arduino, LCD, keypad, and stepper driver board, but haven't printed it yet.
> The RT controller setup is detailed on this forum, including the code.



I tried to post the code here but it was too long to fit in the post, there is a thousand character ( or is it word?) limit for a single post.


----------



## Scott_M (Nov 27, 2018)

Hi Jenny
Nice work !
You should be able to add the code as an attachment. A .txt file should work and just tell folks to copy and paste into the Arduino IDE.

Scott


----------



## Jennifer Edwards (Nov 27, 2018)

Scott_M said:


> Hi Jenny
> Nice work !
> You should be able to add the code as an attachment. A .txt file should work and just tell folks to copy and paste into the Arduino IDE.
> 
> Scott




Thanks scott, I deleted one of my images and that made room for an attachment. I appreciate the help!


----------



## AndrewMcW (Nov 27, 2018)

Hi  Jenny,

I did a similar display for and SC3 (and SX2P mill) and shared the design with a YouTuber called Andrew Whale.  Here is the video he did about it:


Both of us used an Arduino Nano (clone) for it's small size, and a 4 digit "Digital Tube" display; but otherwise similar to yours.  I shared some drawings and my Arduino sketch with Andrew Whale - if anyone wants them just ask either here, or I think the other Andrew will forward them out too.

Thanks to MacPod/Jeff Nelson for doing the really hard work of figuring it out!

Cheers - Andrew


----------



## oldboy (Nov 27, 2018)

Would love a copy of the diagrams & code please.  You are both doing a great job developing this, as Jennifer points out the cost of buying one is over the top.  Thank you both.  I tried to get the diagram from Andrew in the video, I think my request got lost in the electronic maze.

Barry
Australia


----------



## AndrewMcW (Nov 27, 2018)

Hi Barry - I started a "conversation"  with you - hopefully did it right!  Just need your email...

Cheers - Andrew


----------



## Jennifer Edwards (Nov 28, 2018)

AndrewMcW said:


> Hi  Jenny,
> 
> I did a similar display for and SC3 (and SX2P mill) and shared the design with a YouTuber called Andrew Whale.  Here is the video he did about it:
> 
> ...




Thanks Andrew,

Yes I have thought about using Nano and a NIXIE tube display, which would look really cool, but I did not want to get in to an external power supply the nixies require. In fact the original code that I left intact can be un-remarked and it will work with that type of display without removing mine.

I chose this display because I would like to expand on the program to allow input of material and diameter and display a suggested speed. Perhaps from a menu of materials and diameters you could scroll thru. Maybe use a Bluetooth board and mobile phone combo for input. The possibilities are endless.

It is the reason that I chose a two pin two line display. Got extra character space and to lessen impact on the boards limited I/O capabilities.

Currently I am trying to decide what sort of input device to employ.

Yes Jeffery saved me me lot of work, it would have been a much longer project without his help. I made an appropriate donation to his cause and have corresponded with him.

Thanks again,
Jen


----------



## Jennifer Edwards (Nov 28, 2018)

oldboy said:


> Would love a copy of the diagrams & code please.  You are both doing a great job developing this, as Jennifer points out the cost of buying one is over the top.  Thank you both.  I tried to get the diagram from Andrew in the video, I think my request got lost in the electronic maze.
> 
> Barry
> Australia




Barry, 

Thank you for the kind words,

I placed everything you need to wire it in the code at the bottom of my post.

Jenny


----------



## AndrewMcW (Nov 28, 2018)

Hi again Jenny,

Regarding the name "digital tube", it's a bit misleading! It's just what the chinese ebayers call the 4 digit LED display.  I've no idea why, as it's simply a 4 digit LED display with a TM1637 chip to make it I2C addressable.   I guess it's intended for use in a clock, but in this application we can just use the 4 digits. There is no separate power supply required - in fact the connection to a Nano is very neat: just using 4 wires to the ICSP header.

Personally I like the big LED display....but your 16x2 display is more flexible if you want to do other things with it.

Cheers - Andrew


----------



## Jennifer Edwards (Nov 29, 2018)

AndrewMcW said:


> Hi again Jenny,
> 
> Regarding the name "digital tube", it's a bit misleading! It's just what the chinese ebayers call the 4 digit LED display.  I've no idea why, as it's simply a 4 digit LED display with a TM1637 chip to make it I2C addressable.   I guess it's intended for use in a clock, but in this application we can just use the 4 digits. There is no separate power supply required - in fact the connection to a Nano is very neat: just using 4 wires to the ICSP header.
> 
> ...




Yes I gathered that. And I have used the two line display with an eye to some fun improvements in the future.

I left the four digit code intact, so it will output either way without raising an error,

The code actually outputs to both streams The I2C and the serial four digit display originally used by Jeffery.


----------



## Jennifer Edwards (Feb 2, 2019)

This is an FYI;

I just had another request for a copy of the code for this project.

There is a complete copy attached to the bottom of my original post that anyone can download.

If you have a problem downloading it I am more than happy to email a copy to anyone.


----------



## chucketn (Feb 3, 2019)

I think the 'Digital Tube' name is in reference to the old Nixi tube displays... Maybe you  are not old enough to remember them... Anyone have a reference to a part # for the "digital Tube"?


----------



## AndrewMcW (Feb 3, 2019)

Not too young to remember nixie tubes, unfortunately!
The "Digital tube" that I used can be found on eBay by searching for "D4056A".
Please be aware that this display is _not_ going to work with Jennifer's sketch which is posted above. It needs a different arduino library.


----------



## chucketn (Feb 4, 2019)

Thank you Andrew. I'll check them out and the required library.


----------



## Jennifer Edwards (Feb 4, 2019)

You can still buy Nixie tubes, there is a company in Russia manufacturing them. You can often find them being flogged on eBay, and a few folks sell them direct from various web sites.

A few years back I built a “steam punk” looking clock with a set of them. There is nothing like that Cold War countdown look they give.


----------



## Captain_Obvious (Feb 22, 2019)

Maybe they're trying to convince buyers that it is actually a VFD display?

Russians aren't the only ones making nixie tubes either. There's a small business in Czech republic (I think) making them as well. Can't remember what they're called though.


----------



## TonyM (Feb 22, 2019)

Captain_Obvious said:


> Maybe they're trying to convince buyers that it is actually a VFD display?
> 
> Russians aren't the only ones making nixie tubes either. There's a small business in Czech republic (I think) making them as well. Can't remember what they're called though.



It's https://www.daliborfarny.com/product/rz568m-nixie-tube/


----------



## Captain_Obvious (Feb 22, 2019)

Yup, that's the one.


----------



## rodw (Feb 23, 2019)

Very cool but sadly I can't play as my SX3 mill comes with a tacho readout...


----------



## Jennifer Edwards (Mar 23, 2019)

I have had quite a few requests for my code lately so I thought I would attach a copy to this post. Please feel free to contact me if you have any questions of comments.


----------



## Motorman1946 (Jun 8, 2019)

Having just come across this thread read it with interest as I had a similar problem.  With a lathe driven by a 3ph motor controlled by a VFD fitted with a variable resistor giving outputs set from 10 to 70 Hz available at a twiddle of the fingers and a belt variator incorporated within the belt drive I hadn't a clue what speed the chuck was whizzing around at.  I didn't have the ability on my lathe to do what Jenny had done, if I had the Jenny's solution would have been magic, but fortunately another forum pointed me in a different direction.

From Hong Kong via E-Bay I purchased a 4 digit display mounted on a controlling pcb and supplied with proximity sensor and magnet for about £6.50.  Delivered.  Where was the profit in that I thought.  Then I went to Maplins (we had one then) and bought a cheap plastic enclosure for about £4.  I made up an attachment to fit in the end non-working end of the headstock that is secured by a simple expansion arrangement (so it can be very easily removed it it is ever necessary to mount something in the chuck that fits all the way back through the headstock) and Araldited the magnet to that, mounted the sensor to suit and wired it into the pcb together with a 12v dc supply and away I went.  The tricky bit was finding out what wire went where, as there were no instructions!

So, 2 pics below to show read-out and sensor mounted on the end of the headstock.

Hope you don't mind me taking your thread on a little detour Jenny.

Chris


----------



## Jennifer Edwards (Jun 8, 2019)

Great job Chris,

Not only do I not mind, I am happy that this post piqued enough interest to get others to think of their own solutions.

It amazes me how inexpensive electronics from the Far East are. It opens up a whole world of experimentation on a shoestring budget.

I also thought about a pickup/magnet solution but having been a software engineer, and having stumbled over someone else’s work where he had decoded the signal from the controller, I decided to just use the data available from the controller board on my machine.

Now that you bought up how inexpensive  the display and other components are, it makes me wonder just how Axminster can justify charging £150.00 their display?

Well done Chris, a nice solution.


----------



## Motorman1946 (Jun 8, 2019)

Thanks for your kind words Jenny.  Am impressed with your software capability and knowledge, to me it's a black art; as a mechanical guy I am also always suspicious of anything with wires coming out of it!

Yes, electronic stuff from the Far East does seem very inexpensive, how they do it for the price inc. delivery I don't know, but happy to avail myself when I need to, so the high prices some UK supplies charge for stuff is upsetting and seems unjustified.  £150 for the equivalent of what you did does seem just a tad over the top!

We live about an easy half hours drive from Axminister and about 10 years ago I was always eager to visit the Axminister store there.  Not anymore, now I only go if I desperately need something I can't get elsewhere.  Then they had a good stock of metal mangling tools and equipment, now very little, they seem to be more interested in folk that play with that brown stuff rather than metal.  Pity really.  Their service and delivery are as always first class, but they seem to have very limited stock of engineering stuff and have seem to have gone 'up-market' engineering-wise, which is code for the same stuff at much higher prices.  Sadly, despite Axminster being on the doorstep I use ArcEutoTrade for most stuff these days; they, I find, are more reasonably priced and their service and delivery is also excellent plus they cater for a wide range of workshop engineering needs.

Chris


----------



## Jennifer Edwards (Jun 8, 2019)

Yes I agee with your view of Axminster, but i am guilty of having bought one of their 500 watt 7x12 lathes, and an SX2 vertical milling machine from them. I think I liked the colour scheme better ;-)

lately I have purchased much of my tooling, and accesories from Arceurotrade. They are much more reasonable. i thimk I picked up my ER32 collet set from them for about 1/2 price as well.

However I have found making one more jump "ustream" in the supply chain and purchasing directly from the makers saves me even more. If I see something I like at ARC or AXM and the brand name is visible, I simply search for the makers company on-line and buy direct. Great customer circus is worth a lot from a supplier, but not a 100% markup.

For example I purchased my replacable carbide insert tooling direct from Glanze at less than half the price AXM asks and 1/3 less than ARC. I use their mutiple insert fly cutters, and lathe tools. i have also found great end mills both carbide and steel from others at much better prices as well.

OK thats enough off topic blather for now...


----------



## Jennifer Edwards (Jul 22, 2019)

Someone from the Axminster forum that I also posted about my Arduino project did a lot of work getting my code to run on an Arduino NANO. 

He posted his experiences there, so I thought I would pass it along to this forum.

Jenny 


Hi all,

As I was looking for a way to set up a tachometer on my mini-lathe and mini-mill, I stumbled upon this post. It was a great relief: what I wanted already existed and was described in great details. So I asked Jenny about this code and she kindly answered me and sent it to me very fast. Then, I started to play with it.

I decided to use an Arduino nano rather than an Arduino Uno so it could fit within the lathe enclosure, with a window cut on the top for the display. As the LCD screen takes almost all the space in the top panel, this implied moving the green power indicator and to remove the yellow fault light. One consequence of moving the fault LED was to add a new feature to the tachometer so it replaces this notification: I wanted the LCD monitor the fault line and display a “FAULT!!!” message message when needed. As the Arduino nano can use interrupts on only two pins, I therefore started by moving around the pins: yellow positive wire to pin2, LCDCL to pin 3, LCDCS to pin 4 and LCDDI to pin 5. With this setting, I could use one interrupt for the LCDCL (clock for RPM data transmission) and another interrupt for the fault line.

I also wanted to change the interrupt routines to use a more explicit API, using attachInterruptinstead of EIMSK/EICRA/SIGNAL(INT1_vect)that were used on the original code. In the Interrupt Service Routine, I also wanted to reduce memory usage by extracting only the single LCDDI bit (instead of the full 8 bits PIND register). This failed dramatically! I tried a lot of different things in the past few weeks and was not able to achieve my goal. It seems to me that despite the board will be idle most of the time (the rotation rate is refreshed only every 750ms), when it is refreshed the bits arrive fast and the board has a hard time coping with the interrupts. The ISR must therefore be really really short to remain fast enough. I also failed simply replacing the SIGNAL(INT1_vect)declaration with a call to attachInterrupt, but this failed too, and here I don’t understand why. I thought it was only an API change and an overhead to pay only once at setup, but it seems to be also more costly when servicing the interrupt. I basically gave up there. So the handling of the fault line is just done by checking the pin status at the top of the loop routine, without using the interrupt that should be available on pin 2. I don’t like this solution and it seems to sometimes displaying the fault message even when the spindle is rotating… I think however that when I did these tests the pin was not connected and so a floating input may take random values. I will probably have to check this again now that I have rewired everything.

During my numerous tests, it occurred to me that the board missed about two third of the refresh! When using a serial console, I got about one RPM message for two communication errors. As the code was mixing some polling/delay part with interrupt-driven logic, I tried to tighten that a bit, removing the delays and using a circular buffer to allow bits to avoid dropping bits if the loop happened to be run in the middle of a message. In this case, we would have just returned, preserving the partial message received so far and have wait for next call was the circular buffer was still filling up with bits. This failed too. It requires an ISR that can fill up a circular buffer and I think the nano was not powerful enough to do it when the bits stream arrived. It failed despite the circular buffer handling was only a few instructions long with index bits masking to wrap up at the end of a buffer whose size was a power of 2. Losing 2 refresh out of 3 is not the end of the world. When using the lathe, looking at the RPM display is not the main activity. When trying to control the proper speed I simply need to stay a few seconds before the display stabilizes. I can cope with this.

So I went back to Jenny original code with only very few changes (currently the FAULT part was also commented out despite the wire is connected).

The advantages of using a tiny board, shoving it in the lathe enclosure and having only the LCD display sticking out are:


it takes less space on the headstock
there are no risks it will slip and drop with vibrations
there’s no need to buy an enclosure
there’s no need to buy a special plug
In order to do the connections, I only had to cut the wires and crimp in some salvaged female headers into which the male headers from the Arduino nano plug in. I protected the remaining pins of the nano by putting heat shrink everywhere. I may also use some hot glue to prevent the headers from falling in case of vibrations.




Y

I also wrapped the board in a plastic bag before shoving everything in the enclosure.







Cutting the window for the screen and putting the screws in the right place was quite a challenge because I could not move the enclosure to my mini-mill: it was to tall. I cut the window freehand with a Dremel tool. The following image shows the back of the LCD screen mounted on the top surface of the enclosure. It takes the location of the green power light, the yellow fault light, and the LCD socket.






One can hardly see in the previous image the green power light that was moved below the forward/reverse switch and the main fuse. Desoldering the green power light and resoldering the wires after the move was also tricky as the other end of the wires is connected to other wires, thus preventing the soldering operation to be performed conveniently: one as to do it within the enclosure. I later noticed that I cut the window for the LCD screen slightly too close to the opening
(i.e. too close to the spindle). When mounting the enclosure back to the headstock, it almost
touches it.

As is, it works, thanks a lot to @Jenny for sharing this, it helped me tremendously.






For my training, though, I think I will continue to investigate the software changes I wanted to make initially, perhaps using a more powerful board. I purchased the nano boards from China using Ali Express marketplace. The boards costed only 2€ each (maybe this is the reason the boards cannot keep up…). I will try with other boards I purchased from Mouser the ESP32 pico Kit <https://www.mouser.fr/_/?Keyword=ESP32-PICO-KIT>. The provider is more reliable and the ESP32 is far more beefy, probably even overkill for this application. The cost also remains very reasonable (8.73€). Programming is quite different from Arduino, so I will have to change a lot of things.


----------



## Jennifer Edwards (Nov 2, 2019)

Hi Tony,

I came across this video on YouTube and remembered your post on this thread, I thought you may like it.

It is a soup to nuts video of Daliborforny making a batch of his Nixie tubes.


----------



## oliomio (Nov 2, 2019)

Hi Jenny!  
Nice job.  From you know who in Oz.


----------



## james.stevens (Feb 20, 2020)

Great work, Jenny!  I look forward to making my own based on your excellent work.  I'm going to try for a 320X240 display with touchscreen so it will be a little more involved.


----------



## Jennifer Edwards (Feb 21, 2020)

please share what you learn about using the touch screen with us.

My next step was to integrate an input device so one could enter a material and It’s diameter then have the program suggest a speed.

too bad the controller will not accept a digital speed input. If it could, and I’m not sure it can not, then the application could set the desired speed.

have fun,
Jenny


----------



## Jennifer Edwards (Dec 4, 2020)

Just an update,

Since first posting this project I have had over forty people who have contacted me for the code or advice complete this project.

some have successfully used the Arduino “Nano” boards and were able to contain everything inside the existing housing of their lathes and mills, while others built it in a separate enclosure.

I am glad so many of you have enjoyed this quick easy build.

jenny


----------



## Bob Fitch (Jan 9, 2021)

Hi Jenny followed your tacho thread with interest. I have an SX3 CNC Mill which wiped out its electronics with a shorted touchpad to earth. (Many have suffered)
It is now rebuilt with new Sieg components but the Display readout reads half of the spindle RPM. This annoyed me so I thought of a different approach, Many of the contributors to this thread are probably using Mach3 which has an Index input to read the rpm of the Spindle for display and closed loop operation.
I had to replace the three Hall effect Sensors on the DC Brushless Spindle Motor, £4 versus £400 for a new motor, as part of the repair and had a look at the output pulse on a scope. One pulse per rev.  The Sieg CNC BOB is optically separated on inputs so why not piggy back one of the Hall Sensors to the Mach3 Index input.
I found this works accurately but only after applying a factor of 4 to the pully entry in the software, despite the mill being 1:1 for which I have no answer.
Controlling the spindle is another matter I have yet to solve. I can start and stop but controlling the rpm is not there yet. There is pages on other boards on the subject.


----------



## mrehmus (Jan 10, 2021)

Sometimes a Hall Effect sensor is a bad choice. A reed switch will handle the speeds associated with our mills and is essentially bulletproof. We use them instead of the hall sensors in low-speed model IC engine ignition systems.


----------



## Jennifer Edwards (Jan 11, 2021)

Hi Bob,

In response to your statement:

 “I have yet to solve. I can start and stop but controlling the rpm is not there yet. There is pages on other boards on the subject.”


I thought about controlling speed by replacing the potentiometer used now to manually control the speed with a voltage regulator chipset and then manage the speed thru an Arduino application. There are lots of examples that can handle it in the R/C vehicle world.

perhaps set the desired speed with a keypad, then use the output from the rpm application to regulate it. At That point it would be a snap to take it a step further and write another application to determine desired speed based on material, diamete, and cut depth in the case of a lathe, or material, type of tool and depth of cut with a mill.

while it would be a fun thing to do it may be overkill considering most of us are just hobbyists taking light cuts with the way underpowered Sieg equipment we use.

Jenny


----------



## Bob Fitch (Jan 13, 2021)

Hi Jenny yes I agree.  I have now accomplished most of what I aimed to achieve. The piggy backed Hall effect sensor needed some averaging and a pulley ratio applied as there are four pulses per rotation (Not the one I had previously stated) from the Sieg Motor.   Still trying to achieve a speed ratio that does not stall the motor on startup but so far looks promising and a very cheap way of creating a closed loop spindle control.  Electrical Noise is definitely a problem with these machines there are no screened cables just a couple of ferrite rings.  Having 240 Volts close to the touchpad is another horror story. Thanks for the comments


----------



## dsiviero (Nov 14, 2021)

Thanks for the code. I did a variation tweak on an 0.96" oled display, as that's what I had in the draw. Code is attached if anyone wants that. It's in Platform.IO project format, thought the base code is the same as Arduino.


----------



## Jennifer Edwards (Nov 14, 2021)

dsiviero said:


> Thanks for the code. I did a variation tweak on an 0.96" oled display, as that's what I had in the draw. Code is attached if anyone wants that. It's in Platform.IO project format, thought the base code is the same as Arduino.


Thank you for following up! It is appreciated.


----------



## AndrewMcW (Nov 14, 2021)

Not sure if this is of any interest to anyone, but: my latest version uses a 4 digit LED "Digital Tube", with my adaption of the original code from MacPod/Jeffrey Nelson on an ATtiny84 piggy-back board.  Using this, I only need to mount the display somewhere, and attach one cable to either the 7-pin XH header on the original control board, or via the standard Sieg GX16-7 socket.

(My version of the software allows the rpm to be read by another Arduino, via I2C; it's intended for integration into a home-brew Touch-DRO controller...but that's a whole 'nother topic.)


----------



## homemachinist (Nov 15, 2021)

Interesting hack Jenny, nicely done!

Arduino is quite capable of doing more than displaying the RPM. Grbl can run gcode on an Arduino and control 3 axes in realtime.


----------

