Re: [Emc-users] Maybe a minimally printed harmonic drive? -> tuning manually -> agree with mathematics

2021-05-03 Thread Nicklas SB Karlsson



Den 2021-05-04 kl. 01:22, skrev Jon Elson:

On 05/03/2021 12:03 PM, Nicklas SB Karlsson wrote:

Den 2021-05-03 kl. 17:42, skrev Jon Elson:

Assuming machine is lubricated there shear force in oil/grease depend 
on speed so it might actually be rather close to viscous friction and 
hence rather close to linear. Then an oil/grease pump is used for 
lubrication there will be a thin oil film even at slow speed and 
standstill otherwise stick-slip effect might happen.


In doubt FF2 make any big difference anyway unless you are able to 
hit accurate with FF1.



There are many "frictions" in the system.  Shafts and bearings, 
possibly belts and pulleys, leadscrews and of course the linear slide 
itself.  I'm lumping them all together.


My current tuning scheme is set P low enough so the machine moves, but 
with lots of following error.  Set I and D to zero, and FF0 also, or 
possibly a little D if required.  Then, adjust FF1 very carefully, 
until the error on various velocity jogs is nearly zero. Some systems 
have a nonlinearity in the amps, so you have to compromise for minimal 
following error at a median speed.  Others are quite linear, and one 
FF1 value gives very small error over a wide range of speed.

Agree with my mathematics.
Then, add just a TINY bit of FF2 to reduce the accel/decel spikes. 
Then, find the highest P that you can without oscillation, add a 
little D and that about does it.


TINY bit of FF2 agree with my mathematics. My mathematics say you need I 
to get accurate following. I found manually tuning usually work rather well.


Mathematical modeling and analysis is more useful for slow systems, 
instability happen also to slow systems, oscillations may take minutes. 
In serial produced product it make sense with more thorough analysis to 
make sure marginals are good.




This tuning scheme works pretty well with analog velocity servos and 
my PWM system, where the motor's back EMF works a lot like velocity 
feedback.


My mathematics say if you feed motor with a voltage in sort of motor's 
back EMF work like a velocity feedback so voltage control speed. My 
mathematics also say FF1 compensate for the motor's back EMF or velocity 
if servo drive have velocity as input signal. So I would say there is 
agreement also here in sort of.



Nicklas Karlsson



Jon


___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users



___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Maybe a minimally printed harmonic drive?

2021-05-03 Thread Jon Elson

On 05/03/2021 07:35 PM, Gene Heskett wrote:


Thanks Jon, I hadn't thought of it in that exact manner, and it makes
perfect sense.  So I'll likely give it a shot in the next few days.

Does there seem to be a golden ratio that works well consistently?


Some people seem to have a feel for the math involved and 
can come up with approximations.

I do it by feel and sound, with a lot of Halscope traces.

Jon


___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Maybe a minimally printed harmonic drive?

2021-05-03 Thread Gene Heskett
On Monday 03 May 2021 19:25:48 Jon Elson wrote:

> On 05/03/2021 02:34 PM, Gene Heskett wrote:
> > Friction will of coarse vary, but assume the amplitude of
> > the jitter is constantly reset to zero by a passing edge
> > from the encoder, but it times out in 2 millisecs. Leaving
> > the pwmgen outputing a very low duration pulse in one
> > direction or the other because the combo of friction and a
> > d term combines to coast it to a friction stop, some 30
> > arc-seconds from where the gcode sent it. Now, because the
> > jitter control has timed out, a counter watching each
> > direction pulse is free to increment its count. That
> > counter is added to the control signal in the direction to
> > reduce the error. And its incremented by the pulse from
> > that pwgmen's dir+ or dir- output. And in a few
> > milliseconds the motor will move enough to output an
> > encoder edge. That resets the counters, and the motor will
> > not have enough to keep moving. But the pwmgen isn't
> > satisfied yet so it keeps on outputting a 1% duty pulse on
> > one or the other of its dir signals, Wash, rinse repeat,
> > the motor is constantly being tickled enough by a 1 count
> > move in the wanted direction until the pwmgen sees a match
> > and stops tickling the motor.
>
> Well, this is sort of what the I and D are supposed to
> accomplish. I creeps up the command to make it move toward
> the null point, but D backs it off as soon as it moves past
> an encoder edge.
>
Thanks Jon, I hadn't thought of it in that exact manner, and it makes 
perfect sense.  So I'll likely give it a shot in the next few days.

Does there seem to be a golden ratio that works well consistently?

Take care and stay well.

> Jon

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page 


___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Maybe a minimally printed harmonic drive?

2021-05-03 Thread Jon Elson

On 05/03/2021 02:34 PM, Gene Heskett wrote:
Friction will of coarse vary, but assume the amplitude of 
the jitter is constantly reset to zero by a passing edge 
from the encoder, but it times out in 2 millisecs. Leaving 
the pwmgen outputing a very low duration pulse in one 
direction or the other because the combo of friction and a 
d term combines to coast it to a friction stop, some 30 
arc-seconds from where the gcode sent it. Now, because the 
jitter control has timed out, a counter watching each 
direction pulse is free to increment its count. That 
counter is added to the control signal in the direction to 
reduce the error. And its incremented by the pulse from 
that pwgmen's dir+ or dir- output. And in a few 
milliseconds the motor will move enough to output an 
encoder edge. That resets the counters, and the motor will 
not have enough to keep moving. But the pwmgen isn't 
satisfied yet so it keeps on outputting a 1% duty pulse on 
one or the other of its dir signals, Wash, rinse repeat, 
the motor is constantly being tickled enough by a 1 count 
move in the wanted direction until the pwmgen sees a match 
and stops tickling the motor.


Well, this is sort of what the I and D are supposed to 
accomplish. I creeps up the command to make it move toward 
the null point, but D backs it off as soon as it moves past 
an encoder edge.


Jon


___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Maybe a minimally printed harmonic drive?

2021-05-03 Thread Jon Elson

On 05/03/2021 12:03 PM, Nicklas SB Karlsson wrote:

Den 2021-05-03 kl. 17:42, skrev Jon Elson:

Assuming machine is lubricated there shear force in 
oil/grease depend on speed so it might actually be rather 
close to viscous friction and hence rather close to 
linear. Then an oil/grease pump is used for lubrication 
there will be a thin oil film even at slow speed and 
standstill otherwise stick-slip effect might happen.


In doubt FF2 make any big difference anyway unless you are 
able to hit accurate with FF1.



There are many "frictions" in the system.  Shafts and 
bearings, possibly belts and pulleys, leadscrews and of 
course the linear slide itself.  I'm lumping them all together.


My current tuning scheme is set P low enough so the machine 
moves, but with lots of following error.  Set I and D to 
zero, and FF0 also, or possibly a little D if required.  
Then, adjust FF1 very carefully, until the error on various 
velocity jogs is nearly zero. Some systems have a 
nonlinearity in the amps, so you have to compromise for 
minimal following error at a median speed.  Others are quite 
linear, and one FF1 value gives very small error over a wide 
range of speed.
Then, add just a TINY bit of FF2 to reduce the accel/decel 
spikes. Then, find the highest P that you can without 
oscillation, add a little D and that about does it.


This tuning scheme works pretty well with analog velocity 
servos and my PWM system, where the motor's back EMF works a 
lot like velocity feedback.


Jon


___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Maybe a minimally printed harmonic drive?

2021-05-03 Thread Gene Heskett
On Monday 03 May 2021 11:42:54 Jon Elson wrote:

> On 05/03/2021 02:57 AM, Gene Heskett wrote:
> > More specifically, which of the F's is suitable for forcing a closer
> > to null settling point when there is considerable friction in the
> > system?
>
> That's the problem!  Friction is nonlinear, and it hurts
> during acceleration but HELPS during deceleration.  So, a
> single FF2 setting can never be optimal.  You have to use a
> compromise value.
>
Or, my middle of the night idea about some jitter in the control signal. 
Derived by something like this outline.

Friction will of coarse vary, but assume the amplitude of the jitter is 
constantly reset to zero by a passing edge from the encoder, but it 
times out in 2 millisecs. Leaving the pwmgen outputing a very low 
duration pulse in one direction or the other because the combo of 
friction and a d term combines to coast it to a friction stop, some 30 
arc-seconds from where the gcode sent it.  Now, because the jitter 
control has timed out, a counter watching each direction pulse is free 
to increment its count. That counter is added to the control signal in 
the direction to reduce the error. And its incremented by the pulse from 
that pwgmen's dir+ or dir- output. And in a few milliseconds the motor 
will move enough to output an encoder edge. That resets the counters, 
and the motor will not have enough to keep moving.

But the pwmgen isn't satisfied yet so it keeps on outputting a 1% duty 
pulse on one or the other of its dir signals, Wash, rinse repeat, the 
motor is constantly being tickled enough by a 1 count move in the wanted 
direction until the pwmgen sees a match and stops tickling the motor.

> > Something that will see it sitting at 3% power constantly, and will
> > raise the gain enough to move it another arc-second for a more
> > perfect null.
>
> The FF's will never be of value there.

Debateable, FF1 is someplace in the 20's to get a cruising error null.

> This is what the I 
> term is SUPPOSED to help with, but I
> have not found it to really accomplish much.

I use it, but determining the value is a puzzle,
Here is whats working fairly accurate, and stable for that BS-1 clone.

#
# Axis A
#
[AXIS_A]
MAX_VELOCITY= 30.000
MAX_ACCELERATION= 1500.00

[JOINT_3]
TYPE= ANGULAR
HOME= 0.0
HOME_SEQUENCE   = 3
HOME_SEARCH_VEL = 9.0
HOME_LATCH_VEL  = -1.0
HOME_FINAL_VEL  = 30
HOME_OFFSET = 4.498500
VOLATILE_HOME   = 1
FERROR  = 0.50
MIN_FERROR  = 0.25
MAX_VELOCITY= 30.000
MAX_ACCELERATION= 1500.00
P   = 6000
I   = 0.500
D   = 0.500
FF0 = 0
FF1 = 21.5
FF2 = 0.55
BIAS= 0
DEADBAND= 0.00015
BACKLASH= .1
MAX_OUTPUT  = 900.
SERVO_SCALE = 666.7
PWMGEN_TYPE = 2

Thr MAX_VELOCITY is restricted to keep it from overshooting and reversing 
the motor to come back, but at the higher speeds, that controller, a 
dual BTS-7960 tries to reverse it at speed, crowbaring a 450 watt 24 
volt supply, which needs about 3 minutes to cool and recover. I can go 
to at least 25,000 for Pgain before it starts to oscillate but its 
noticeably less stable above 15,000.

> That may have 
> more to do with the servo characteristics of my machines,
> though.

Each system seems to write its own rules.

> Jon

Take care and stay well Jon.

>
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users


Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page 


___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Maybe a minimally printed harmonic drive?

2021-05-03 Thread Nicklas SB Karlsson

Den 2021-05-03 kl. 17:42, skrev Jon Elson:

On 05/03/2021 02:57 AM, Gene Heskett wrote:


More specifically, which of the F's is suitable for forcing a closer to
null settling point when there is considerable friction in the system?
That's the problem!  Friction is nonlinear, and it hurts during 
acceleration but HELPS during deceleration.  So, a single FF2 setting 
can never be optimal.  You have to use a compromise value.


Assuming machine is lubricated there shear force in oil/grease depend on 
speed so it might actually be rather close to viscous friction and hence 
rather close to linear. Then an oil/grease pump is used for lubrication 
there will be a thin oil film even at slow speed and standstill 
otherwise stick-slip effect might happen.


In doubt FF2 make any big difference anyway unless you are able to hit 
accurate with FF1.



Nicklas Karlsson



___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Maybe a minimally printed harmonic drive?

2021-05-03 Thread Jon Elson

On 05/03/2021 02:57 AM, Gene Heskett wrote:


More specifically, which of the F's is suitable for forcing a closer to
null settling point when there is considerable friction in the system?
That's the problem!  Friction is nonlinear, and it hurts 
during acceleration but HELPS during deceleration.  So, a 
single FF2 setting can never be optimal.  You have to use a 
compromise value.
  
Something that will see it sitting at 3% power constantly, and will

raise the gain enough to move it another arc-second for a more perfect
null.
The FF's will never be of value there.  This is what the I 
term is SUPPOSED to help with, but I
have not found it to really accomplish much.  That may have 
more to do with the servo characteristics of my machines, 
though.


Jon


___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] Maybe a minimally printed harmonic drive?

2021-05-03 Thread Gene Heskett
On Sunday 02 May 2021 21:02:29 Gene Heskett wrote:

> On Sunday 02 May 2021 16:34:43 Jon Elson wrote:
> > On 05/02/2021 01:00 PM, Chris Albertson wrote:
> > > The below is exactly true.  The problem is that PID is widely used
> > > and PID is only "reactive" it can only deal with what has already
> > > happened and the time lag is the source of oscillations.In the
> > > past, PID was the only control option because we had limited
> > > computing power.
> >
> > True for classic PID.  The PID calculation in LinuxCNC also
> > has feedforwards (FF0 - FF2) which
> > are quite useful, as they give an approximation of the
> > required drive to the motor without the output, move, sample
> > delay.
>
> Yes, and that I have found usefull.  But using them intelligently
> isn't at all well explained by the docs we have. Time constants and
> their effects are are not at all well explained. The bottom line is
> that if and when you hit the magic settings, you still have no idea
> why this works and that doesn't.
>
More specifically, which of the F's is suitable for forcing a closer to 
null settling point when there is considerable friction in the system? 
Something that will see it sitting at 3% power constantly, and will 
raise the gain enough to move it another arc-second for a more perfect 
null. Best applied where a pwmgen is operating in mode 2 to drive an H 
bridge. I've considered adding a high frequency jitter to the control so 
that friction might be overcome, but that needs to be controlable, 
something that as long as the error exists, will raise the amplitude of 
the jitter until it does move. Something that looks at the encoder to 
detect movement that should reset the accumulated jitter amplitude to 
start a new cycle when the encoder says it has moved for instance.

See what happens when I let my imagination out to play at 4 am without a 
chaperone?

> > Jon
> >
> >
> > ___
> > Emc-users mailing list
> > Emc-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/emc-users
>
> Cheers, Gene Heskett


Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page 


___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users