Hello Guest it is March 28, 2024, 07:55:31 PM

Author Topic: High Speed Servo as Spindle - My Solution  (Read 29375 times)

0 Members and 1 Guest are viewing this topic.

Re: High Speed Servo as Spindle - My Solution
« Reply #20 on: December 07, 2011, 02:28:32 AM »
Yes port 0 is the MODBUS. The pins of port 0 are the registers.

I haven't used a macro to talk to the modbus yet. I did that with the a brain. So I'm not much help there. My marcos, at this point, just toggle a user defined LED. That LED is tied to the MOSBUS via the brain.

Offline simpson36

*
  •  1,369 1,369
    • View Profile
Re: High Speed Servo as Spindle - My Solution
« Reply #21 on: December 07, 2011, 03:27:41 AM »
Damon;

Thanks for the reply. The programmer's reference has little to say about ModBus, but I did get it all figured out and I have everything working now. I think Macros will be more useful as they can be embedded ion the G-code. This will be  8) to play with  . . . sort of Pandora's box, however.
 I love programming, but I tend to get obsessed with it and once I start writing, I do not eat or sleep until the program is finished. Thankfully, G-code and Macros are very short as programs go  :)
Re: High Speed Servo as Spindle - My Solution
« Reply #22 on: December 07, 2011, 01:33:48 PM »
YA macros have there place for sure. Certain functions like updating the speed and watching EStop are best handled with a brain. My macros will become much more than they are now as they will need to handle homing when coming out of turning mode. I also make sure the spindle if off before the switch and if there is any dwell time required the macro will handle that as well. Glad you got things working.

Offline simpson36

*
  •  1,369 1,369
    • View Profile
Re: High Speed Servo as Spindle - My Solution
« Reply #23 on: December 07, 2011, 03:27:32 PM »
Well, I am glad I had some time to poke around on forums (recovering from surgery :'() and came across this thread. I'm going to have a lot of fun with this and maybe even come up with something useful . . .  ;)   Now I have an itch to make up a high speed spindle and drive it with a Mitsu 750W AC servo thru a 6:1 (24,000 RPM) flat belt setup. With spindle load monitoring on-screen, belt change and index mode for hard tapping and on and on . . . all done on the Arduino. How about M600 P25 Q28 R375  (hard tap 1/4-28 .375 deep)

 Just FYI, I do the 4th axis homing via macro, but homing is actually not always needed. Here is a video example of a production part with hard tapping and opposing flats on the barrel. Indexing mode yes, but homing not needed. Thanks for taking the time to explain the Arduino/Modbus interface. Hope the video inspires.

http://www.youtube.com/watch?v=HvjnDQoh-7I
« Last Edit: December 07, 2011, 03:36:10 PM by simpson36 »
Re: High Speed Servo as Spindle - My Solution
« Reply #24 on: December 07, 2011, 05:39:53 PM »
Glad you found the info useful. It's the least I could do considering it's your 4th axis design that started me down this path in the first place.  ;D

Offline simpson36

*
  •  1,369 1,369
    • View Profile
Re: High Speed Servo as Spindle - My Solution
« Reply #25 on: December 12, 2011, 01:24:27 PM »
Quick update:

I have bidirectional communication over Modbus working between Arduino and MACH. Also macros in MACH reading commanded speed and sending that data to the Arduino which in turn generates a PWM signal to create a 0 to 5V ref which is converted to 0 to 10V thru an opto-isolator to provide the follow voltage for speed control using a VFD or equiv. motor control. All sorts of on/off relays can also be controlled via direct command from Mach or semi autonomously thru program logic in the Arduino.

Mach can read the registers in the Arduino, and then apply that data to any normal MACH use (control, DRO, etc). The Arduino can fill the registers based on data from any number of sources (MACH, sensors of all kinds, signals from drives, etc). I looked at the frequency generators mentioned earlier in this thread, but they would only be useful in running a spindle continuously and would not be useful in positioning , so for my purposes (hard tapping capability), that rout is a dead end (unless I am missing something).

During my research on this topic, I finally watched all  of the MACH tutorial videos and also discovered a bunch of new/updated products. I have ordered a new programable digital accelerometer, the new Arduino mega board and a 4 line LCD to play with. I have had the idea for a long time to put a plc between some devices and Mach to supplement the capabilities of the system. An example is to monitor the spindle load and automatically slow the feed rate slightly to prevent a stall (hopefully with an e-stop) or overheating of the spindle motor. Also, since I cut a lot of aluminum and have broken many, many endmills when they clog up, spindle monitoring would save me a lot of money . . . .

I will need to do some testing to determine how fast a square wave the Arduino can generate . .  unless someone has already done this and will post the info . .  :-*
Re: High Speed Servo as Spindle - My Solution
« Reply #26 on: December 12, 2011, 02:33:47 PM »
I'll answer a couple of your questions together. Arduino by itself will produce a square wave up to a max of 1/3 the clock speed of 16Mhz. The problem is that the increments for the clock speed get larger the higher the frequency goes. See my notes before and the formulas for frequency. This is why I went to the DDS module. It will create any frequency up to 1 Mhz. as a square wave. Also this technology would not and could not be used to index. The USB bus talking to the arduino does not have a consistent update timing sequence. This is why I build the circuit to switch from the DDS frequency for turning mode to the parallel port STEP and DIR pins for indexing mode. The only way to make the Arduino work to index would to make it become a full motion controller and give it control of all the axis's and just feed it movement instructions. Basically what the Smooth stepper does. This is also why the Arduino should not be used directly to home inputs can be delayed at different intervals depending on what is going on in the Arduino and on the PC.

Offline simpson36

*
  •  1,369 1,369
    • View Profile
Re: High Speed Servo as Spindle - My Solution
« Reply #27 on: December 12, 2011, 03:40:54 PM »
I was not intending to use the Arduino for indexing. I was just wondering if it could generate a pulse stream fast enough to spin the 4th axis in turning mode. The reason being that acceleration and deceleration are major considerations with the 4th axis in 'lathe mode'. And as you might imagine, the profiles vary greatly with and without a chuck installed and also with the mass of the workpiece.

The Arduino, if it were monitoring the motor load, could adjust the acceleration in real time based on the load. Assuming the Arduino was controlling a dedicated frequency generator,  it may be possible to accomplish the same thing, albeit with some amount of lag time, which may or may not be a significant problem. So again we have more than one way to skin the cat.

I am mulling over a number of arrangements, but one that seems to make sense is to dedicate MACH's "S" axis  and "C" axis to the mill spindle and the "C" axis plus the Arduino to the 4th axis, with the Arduino handling the 'lathe mode' operation in some manner.

There are a bunch of different frequency generators on ebay ranging up to 40mhz. Do you have a link to the one that you chose?
Re: High Speed Servo as Spindle - My Solution
« Reply #28 on: December 12, 2011, 04:40:52 PM »
This is the one I used:

http://www.ebay.com/itm/190570439517?ssPageName=STRK:MEWAX:IT&_trksid=p3984.m1423.l2649

Note that even though they say 70Mhz they will only produce a square wave up to 1 Mhz. This is a limit of the build in comparator that it being used to generate the square wave from the sine wave produced. Pulse width is also set in two ways. either by an onboard pot or an external voltage reference. So far my testing shows that this will not need to vary and I can set it and forget it via the pot. Most drives will signal on either the up edge or the down edge of a square wave and don't care about the width of the pulse as long as it's long enough to trigger.

Acceleration and Decel profiles could be programmed into Arduino. Currently I have a fixed program to ramp up and down the final frequency. You bring up a great point of being able to change them on the fly based on the load on the spindle. Either via a feedback loop or via a user defined setup. You could add a DRO to Mach and pass it to Arduino that would then select a profile for different ramping requirements. Just thinking out loud. Will cros that road when the time comes.

One other thought: you mentioned you are passing the speed to Arduino via a macro. Is this the override speed? I did mine via a brain instead so no matter how the override speed gets changed it will always be correct in Arduino. Just a thought for you.

Offline simpson36

*
  •  1,369 1,369
    • View Profile
Re: High Speed Servo as Spindle - My Solution
« Reply #29 on: December 12, 2011, 05:56:34 PM »
One other thought: you mentioned you are passing the speed to Arduino via a macro. Is this the override speed? I did mine via a brain instead so no matter how the override speed gets changed it will always be correct in Arduino. Just a thought for you.

My 4th axis (axii?) are used on a variety of systems, so I try to avoid using capabilities that are specific to only one software. Brains have an advantage in speed, but they are unique to Mach, so far as I am aware.

I do 'swapaxis' in hardware for the same reason.


Do you have the signal generator working with a drive?