Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: CheddarChunk on December 06, 2011, 06:27:18 PM

Title: Brushless DC Servo Spindle Speed Control w/ Smooth Stepper and Leadshine
Post by: CheddarChunk on December 06, 2011, 06:27:18 PM
I'm trying to use a brushless DC Servo motor as my spindle motor and control it with step and direction pulses from Mach3 to a SmoothStepper and Leadshine Driver. After a couple weeks of struggling I could really use some help. So far i can only get the motor to spin at about 1.5 rev/second max no matter what the settings.

My set up:
Windows XP
Mach3 R3.043.022 (lockdown)
SmoothStepper USB Driver 2.08.14
Plug In: SmoothStepper_v17efb
Motor Driver: Leadshine ACS606
Motor: Leadshine BLM57180 (180W brushless DC Servo Motor)
1000 encoder counts per rev
max motor vel: 3000 rpm

Mach/SS settings:
port and pin: Spindle: Step/direction
Motor Tuning: Spindle:
Step/unit: 4000   (assuming this is step pulse per rev?)
Vel: 3000            (assuming this is RPM of the motor and not the spindle?)
Accel: 500
pulley: 25000 max (I'll explain below)

The bottom line is that with these settings the motor will only move within a narrow band of commanded speeds. At S-500 it will turn at about 1 rev/second, at S-875 it will turn at about 1.5 rev/second. Logically i want to set the pulley to 3000 max which should give me a 1:1 motor to spindle ratio which would be nice for development, but within this band the motor will only move slightly at around S-100. Above or below these speeds it just doesn't turn.

Originally (before I got the SS) i though this limitation was because of the high number of pulses needed and the limitations of Mach and the Parallel port. I have the spindle port on the SS set to allow 256k Hz to the spindle which would be sufficient to run the motor at 3000rpm.

I've also set the pulse width in the SS config to 1us as suggested by the Leadshine controller documentation.

Using the Leadshine controller tuning software i can get the motor to spin at 3000 rpm so i don't think its a wiring issue.

The last thing i can think of is that the leadshine controller doc suggests that the direction pulse must lead the step pulse by 5us min. I've tried every combination of step and Dir pulse settings in the motor tuning and it has no effect. Is there a way to control how much the direction pulse will lead the step pulse?

any help would be greatly appreciated.

Kyle


Title: Re: Brushless DC Servo Spindle Speed Control w/ Smooth Stepper and Leadshine
Post by: HimyKabibble on December 06, 2011, 10:00:07 PM
I would first do away with the potential complexities of treating it as a spindle motor, and just set it up in Mach3 as a linear axis drive, and see if you can get that to work.

DIR timing should not be an issue unless you're reversing the direction.  It should still work fine in ONE direction ,as the DIR pin will never be changing state.

Regards,
Ray L.
Title: Re: Brushless DC Servo Spindle Speed Control w/ Smooth Stepper and Leadshine
Post by: CheddarChunk on December 06, 2011, 11:08:11 PM
thanks for the suggestion Ray.

I just tried running the motor as the Y axis with these Motor tuning Settings:

Steps/unit: 4000
Velocity: 3000

the motor will only turn when i run at 3% or 6% of the full velocity (so 90 rpm or 180 rpm respectively). The crazy thing is that at 90 RPM it runs CCW and at 180 RPM it runs CW? WTF?
Title: Re: Brushless DC Servo Spindle Speed Control w/ Smooth Stepper and Leadshine
Post by: HimyKabibble on December 06, 2011, 11:57:24 PM
What happens if you change the ActiveLow setting for the DIR signal in Ports&Pins?

Regards,
Ray L.
Title: Re: Brushless DC Servo Spindle Speed Control w/ Smooth Stepper and Leadshine
Post by: CheddarChunk on December 07, 2011, 12:41:02 AM
If I switch it in mach then i get no motion. If switch it in the motor driver then I get reversed motion.
Title: Re: Brushless DC Servo Spindle Speed Control w/ Smooth Stepper and Leadshine
Post by: HimyKabibble on December 07, 2011, 01:08:32 AM
If I switch it in mach then i get no motion. If switch it in the motor driver then I get reversed motion.

Are you sure you don't have Step and Dir swapped?  I can't see what else could explain what you're reporting.  You might want to try either swapping the wires or the pin assignments in Mach3, and giving it a try.  It would explain what you're seeing.

Regards,
Ray L.
Title: Re: Brushless DC Servo Spindle Speed Control w/ Smooth Stepper and Leadshine
Post by: Hood on December 07, 2011, 02:57:33 AM
One thing is to check what you have in the SS config for the spindle frequency, for your 4000 steps per rev and 3000 rpm it will require 200KHz so use the 256KHz option.
Next thing to say is an acceleration of 500 sounds very high to me for a spindle, try more like 20 and see how you go then increase a bit if it works.

Hood
Title: Re: Brushless DC Servo Spindle Speed Control w/ Smooth Stepper and Leadshine
Post by: HimyKabibble on December 07, 2011, 09:31:07 AM
One thing is to check what you have in the SS config for the spindle frequency, for your 4000 steps per rev and 3000 rpm it will require 200KHz so use the 256KHz option.
Next thing to say is an acceleration of 500 sounds very high to me for a spindle, try more like 20 and see how you go then increase a bit if it works.

Hood

Hood,

For a rotary axis, isn't acceleration in RPM/sec^2?  If so, 500 is not very high.

Regards,
Ray L.
Title: Re: Brushless DC Servo Spindle Speed Control w/ Smooth Stepper and Leadshine
Post by: Hood on December 07, 2011, 10:08:04 AM
Try it and see Ray, my lathe has a servo on the spindle using  the ESS and accel set to 40 and it gets to 2000 rpm in about 1 second. Its got a heavy chuck on it (250mm dia) and  would hate to see what it would try to do at accel of 500 ;)
Beaver  and Bridgeport mills also have servo spindles but with SS and Scorpion respectively, both are 4000 rpm with 60 for accel and again both get to top speed in about 1 second or so.

Hood
Title: Re: Brushless DC Servo Spindle Speed Control w/ Smooth Stepper and Leadshine
Post by: HimyKabibble on December 07, 2011, 10:16:32 AM
Hood,

Hmmmm....  I wonder what the units are then?

In any case, if that were the problem here, the motor shouldn't be spinning at all, and the servo should simply be faulting instantly, no?  I don't see how it could just spin slowly, as reported.

Regards,
Ray L.
Title: Re: Brushless DC Servo Spindle Speed Control w/ Smooth Stepper and Leadshine
Post by: Hood on December 07, 2011, 10:16:44 AM
BTW think about it another way, 3000rpm is 50 revs per second

Hood
Title: Re: Brushless DC Servo Spindle Speed Control w/ Smooth Stepper and Leadshine
Post by: Hood on December 07, 2011, 10:18:15 AM
In any case, if that were the problem here, the motor shouldn't be spinning at all, and the servo should simply be faulting instantly, no?  I don't see how it could just spin slowly, as reported.

Regards,
Ray L.

That is why I also suggested looking at the frequency is SS config.
Hood
Title: Re: Brushless DC Servo Spindle Speed Control w/ Smooth Stepper and Leadshine
Post by: CheddarChunk on December 07, 2011, 10:27:18 AM
Thanks a lot for the feedback guys.

Swapping the step and direction wires or signals gives no motion.

I definitely the frequency to 256k in the SS config...this high frequency capability is the only reason i bought a SS.

The acceleration doesn't seem to effect the motor right now as i'm just running it on the bench with no inertial mass or load...but i've tried a range of values.

One other thing is that I'm sending these signals through Port 1 and into a Gecko 540 and passing the step and direction signals through the two OUTPUT channels. I believe these channels simply take a pin from the DB25 and pass through the 540. You wouldn't suspect that this is getting messed up passing through the 540 would you?
Title: Re: Brushless DC Servo Spindle Speed Control w/ Smooth Stepper and Leadshine
Post by: Hood on December 07, 2011, 10:31:18 AM
Not familiar with the G540 but is that passing through optos? If so maybe they are slow and cant pass the frequency you require?

Do you have enough voltage to the motors drive to achieve the full RPM?


Hood
Title: Re: Brushless DC Servo Spindle Speed Control w/ Smooth Stepper and Leadshine
Post by: stirling on December 07, 2011, 11:33:55 AM
For a rotary axis, isn't acceleration in RPM/sec^2?  If so, 500 is not very high.
Revs per minute per sec per sec? That would be a 3rd order derivative, which would be jerk but with mixed time units - curious.

Hmmmm....  I wonder what the units are then?
Well whatever it is it has to be in terms of angular-displacement/sec^2 so revs/sec^2 or radians/sec^2 or degrees/sec^2 perhaps.

Ian
Title: Re: Brushless DC Servo Spindle Speed Control w/ Smooth Stepper and Leadshine
Post by: Hood on December 07, 2011, 11:39:18 AM
I would say it is units/sec/sec just like an axis.
As one unit of the spindle is a rev then it follows its revs/sec/sec

Hood
Title: Re: Brushless DC Servo Spindle Speed Control w/ Smooth Stepper and Leadshine
Post by: HimyKabibble on December 07, 2011, 11:43:10 AM
For a rotary axis, isn't acceleration in RPM/sec^2?  If so, 500 is not very high.
Revs per minute per sec per sec? That would be a 3rd order derivative, which would be jerk but with mixed time units - curious.

Hmmmm....  I wonder what the units are then?
Well whatever it is it has to be in terms of angular-displacement/sec^2 so revs/sec^2 or radians/sec^2 or degrees/sec^2 perhaps.

Ian


Yes, you're correct - Units would be revs/sec^2 or RPM/sec (which would be odd....).

Regards,
Ray L.
Title: Re: Brushless DC Servo Spindle Speed Control w/ Smooth Stepper and Leadshine
Post by: CheddarChunk on December 07, 2011, 12:39:23 PM
my lathe has a servo on the spindle

Hey Hood,

What kind of Servo Motor/Driver are you using and how are you driving it with Mach? I'm considering returning the Leadshine motor and controller and working with something that someone else has had success with.

-Kyle-
Title: Re: Brushless DC Servo Spindle Speed Control w/ Smooth Stepper and Leadshine
Post by: Hood on December 07, 2011, 01:25:00 PM
I use Allen Bradley drives and motors, 12.5Kw MPL-B motor on the lathe, 8kw MPL-B on the Beaver mill and 3kw F motor on the Bridgeport.
I have picked these up from eBay and you wouldnt want to buy new although quite a few of them were actually new. The price of the motor and drive that I have on the lathe would retail about £6000, I got them a lot cheaper, just over £400.

Now there is no reason that your motor and drive will not work and I suspect it may be due to you using the standard outputs on the G540 as I suspect they will be relatively low frequency outputs. I have not looked to see if there is any info on Geckos site about their max frequency though, so its just a guess.

Hood
Title: Re: Brushless DC Servo Spindle Speed Control w/ Smooth Stepper and Leadshine
Post by: CheddarChunk on December 07, 2011, 01:34:37 PM
Thanks Hood,

I'm going to try and push the step and direction signals through the Port 2 on the SS and bypass the G540 all together. I've just gotta round up the right connectors and I'm good to go. There is a 5V out somewhere on the SS right that I can run to the driver to make it active Low? Right now i'm running that signal off the G540 Power supply with a resister.

-Kyle-
Title: Re: Brushless DC Servo Spindle Speed Control w/ Smooth Stepper and Leadshine
Post by: Hood on December 07, 2011, 01:40:28 PM
If I recall there is a jumper on the SS that makes pin 26 supply 5v, how much current can be drawn I am not sure and I think it will also depend on whether you are using an external 5v supply to the SS or USB power.
Hood
Title: Re: Brushless DC Servo Spindle Speed Control w/ Smooth Stepper and Leadshine
Post by: CheddarChunk on December 07, 2011, 05:23:49 PM
"Now there is no reason that your motor and drive will not work and I suspect it may be due to you using the standard outputs on the G540 as I suspect they will be relatively low frequency outputs. I have not looked to see if there is any info on Geckos site about their max frequency though, so its just a guess.

Hood"

You were right! I pulled the step and direction signals out of the G540 and ran them through the Port 2 on the SS using the 5V pin they provide...works as expected in both linear axis mode and Spindle Mode. Thanks man,

Thanks to everyone for their input...I've been pulling my hair out for weeks and you guys helped me get this going. I appreciate it.

-Kyle-
Title: Re: Brushless DC Servo Spindle Speed Control w/ Smooth Stepper and Leadshine
Post by: Hood on December 07, 2011, 06:34:38 PM
Good to hear you got it going, I am sure you will love the control a servo gives :)
Hood
Title: Re: Brushless DC Servo Spindle Speed Control w/ Smooth Stepper and Leadshine
Post by: CheddarChunk on December 07, 2011, 07:15:26 PM
The servos are nice. I wish I had built the whole router with them over the stepers.
Title: Re: Brushless DC Servo Spindle Speed Control w/ Smooth Stepper and Leadshine
Post by: Hood on December 08, 2011, 03:06:17 AM
Yes, steppers have there place but if you want fast acceleration and constant torque then servos are the way to go. As with steppers however they also need to be sized properly.
Hood
Title: Re: Brushless DC Servo Spindle Speed Control w/ Smooth Stepper and Leadshine
Post by: CheddarChunk on December 08, 2011, 12:25:43 PM
FYI:

I contacted Gecko Support with regards to the G540 and the OUTPUT channels 1 and 2 and the frequency limitations/opto-isolation. They are indeed frequency limited via low speed Opto-Isolation:

"Those outputs use a low-speed optoisolator to isolate the signal. The maximum step pulse frequency that could be expected out of them is going to be below 10kHz. Sending a higher frequency will have them function as low-pass filters"

-Kyle-
Title: Re: Brushless DC Servo Spindle Speed Control w/ Smooth Stepper and Leadshine
Post by: Hood on December 08, 2011, 01:45:27 PM
Thought that would likely be the case as they are not meant for step/dir but rather just normal outs such as you would use for coolant etc, so no real need to add expense with faster optos.
Hood