clever verification of spindle rpm hal settings?

More
23 Jan 2016 13:42 #68966 by comjon
Digital tachometers and other rpm measurement solutions are not inexpensive, and for the starting hobbyist or student with just enough money for gas, here is a relatively inexpensive suggestion to approximate spindle rpm. Note: I use the term "relatively" because it seems most students somehow afford their smart phone but have no gas money. Go figure.

A smart phone with near field communication (NFC) should be able to detect a magnetic field, and several apps are available, some specifically designed to measure rpms, such as Magnetic Counter for the Android.

In your HAL configuration file, if you are controlling your spindle with 'S' commands via Gcode for an analog spindle motor, you will need to set scale, offset, and gain in you HAL syntax, and how to do so can be something of a mystery. First, you ought to check your motors documentation and record rpms at 100% of the duty cycle.

The simplest measure of rpms is visual; a piece of colored tape on a chuck or spindle shaft. Run the spindle at 60 rpms, you should be able to count one revolution per second. :blink: At higher rpms (above 120 depending upon shaft diameter), it is almost impossible to visually count rpms, an prone to inaccuracy.

A visual confirmation of 60 rpms with 'S60' is no confirmation your HAL spindle settings are calibrated correctly. To many this may seem obvious, but not to those unfamiliar with non-linear (logarithmic) scales. Without correct scale, offset, and gain values in your HAL config file, 'S60' with a visual count of 60 rpms likely does not translate to 'S200' equaling 200 rpms; with incorrect HAL values you might turn your spindle at 450 rpms or more with a 'S200'. :blush: and of course things can get dangerous.

To measure rpms using the NFC and the Android app on my phone, I cut a small quarter by half inch (5mm by 15mm should work also) piece from a thin refrigerator magnet and affixed it to the narrowest diameter of the spindle shaft I could easily and safely hold my smart phone near to gather an accurate measure. The Magnetic Counter app permits changing the threshold to detect the presence of a magnetic field, and the graph in the app should show a wave oscilloscope pattern as a visual indicator you are detecting a change in magnetic field as the spindle rotates. DO NOT use a chunky piece of magnet, for obvious reasons, and DO NOT use any rare earth (neodymium) magnets; you do not need them if you set your threshold correctly. Keep any magnet away from your PC and all CNC motors. Seems obvious, obvious yes?

For my test, the magnet itself was sufficient to hold to the spindle shaft. If you decide to use some other means to hold the magnet in place, think about the consequence of removing the glue or other adhesive once you have finished measuring. If you are think of using a spot weld, don't.

A combination of measurements and HAL file scale, gain, and offset modifications should get you very close to accurate spindle speeds. Read more about these settings in the LinuxCNC Manual, and have a happy and safe hackaday!

Please Log in or Create an account to join the conversation.

More
28 Jan 2016 18:46 #69207 by LearningLinuxCNC
Very cool app. I am going to give it a try.

Thanks for the info.

Please Log in or Create an account to join the conversation.

More
02 Feb 2016 13:53 #69438 by andypugh
Another way involves a length of threaded rod and a nut.
Just hold the nut with your fingers and time how long it takes to travel the length of the rod.
(Let go at the end)

Please Log in or Create an account to join the conversation.

Time to create page: 0.208 seconds
Powered by Kunena Forum