Re: [Emc-users] Advice on Servo Tuning

2010-03-04 Thread Flying Electron Inc
On Wed, Mar 3, 2010 at 10:17 AM, Jon Elson  wrote:

> Chris Morley wrote:
> >>>
> >> The servo drives are from Advanced Motion Controls. They are Direct PWM
> >> Brushless DC Servo Drives Model# BD30A8. The datasheet can be read at
> >> http://www.a-m-c.com/download/datasheet/bd30a8.pdf . I talked to their
> tech
> >> support and there is no current loop or velocity loop in the drive. They
> >> told me the PWM signal directly controls the amount of time the MOSFETs
> are
> >> turned on. If it was a brushed DC motor, I understand that the PWM duty
> >> cycle would have a linear relationship to the average voltage and hence
> >> average speed of the motor, but since it's a brushless DC motor, I don't
> >> understand if that same relationship holds or not.
> >>
> >
> >
> > AMC has instructions on their web site (little hard to find the right
> one)
> >
> > on how to tune the servo drive itself.
> >
> > Are you sure the drive is set right for velocity mode?
> >
> If you look up the pdf he links to above, it is clear this is NOT
> inherently a servo amplifier, it is
> just a PWM amplifier, with no internal loop other than the current
> limit.  There is no tach input,
> no encoder input, other than PWM from the controller.  Therefore, other
> than setting the current limit,
> there is no tuning that can be done.  I make a very similar servo amp,
> and maybe I shouldn't call it a servo amp, as it has no inherent loop,
> either.
>
> The OP's last question, yes, there is still an approximate linear
> relation between PWM duty cycle and speed.
> The motor's resistance throws it off a little, speed will drop slightly
> under load.  Tuning of such drive systems is a bit different than on
> velocity servo systems, and the inherent stability is less.  You don't
> want to turn up gain until you have "wiggles", you want to tune first
> for stability, then use FF1 and FF2 to reduce following error.  See my
> page on servo tuning for these types of servos at :
> http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?PWM_Servo_Amplifiers
>
>
> Jon
>
>
Thanks for the link to your servo tuning page, I will play with the PID
settings to see if I can tune for stability first and then add in the FF1
and FF2 as you suggest.

Lawrence
--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Advice on Servo Tuning

2010-03-03 Thread Jon Elson
Chris Morley wrote:
>>>   
>> The servo drives are from Advanced Motion Controls. They are Direct PWM
>> Brushless DC Servo Drives Model# BD30A8. The datasheet can be read at
>> http://www.a-m-c.com/download/datasheet/bd30a8.pdf . I talked to their tech
>> support and there is no current loop or velocity loop in the drive. They
>> told me the PWM signal directly controls the amount of time the MOSFETs are
>> turned on. If it was a brushed DC motor, I understand that the PWM duty
>> cycle would have a linear relationship to the average voltage and hence
>> average speed of the motor, but since it's a brushless DC motor, I don't
>> understand if that same relationship holds or not.
>> 
>
>
> AMC has instructions on their web site (little hard to find the right one)
>
> on how to tune the servo drive itself.
>
> Are you sure the drive is set right for velocity mode?
>   
If you look up the pdf he links to above, it is clear this is NOT 
inherently a servo amplifier, it is
just a PWM amplifier, with no internal loop other than the current 
limit.  There is no tach input,
no encoder input, other than PWM from the controller.  Therefore, other 
than setting the current limit,
there is no tuning that can be done.  I make a very similar servo amp, 
and maybe I shouldn't call it a servo amp, as it has no inherent loop, 
either.

The OP's last question, yes, there is still an approximate linear 
relation between PWM duty cycle and speed.
The motor's resistance throws it off a little, speed will drop slightly 
under load.  Tuning of such drive systems is a bit different than on 
velocity servo systems, and the inherent stability is less.  You don't 
want to turn up gain until you have "wiggles", you want to tune first 
for stability, then use FF1 and FF2 to reduce following error.  See my 
page on servo tuning for these types of servos at :
http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?PWM_Servo_Amplifiers


Jon

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Advice on Servo Tuning

2010-03-03 Thread Flying Electron Inc
On Wed, Mar 3, 2010 at 2:01 AM, Chris Morley wrote:

>
> > > Judging from the traces, I suspect you have velocity mode servo amps,
> > > and I suspect their velocity loops aren't tuned. It doesn't make
> > > sense to tune EMC's position loop when the drive velocity loop isn't
> > > right - the position loop builds on the foundation provided by the
> > > drive.
> > >
> > > If you can tell us about your drives (and ideally post a link to a
> > > copy of the drive manual and/or specs), we can probably help more.
> > >
> >
> > The servo drives are from Advanced Motion Controls. They are Direct PWM
> > Brushless DC Servo Drives Model# BD30A8. The datasheet can be read at
> > http://www.a-m-c.com/download/datasheet/bd30a8.pdf . I talked to their
> tech
> > support and there is no current loop or velocity loop in the drive. They
> > told me the PWM signal directly controls the amount of time the MOSFETs
> are
> > turned on. If it was a brushed DC motor, I understand that the PWM duty
> > cycle would have a linear relationship to the average voltage and hence
> > average speed of the motor, but since it's a brushless DC motor, I don't
> > understand if that same relationship holds or not.
> >
>
>
> AMC has instructions on their web site (little hard to find the right one)
>
> on how to tune the servo drive itself.
>
> Are you sure the drive is set right for velocity mode?
>
> From my understanding the drives don't have a velocity mode or a current
mode.  The PWM signal directly turns the MOSFETS on and off.

I've set up the servo PID loop with a Pgain of 2, some FF1 and FF2 and it's
gotten good enough to position the machine where it needs to be.  I was way
off with the Pgain of 8 that I started with.

Thanks everyone for all your help!

Lawrence
--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Advice on Servo Tuning

2010-03-03 Thread Chris Morley

> > Judging from the traces, I suspect you have velocity mode servo amps,
> > and I suspect their velocity loops aren't tuned. It doesn't make
> > sense to tune EMC's position loop when the drive velocity loop isn't
> > right - the position loop builds on the foundation provided by the
> > drive.
> >
> > If you can tell us about your drives (and ideally post a link to a
> > copy of the drive manual and/or specs), we can probably help more.
> >
> 
> The servo drives are from Advanced Motion Controls. They are Direct PWM
> Brushless DC Servo Drives Model# BD30A8. The datasheet can be read at
> http://www.a-m-c.com/download/datasheet/bd30a8.pdf . I talked to their tech
> support and there is no current loop or velocity loop in the drive. They
> told me the PWM signal directly controls the amount of time the MOSFETs are
> turned on. If it was a brushed DC motor, I understand that the PWM duty
> cycle would have a linear relationship to the average voltage and hence
> average speed of the motor, but since it's a brushless DC motor, I don't
> understand if that same relationship holds or not.
> 


AMC has instructions on their web site (little hard to find the right one)

on how to tune the servo drive itself.

Are you sure the drive is set right for velocity mode?

 

 
  
_
Live connected with Messenger on your phone
http://go.microsoft.com/?linkid=9712958
--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Advice on Servo Tuning

2010-03-02 Thread Flying Electron Inc
On Tue, Mar 2, 2010 at 6:40 AM, John Kasunich wrote:

>
>
> On Mon, 01 Mar 2010 19:10 -0800, "Flying Electron Inc"
>  wrote:
> > Hi all,
> >
> > Hoping some people that have tuned their servos with EMC2 might
> > be able to share some of their insights that they learned during
> > their tuning with me.
> >  I built a pick and place machine with a servo on the X axis and I
> >  started
> > running tests to tune the PID loop for the servo.  Right now, I have
> > everything set to zero, a deadband set to 0.1 and I am adjusting
> > the Pgain to find the optimal Pgain before I start varying the other
> > parameters.
>
> 0.1 inches seems like a very small value for deadband.  What is
> your encoder scaling (counts per inch)?  Normally, the deadband should
> be set to about 1 or 2 counts.  Do you really have 100,000 counts per
> inch?
>

Thanks for the help!  I had no idea how to set the deadband so I just made
up a number.  Deadband being 1 or 2 counts of the encoder makes perfect
sense to me now that you point it out.  The machine has 20807.68 counts per
inch (10cm/turn ballscrews with 8192 counts per rev encoders).  I'll try
setting the deadband to 2 counts, which should be 0.48 inch.


>
> > The test I am using is to start from a standstill at X=0, move to
> > X = 8 inches with an acceleration of 25in/sec^2 and a maximum
> > velocity of 9in/sec, come to a full stop and wait for 0.5 seconds,
> > then reverse back to X=0 with the same acceleration profile.
>
> That seems like a reasonable profile to tune with.
>
> > I tried different Pgain values of 4, 8, 10, 12, 13, and 14 to see
> > what the error looked like.  at Pgain of 16 the machine began
> > oscillating badly.  I've attached a link to an image of the
> > screenshots i took from hal scope for the different Pgains that I
> > tried.  To my inexperienced eye, it looks like Pgain 12 is the best,
> > but I'm not sure if the error graphs are even supposed to look like
> > this.
> >
> > http://i.imgur.com/hefCf.png
> >
> > If anyone can tell me if these error graphs look normal or not, I'd
> > appreciate it!
> >
>
> No, they don't look normal.  There is way too much wiggling going
> on there, even at the lowest Pgain setting.
>
> Those Pgain numbers seem very small to me, but that might be because
> of the way you have things scaled.  I recommend that you always scale
> things such that you can understand the traces on halscope in physical
> units.
>
> Looking at your traces, motion.current-vel is in inches per second.
> The trace clearly ramps up to 9 inches/sec, just like you commanded.
> It is easy to understand what that trace means.
>
> All position signals are normally in machine units - inches in your
> case.  So the pid.2.error trace shows a maximum error of about 0.035"
> in the Pgain = 12 trace.  Probably not what you want, although maybe
> OK for a pick-n-place machine, since you really only need to be
> accurate at the endpoint of the move.
>

I agree with your thinking, error during the move will probably not be a
problem for the machine, just trying to nail the final position at the end
of the move.


>
> What is not clear from your traces is the scaling of the pid output.
> The pid.2.output trace is scaled at 0.2 "units" per div, and at the
> fastest part of the move, when the axis is moving 9 inches/sec, the
> pid output is at 2 divisions, or 0.4 units.  That means a "unit" on
> of pid output would make the axis move at roughly 22 inches per
> second.
>

The servo drives are driven by a PWM signal and a direction signal.  The
pid.2.output is scaled from 0.0 to 1.0 corresponding to 0% duty cycle and
100% duty cycle.  The servo amps are brushless dc servo amps (more about
them below).  I'm hoping there is some linear relationship between the pwm
output and either torque, velocity, or position, but I'm not sure since
there are no current or velocity loops inside the amps themselves.


>
> I don't know what kind of drives you have, and it makes a difference
> in how you tune.  If you sending pid.2.output to a PWM generator and
> directly driving an H-bridge, then the average motor voltage will be
> proportional to the duty cycle, and motor speed will roughly track
> the voltage, with some droop under load.  If you are sending the
> output through an analog output to a torque-mode drive, then motor
> current, torque, and acceleration will be proportional to the
> output value.  (That doesn't seem to be the case here.)  Finally, if
> you are sending the output through an analog output to a velocity
> mode drive, the motor speed will fairly accurately track the output,
> but only if the velocity loop inside the drive (NOT in EMC) is tuned.
>
> Judging from the traces, I suspect you have velocity mode servo amps,
> and I suspect their velocity loops aren't tuned.  It doesn't make
> sense to tune EMC's position loop when the drive velocity loop isn't
> right - the position loop builds on the foundation provided by the
> drive.
>
> If you can 

Re: [Emc-users] Advice on Servo Tuning

2010-03-02 Thread Flying Electron Inc
On Tue, Mar 2, 2010 at 6:24 AM, Dave  wrote:

> At first glance I would say that you are getting too aggressive with the
> gain.   Back Pgain off to 8 and dial in some D to kill the oscillations.
>

Dave
>

Thanks for the advice.  I did some more experiments with a Pgain of 1 to 7.
 I'll add in the Dgain after I figure out what the proper Pgain should be.
 I attached a link to the image of the halscope traces.  I had to change the
error scale to make the error traces fit on the screen.  The old traces from
the previous message had an error scale of 10m/div, these new traces have an
error scale of 100m/div so 10x more error scale.  I also redid a Pgain of 8
with the new scale to give a sense of scale compared to the older set of
halscope traces.

http://i.imgur.com/G4NXl.png

I'm not quite sure how to interpret what is happening though.  It looks like
the lower the Pgain, like at Pgain = 1, the larger the error, but the
smoother the error and smoother the ouput of the pid loop.  The higher the
Pgain the less error appears, but the error and output of the pid bounce
around a lot and get real fuzzy from small oscillations.

For setting an initial P is it generally better to have the larger but
smoother error values and dial it in using the other PID adjustments, or is
it generally better to have the smaller error but rougher error and output
lines?



>
> On 3/1/2010 10:10 PM, Flying Electron Inc wrote:
> > Hi all,
> >
> > Hoping some people that have tuned their servos with EMC2 might be able
> to
> > share some of their insights that they learned during their tuning with
> me.
> >   I built a pick and place machine with a servo on the X axis and I
> started
> > running tests to tune the PID loop for the servo.  Right now, I have
> > everything set to zero, a deadband set to 0.1 and I am adjusting the
> > Pgain to find the optimal Pgain before I start varying the other
> parameters.
> >
> > The test I am using is to start from a standstill at X=0, move to X = 8
> > inches with an acceleration of 25in/sec^2 and a maximum velocity of
> 9in/sec,
> > come to a full stop and wait for 0.5 seconds, then reverse back to X=0
> with
> > the same acceleration profile.
> >
> > I tried different Pgain values of 4, 8, 10, 12, 13, and 14 to see what
> the
> > error looked like.  at Pgain of 16 the machine began oscillating badly.
> >   I've attached a link to an image of the screenshots i took from hal
> scope
> > for the different Pgains that I tried.  To my inexperienced eye, it looks
> > like Pgain 12 is the best, but I'm not sure if the error graphs are even
> > supposed to look like this.
> >
> > http://i.imgur.com/hefCf.png
> >
> > If anyone can tell me if these error graphs look normal or not, I'd
> > appreciate it!
> >
> > Thanks
> >
> > Lawrence
>
>
--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Advice on Servo Tuning

2010-03-02 Thread John Kasunich


On Mon, 01 Mar 2010 19:10 -0800, "Flying Electron Inc"
 wrote:
> Hi all,
> 
> Hoping some people that have tuned their servos with EMC2 might
> be able to share some of their insights that they learned during
> their tuning with me.
>  I built a pick and place machine with a servo on the X axis and I
>  started
> running tests to tune the PID loop for the servo.  Right now, I have
> everything set to zero, a deadband set to 0.1 and I am adjusting
> the Pgain to find the optimal Pgain before I start varying the other
> parameters.

0.1 inches seems like a very small value for deadband.  What is
your encoder scaling (counts per inch)?  Normally, the deadband should
be set to about 1 or 2 counts.  Do you really have 100,000 counts per
inch?

> The test I am using is to start from a standstill at X=0, move to
> X = 8 inches with an acceleration of 25in/sec^2 and a maximum
> velocity of 9in/sec, come to a full stop and wait for 0.5 seconds,
> then reverse back to X=0 with the same acceleration profile.

That seems like a reasonable profile to tune with.

> I tried different Pgain values of 4, 8, 10, 12, 13, and 14 to see
> what the error looked like.  at Pgain of 16 the machine began
> oscillating badly.  I've attached a link to an image of the
> screenshots i took from hal scope for the different Pgains that I
> tried.  To my inexperienced eye, it looks like Pgain 12 is the best,
> but I'm not sure if the error graphs are even supposed to look like
> this.
> 
> http://i.imgur.com/hefCf.png
> 
> If anyone can tell me if these error graphs look normal or not, I'd
> appreciate it!
> 

No, they don't look normal.  There is way too much wiggling going
on there, even at the lowest Pgain setting.

Those Pgain numbers seem very small to me, but that might be because
of the way you have things scaled.  I recommend that you always scale
things such that you can understand the traces on halscope in physical
units.

Looking at your traces, motion.current-vel is in inches per second.
The trace clearly ramps up to 9 inches/sec, just like you commanded.
It is easy to understand what that trace means.

All position signals are normally in machine units - inches in your
case.  So the pid.2.error trace shows a maximum error of about 0.035"
in the Pgain = 12 trace.  Probably not what you want, although maybe
OK for a pick-n-place machine, since you really only need to be
accurate at the endpoint of the move.

What is not clear from your traces is the scaling of the pid output.
The pid.2.output trace is scaled at 0.2 "units" per div, and at the
fastest part of the move, when the axis is moving 9 inches/sec, the
pid output is at 2 divisions, or 0.4 units.  That means a "unit" on
of pid output would make the axis move at roughly 22 inches per
second.

I don't know what kind of drives you have, and it makes a difference
in how you tune.  If you sending pid.2.output to a PWM generator and
directly driving an H-bridge, then the average motor voltage will be
proportional to the duty cycle, and motor speed will roughly track
the voltage, with some droop under load.  If you are sending the
output through an analog output to a torque-mode drive, then motor
current, torque, and acceleration will be proportional to the
output value.  (That doesn't seem to be the case here.)  Finally, if
you are sending the output through an analog output to a velocity
mode drive, the motor speed will fairly accurately track the output,
but only if the velocity loop inside the drive (NOT in EMC) is tuned.

Judging from the traces, I suspect you have velocity mode servo amps,
and I suspect their velocity loops aren't tuned.  It doesn't make
sense to tune EMC's position loop when the drive velocity loop isn't
right - the position loop builds on the foundation provided by the
drive.

If you can tell us about your drives (and ideally post a link to a
copy of the drive manual and/or specs), we can probably help more.

Regards,

John Kasunich





 



-- 
  John Kasunich
  jmkasun...@fastmail.fm


--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Advice on Servo Tuning

2010-03-02 Thread Dave
At first glance I would say that you are getting too aggressive with the 
gain.   Back Pgain off to 8 and dial in some D to kill the oscillations.

Dave

On 3/1/2010 10:10 PM, Flying Electron Inc wrote:
> Hi all,
>
> Hoping some people that have tuned their servos with EMC2 might be able to
> share some of their insights that they learned during their tuning with me.
>   I built a pick and place machine with a servo on the X axis and I started
> running tests to tune the PID loop for the servo.  Right now, I have
> everything set to zero, a deadband set to 0.1 and I am adjusting the
> Pgain to find the optimal Pgain before I start varying the other parameters.
>
> The test I am using is to start from a standstill at X=0, move to X = 8
> inches with an acceleration of 25in/sec^2 and a maximum velocity of 9in/sec,
> come to a full stop and wait for 0.5 seconds, then reverse back to X=0 with
> the same acceleration profile.
>
> I tried different Pgain values of 4, 8, 10, 12, 13, and 14 to see what the
> error looked like.  at Pgain of 16 the machine began oscillating badly.
>   I've attached a link to an image of the screenshots i took from hal scope
> for the different Pgains that I tried.  To my inexperienced eye, it looks
> like Pgain 12 is the best, but I'm not sure if the error graphs are even
> supposed to look like this.
>
> http://i.imgur.com/hefCf.png
>
> If anyone can tell me if these error graphs look normal or not, I'd
> appreciate it!
>
> Thanks
>
> Lawrence
> --
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users
>
>


--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


[Emc-users] Advice on Servo Tuning

2010-03-01 Thread Flying Electron Inc
Hi all,

Hoping some people that have tuned their servos with EMC2 might be able to
share some of their insights that they learned during their tuning with me.
 I built a pick and place machine with a servo on the X axis and I started
running tests to tune the PID loop for the servo.  Right now, I have
everything set to zero, a deadband set to 0.1 and I am adjusting the
Pgain to find the optimal Pgain before I start varying the other parameters.

The test I am using is to start from a standstill at X=0, move to X = 8
inches with an acceleration of 25in/sec^2 and a maximum velocity of 9in/sec,
come to a full stop and wait for 0.5 seconds, then reverse back to X=0 with
the same acceleration profile.

I tried different Pgain values of 4, 8, 10, 12, 13, and 14 to see what the
error looked like.  at Pgain of 16 the machine began oscillating badly.
 I've attached a link to an image of the screenshots i took from hal scope
for the different Pgains that I tried.  To my inexperienced eye, it looks
like Pgain 12 is the best, but I'm not sure if the error graphs are even
supposed to look like this.

http://i.imgur.com/hefCf.png

If anyone can tell me if these error graphs look normal or not, I'd
appreciate it!

Thanks

Lawrence
--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users