I am a hobbiest and this is my first post, thought to share and take opinions of what I am doing. Its more of a self challenge project to learn more about electronics and Arduinos teensy etc…
I have a CNC sherline 5410 run by Mach3, via a C11G BOB all is working fine. Two issues annoy me and have caused me some problems (honestly they are user errors, i.e. me being hasty)
First, The spindle issues; when it over heats, the thermal cutoff turns off the spindle and you have a damaged piece or bit and mostly both. Sometimes it’s a deep cut by mistake or forgetting to reset the Z after a tool change etc…
Second; the steppers sometimes skip steps, also due to some hasty error like a big cut or not resetting the Z as above, sometimes I increase the rapids etc…
My small project in short is using Arduinos and a Teensy (small programmable microprocessors) hooked to sensors to measure most of the critical stats of the CNC mill, and have it control additionally the Spindle and EN-Safety switch.
This is how I approached the issue:
The Teensy will be the Master and receive info of the sensors via I2C from the other Arduinos, each Arduino will have a certain task to read the sensor Values, consolidate them and send them to the Teensy via I2C
The Teensy is Also hooked up to a 4.3 " touch screen to display all the sensor values graphically. It will also control the Spindle and EN-Safety switch.
I planned to have one Arduino for each stepper motor (lets call them Arduino UNO X,UNO Y and UNO Z); it will read the pulses and direction sent to the Stepper from the BOB, and also read the rotation status of the Stepper motor. Additionally with all the wiring I added a temp sensor for each stepper and Stepper Driver (just for fun)
So lets say I have 1600 steps per 1 rotation of the Stepper motor, giving a movement of 1 mm. I have attached a slotted disc with 10 notches, having the notches equal to the un notched part. A photointerrupter reads status of the stepper motor rotation. each 80 (1600/20) pulses should change the status of the photointerrupter, if more than 80 pulses are detected and no change in the photointerrupter reading means the stepper started skipping.
Now why 3 arduinos, one for each stepper. Each Arduino can monitor 2 interrupts. So 1 interrupt will be reading the pulses, the second interrupt will be reading the photointerrupter. And a digital pin to read the Direction. One Teensy can do the Job of the 3 arduinos, but I couldn't manage to get all the interrupts working... thats another project.
As for the Spindle, I had to use 2 Arduinos, why? (lets name them Arduino UNO 1 and Arduini UNO 2
I have my spindle wired to the C11G BOB, and according th the C11 manual, the 12V supply should not be sharing a ground with the 5V supply to the Board. The I2C communication needs to have a common ground between all the communicating Arduinos and Teensy. To solve the issue, One Arduino will be powered from a separate 12V power supply thru a 7805, which also powers the spindle 12V part of the C11G BOB. The other Arduinos, Teensy and the C11 are powered by a separate 5V Power Supply.
So one Arduino (Arduino UNO 1) will read the Amps on the Spindle, the P2 voltage applied to the Sherline Speed Controller (0-10V) and the 0-130V out put to the motor. These values will be transmitted via 7no 4N35 Optoisolators to the Second Arduino (Arduino UNO 2), had to write a seperate code to get this working.
The secont Arduino (Arduino UNO 2) will additionally read the spindle rpm via a photointerrupter and some Temperatures it will send all the Data to the Teensy.
I am half way thru the project below is my status:
- I2C communication between UNO X, UNO 2 and Teensy - Done
- Displaying the Data on the 4.3"TFT, Done, needs refinement.
- Custom encoder disc and Photointerrupter, mocked up and working. needs refinement
- UNO 1 reads Dir, Pul and custom encoder Photointerrupter, almost done; problems with pulse reading
- UNO 2 reading the spindle speed, almost done
- UNO 1 to UNO 2 optoisolated communication - Done
- Temeprature reading to be done last, they should not be an issue.
This will be a long Project, and hopefully I will try updating every now and then. I do have some issues which I will be requesting some assistance but will keep for the following posts.
Opinions, Comments are most welcome.