Dynomotion

Group: DynoMotion Message: 482 From: Bengt Sjoelund Date: 6/27/2010
Subject: +-10V
Hi Tom,
I am trying to get one axis (X) to work but cannot find where to adjust the DAC output to 0, having a runaway axis as soon as I power up the driver. Is the a step by step instruction for setting up Kflop/Kanalog using DC servos.

Is DAC the correct setting in motor setup when I use +-10V?

A bit confused Bengt
Group: DynoMotion Message: 484 From: Tom Kerekes Date: 6/27/2010
Subject: Re: +-10V
Hi Bengt,
 
Yes Output Mode = DAC Servo is correct for Analog +/-10V Kanalog Outputs.
 
Sometimes when the DAC is commanded to 0V, because of offset in the Kanalog inputs and/or your amplifier input, the motor will drift slowly (less than about 1% of full speed).  It shouldn't really "runaway".  This usually isn't a problem because in the normal initialization of the machine the drives are enabled and then immediately the servo is enabled.  The servo will automatically compensate for any offset to hold position.  You might try issuing small dac values from the console (the servo must be disabled) using a command like DAC0=-10 to see if you can get the axis to stop.  If you find the magic offset this may be entered as a Axis Channel OutputOffset value.  In previous versions the only way to set the Output Offset was with a C program via
 
ch0->OutputOffset = -10;
 
But Version 4.21 now has the value on the Configration Screen.
Regards
TK

Group: DynoMotion Message: 493 From: Bengt Sjoelund Date: 7/2/2010
Subject: Re: +-10V
Hi Tom,
4.21 installed and adjusted Output Gain/Offset for X-axis
Gain 0.9 and offset -13 and now the axis is standing still.
Will only play with X-axis until I get the hang of it.

So what do I do now to get some movement of X-axis in KMotionCNC?

Cheers Bengt


--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Bengt,
>
> Yes Output Mode = DAC Servo is correct for Analog +/-10V Kanalog Outputs.
>
> Sometimes when the DAC is commanded to 0V, because of offset in the Kanalog inputs and/or your amplifier input, the motor will drift slowly (less than about 1% of full speed).  It shouldn't really "runaway".  This usually isn't a problem because in the normal initialization of the machine the drives are enabled and then immediately the servo is enabled.  The servo will automatically compensate for any offset to hold position.  You might try issuing small dac values from the console (the servo must be disabled) using a command like DAC0=-10 to see if you can get the axis to stop.  If you find the magic offset this may be entered as a Axis Channel OutputOffset value.  In previous versions the only way to set the Output Offset was with a C program via
>
> ch0->OutputOffset = -10;
>
> But Version 4.21 now has the value on the Configration Screen.
>
> Regards
> TK
>
>
>
> ________________________________
> From: Bengt Sjoelund <cnc@...>
> To: DynoMotion@yahoogroups.com
> Sent: Sun, June 27, 2010 7:42:08 AM
> Subject: [DynoMotion] +-10V
>
>  
> Hi Tom,
> I am trying to get one axis (X) to work but cannot find where to adjust the DAC output to 0, having a runaway axis as soon as I power up the driver. Is the a step by step instruction for setting up Kflop/Kanalog using DC servos.
>
> Is DAC the correct setting in motor setup when I use +-10V?
>
> A bit confused Bengt
>
Group: DynoMotion Message: 495 From: Tom Kerekes Date: 7/2/2010
Subject: Re: +-10V
Hi Bengt,
 
The next step would be to tune your servo and verify proper motion using the Step Response Screen.  Have you done this?
 
I'm not sure why you put in an OutputGain of 0.9?  Probably simpler to leave this at 1.0.
 
TK

Group: DynoMotion Message: 497 From: Bengt Sjoelund Date: 7/2/2010
Subject: Re: +-10V
Hi Tom,
With 1.0 Gain I cannot set the axis to be still it is moving very slowly whatever setting I have on offset. I can get it very close to standstill but it will eventually start moving slowly by itself or if I turn the axis if evere so slowly it starts moving. With 0.9 or even 0.9999999 it holds its position better.
So next step is Step Response Screen, tomorrows task.
Cheers Bengt

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Bengt,
>
> The next step would be to tune your servo and verify proper motion using the
> Step Response Screen.  Have you done this?
>
> I'm not sure why you put in an OutputGain of 0.9?  Probably simpler to leave
> this at 1.0.
>
> TK
>
>
>
>
> ________________________________
> From: Bengt Sjoelund <cnc@...>
> To: DynoMotion@yahoogroups.com
> Sent: Fri, July 2, 2010 11:50:07 AM
> Subject: [DynoMotion] Re: +-10V
>
>  
> Hi Tom,
> 4.21 installed and adjusted Output Gain/Offset for X-axis
> Gain 0.9 and offset -13 and now the axis is standing still.
> Will only play with X-axis until I get the hang of it.
>
> So what do I do now to get some movement of X-axis in KMotionCNC?
>
> Cheers Bengt
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi Bengt,
> >
> > Yes Output Mode = DAC Servo is correct for Analog +/-10V Kanalog Outputs.
> >
> > Sometimes when the DAC is commanded to 0V, because of offset in the Kanalog
> >inputs and/or your amplifier input, the motor will drift slowly (less than about
> >1% of full speed).  It shouldn't really "runaway".  This usually isn't a
> >problem because in the normal initialization of the machine the drives are
> >enabled and then immediately the servo is enabled.  The servo will
> >automatically compensate for any offset to hold position.  You might try
> >issuing small dac values from the console (the servo must be disabled) using a
> >command like DAC0=-10 to see if you can get the axis to stop.  If you find the
> >magic offset this may be entered as a Axis Channel OutputOffset value.  In
> >previous versions the only way to set the Output Offset was with a C program via
> >
> >
> > ch0->OutputOffset = -10;
> >
> > But Version 4.21 now has the value on the Configration Screen.
> >
> > Regards
> > TK
> >
> >
> >
> > ________________________________
> > From: Bengt Sjoelund <cnc@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Sun, June 27, 2010 7:42:08 AM
> > Subject: [DynoMotion] +-10V
> >
> >  
> > Hi Tom,
> > I am trying to get one axis (X) to work but cannot find where to adjust the DAC
> >output to 0, having a runaway axis as soon as I power up the driver. Is the a
> >step by step instruction for setting up Kflop/Kanalog using DC servos.
> >
> >
> > Is DAC the correct setting in motor setup when I use +-10V?
> >
> > A bit confused Bengt
> >
>
Group: DynoMotion Message: 498 From: Bengt Sjoelund Date: 7/2/2010
Subject: Re: +-10V
One more thing, saving settings in Configuration will not save Limit Switch setup, next tim when I want to load channel bits are zero and even Positive is unmarked.

I do my settings, disable axis and download and then I save to file in my case test x.mot so what am I doing wrong or is there a bug?
Cheers Bengt

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Bengt,
>
> The next step would be to tune your servo and verify proper motion using the
> Step Response Screen.  Have you done this?
>
> I'm not sure why you put in an OutputGain of 0.9?  Probably simpler to leave
> this at 1.0.
>
> TK
>
>
>
>
> ________________________________
> From: Bengt Sjoelund <cnc@...>
> To: DynoMotion@yahoogroups.com
> Sent: Fri, July 2, 2010 11:50:07 AM
> Subject: [DynoMotion] Re: +-10V
>
>  
> Hi Tom,
> 4.21 installed and adjusted Output Gain/Offset for X-axis
> Gain 0.9 and offset -13 and now the axis is standing still.
> Will only play with X-axis until I get the hang of it.
>
> So what do I do now to get some movement of X-axis in KMotionCNC?
>
> Cheers Bengt
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi Bengt,
> >
> > Yes Output Mode = DAC Servo is correct for Analog +/-10V Kanalog Outputs.
> >
> > Sometimes when the DAC is commanded to 0V, because of offset in the Kanalog
> >inputs and/or your amplifier input, the motor will drift slowly (less than about
> >1% of full speed).  It shouldn't really "runaway".  This usually isn't a
> >problem because in the normal initialization of the machine the drives are
> >enabled and then immediately the servo is enabled.  The servo will
> >automatically compensate for any offset to hold position.  You might try
> >issuing small dac values from the console (the servo must be disabled) using a
> >command like DAC0=-10 to see if you can get the axis to stop.  If you find the
> >magic offset this may be entered as a Axis Channel OutputOffset value.  In
> >previous versions the only way to set the Output Offset was with a C program via
> >
> >
> > ch0->OutputOffset = -10;
> >
> > But Version 4.21 now has the value on the Configration Screen.
> >
> > Regards
> > TK
> >
> >
> >
> > ________________________________
> > From: Bengt Sjoelund <cnc@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Sun, June 27, 2010 7:42:08 AM
> > Subject: [DynoMotion] +-10V
> >
> >  
> > Hi Tom,
> > I am trying to get one axis (X) to work but cannot find where to adjust the DAC
> >output to 0, having a runaway axis as soon as I power up the driver. Is the a
> >step by step instruction for setting up Kflop/Kanalog using DC servos.
> >
> >
> > Is DAC the correct setting in motor setup when I use +-10V?
> >
> > A bit confused Bengt
> >
>
Group: DynoMotion Message: 502 From: Bengt Sjoelund Date: 7/3/2010
Subject: Re: +-10V
Hi Tom,
Gain now fixed 1.0 and offset -15.
Step response screen, P=0.15 (0.1 = now movement) I=0 D=0

A Move will hold position for a short time, perform a motion of the specified amount from the current location, pause for a short time, and then a second motion back to the original location.

A Step will hold position for a short time, perform a step of the specified amount from the current location, pause for a short time, and then a second step back to the original location.

Above is not happening here, it gathers data and moves in same direction until the axis is disabled.

Red is NOT following the blue in the plot.

When enabled the axis is still but can be rotated by hand !?

Console commanded DAC0=100 etc works OK
Axis shows position changing when turned by hand, axis enabled.
C file is the motorsetup copied to C that I use.

There is something odd here but I cannot clear my mind and find what I missing to do (used to work with steppers, my first servo encounter)

So, what am I doing wrong?

Cheers Bengt
Group: DynoMotion Message: 503 From: Tom Kerekes Date: 7/3/2010
Subject: Re: +-10V
Hi Bengt,
 
It seems your servo is clearly not working.
There are 3 KMotion Screens that are servo related.  Config/Flash, IIR Filter, and Step Response.  Please save Screen shots of those screens as a .png file if you are still unable to get the servo to work.
 
Try this:
 
On the Config/Flash Screen disable following error faults by setting Max Following Error to a big number  1e9
 
Make sure the Filters are all disabled.  Push the Clear button for each of the 3 filters.  This actually sets each to a frequency independent gain of 1.
 
Now use the Step Response Screen for the following:
 
Set both Feed Forward Gains to zero
 
Disable Deadband (Gain=1 Range=0)
 
Limit our maximum speed to about 10% of full amplifier speed by setting the Max Output to 200 DAC Counts.
 
Set Max Error and Max Integrator to 2000 encoder counts  
 
Set to use only a low P gain (P=0.15 I=0 D=0)
 
Set Motion Profile parameters to reasonable values Vel=20000 Accel=200000 Jerk=2000000 (units are counts and seconds)
 
Set to make a moderates sized move, Size = 1000 Time=3 sec
 
Set Plot Type to Command, Position, Output vs Time
 
Push "Move"
 
Observe what happens with the motor and observe the plotted results.
 
The basic idea is that the blue plot is the desired trajectory (what we want) in encoder counts. 
 
The red plot is the actual measured trajectory (what happened) in encoder counts. 
 
The green plot is the DAC counts of velocity command to the amplifier (what the motor was told to do).
 
Here is a flow diagram of how the parameters are used:
 
Let me know the results and we can go to the next step.
 
Thanks
TK
 
 

Group: DynoMotion Message: 504 From: Bengt Sjoelund Date: 7/3/2010
Subject: Re: +-10V
Hi Tom,
Done what you asked me to do, still not working. Axis moves until I disable. I have downloaded PNG's to files in my CombiMill folder 4 pictures. Also the C file I use.
Cheers Bengt

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Bengt,
>
> It seems your servo is clearly not working.
>
> There are 3 KMotion Screens that are servo related.  Config/Flash, IIR Filter,
> and Step Response.  Please save Screen shots of those screens as a .png file if
> you are still unable to get the servo to work.
>
> Try this:
>
> On the Config/Flash Screen disable following error faults by setting Max
> Following Error to a big number  1e9
>
> Make sure the Filters are all disabled.  Push the Clear button for each of the 3
> filters.  This actually sets each to a frequency independent gain of 1.
>
> Now use the Step Response Screen for the following:
>
> Set both Feed Forward Gains to zero
>
> Disable Deadband (Gain=1 Range=0)
>
> Limit our maximum speed to about 10% of full amplifier speed by setting the Max
> Output to 200 DAC Counts.
>
> Set Max Error and Max Integrator to 2000 encoder counts  
>
> Set to use only a low P gain (P=0.15 I=0 D=0)
>
> Set Motion Profile parameters to reasonable values Vel=20000 Accel=200000
> Jerk=2000000 (units are counts and seconds)
>
> Set to make a moderates sized move, Size = 1000 Time=3 sec
>
> Set Plot Type to Command, Position, Output vs Time
>
> Push "Move"
>
> Observe what happens with the motor and observe the plotted results.
>
> The basic idea is that the blue plot is the desired trajectory (what we want) in
> encoder counts. 
>
>
> The red plot is the actual measured trajectory (what happened) in encoder
> counts. 
>
>
> The green plot is the DAC counts of velocity command to the amplifier (what the
> motor was told to do).
>
> Here is a flow diagram of how the parameters are used:
> http://www.dynomotion.com/Help/ServoFlowDiagram.htm
>
> Let me know the results and we can go to the next step.
>
> Thanks
> TK
>
>
>
>
>
> ________________________________
> From: Bengt Sjoelund <cnc@...>
> To: DynoMotion@yahoogroups.com
> Sent: Sat, July 3, 2010 7:58:15 AM
> Subject: [DynoMotion] Re: +-10V
>
>  
> Hi Tom,
> Gain now fixed 1.0 and offset -15.
> Step response screen, P=0.15 (0.1 = now movement) I=0 D=0
>
> A Move will hold position for a short time, perform a motion of the specified
> amount from the current location, pause for a short time, and then a second
> motion back to the original location.
>
> A Step will hold position for a short time, perform a step of the specified
> amount from the current location, pause for a short time, and then a second step
> back to the original location.
>
> Above is not happening here, it gathers data and moves in same direction until
> the axis is disabled.
>
> Red is NOT following the blue in the plot.
>
> When enabled the axis is still but can be rotated by hand !?
>
> Console commanded DAC0=100 etc works OK
> Axis shows position changing when turned by hand, axis enabled.
> C file is the motorsetup copied to C that I use.
>
> There is something odd here but I cannot clear my mind and find what I missing
> to do (used to work with steppers, my first servo encounter)
>
> So, what am I doing wrong?
>
> Cheers Bengt
>
Group: DynoMotion Message: 505 From: Tom Kerekes Date: 7/3/2010
Subject: Re: +-10V
Hi Bengt,
 
You have classic positive feedback instead of negative feedback.  This will cause the motor to move away from the desired position instead of toward the desired position.   Notice that as the blue plot starts to change the red plot starts to move the wrong way.  Also the further it moves away, the faster it moves away, until finally the output (green plot) hits the maximum that we have allowed (200 DAC counts).
 
Reverse any component in the entire servo loop to change from positive feedback to negative feedback.  ie. reverse the encoder position by setting InputGain0 = -1.
 
Regards
TK

Group: DynoMotion Message: 506 From: Bengt Sjoelund Date: 7/3/2010
Subject: Re: +-10V
Hi Tom,
There you see when a newbee is on the move ;)
Now axis is rock steady and moves as expected, thanks!
Downloaded a new picture what next.png
Hopefully you can assist this old fart so I get the hang of tuning.
When X is working I will setup Z axis and after that Y axis as soon as I get those power transistors in the mail.

Thanks for your kind support Tom, really appreciated. There are some new user here in Sweden soon going the same way of retrofitting Kflop/Kanalog to old milling machines as I am about to do. We all hang at the Electronics Forum and share the visdom ;) I think you have already orders on their way to Sweden.

Cheers Bengt


--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Bengt,
>
> You have classic positive feedback instead of negative feedback.  This will
> cause the motor to move away from the desired position instead of toward the
> desired position.   Notice that as the blue plot starts to change the red plot
> starts to move the wrong way.  Also the further it moves away, the faster it
> moves away, until finally the output (green plot) hits the maximum that we have
> allowed (200 DAC counts).
>
> Reverse any component in the entire servo loop to change from positive feedback
> to negative feedback.  ie. reverse the encoder position by setting InputGain0 =
> -1.
>
> Regards
> TK
Group: DynoMotion Message: 507 From: Tom Kerekes Date: 7/3/2010
Subject: Re: +-10V
Hi Bengt.
 
That's good progress.
 
Now notice that the position (red) is not quite able to go as fast as the command (blue) so it gradually falls further and further behind.  Also notice that the DAC (green) is clamped at our maximum allowed output of 200 counts (~1 Volt to the amplifier).
 
Increase the MaxOutput to a value you feel you need.  The max possible is 2047 counts (full +/- 10V).
 
You should then be ready to try to optimize the tuning.
 
Reduce the size of the move to something more modest like 1000 counts.
 
Try increasing the P gain to see if you can reduce the following error.
 
Note as the position errors become small the red and the blue plots become almost identical so it is better to change the plot type to Position Error, Output, vs Time which is plotting the difference between the red and blue plots.  The goal is to get the following errors to be acceptable for your system at the speeds required for your system.
 
If you increase the gain too much the system will become unstable and oscillate violently so be prepared to disable the axis.  Reducing the Max Output or Max Following Error Limits can help protect your system when it goes unstable.  Typically when tuning we find the point where the system goes unstable then reduce the gain to 50% of that value.
 
When changing gains use round numbers and change gains by significant amounts such as 20%.  The difference between a gain of 0.1987756 and 0.2 is unlikely to be noticeable.
 
After you find a optimal value of P, you will probably want to add a small amount of "I" gain.  Start with a small value of 0.0001.  Integral gain basically sums the errors over time so it doesn't allow a small error to persist for a long time.  With only P gain if the system has a small error, that error multiplied by the P gain will apply some voltage to the amplifier.  If that voltage is not enough to make the motor move (or overcome any friction, or load, or offset voltage, or force) the error could persist forever.  But with "I" gain the output will continuously increase (within the set limits) until the motor moves.
 
Regards,
TK
 
 
 

Group: DynoMotion Message: 509 From: Marty Escarcega Date: 7/3/2010
Subject: Re: +-10V
Bengt, its been great to see the dialogue back and forth between you and Tom. You have an interesting machine. If you can, do a video of it running and post it on you tube.
Are you going to tackle the threading issue?

Marty
---- Bengt Sjoelund <cnc@...> wrote:
> Hi Tom,
> There you see when a newbee is on the move ;)
> Now axis is rock steady and moves as expected, thanks!
> Downloaded a new picture what next.png
> Hopefully you can assist this old fart so I get the hang of tuning.
> When X is working I will setup Z axis and after that Y axis as soon as I get those power transistors in the mail.
>
> Thanks for your kind support Tom, really appreciated. There are some new user here in Sweden soon going the same way of retrofitting Kflop/Kanalog to old milling machines as I am about to do. We all hang at the Electronics Forum and share the visdom ;) I think you have already orders on their way to Sweden.
>
> Cheers Bengt
>
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
> >
> > Hi Bengt,
> >
> > You have classic positive feedback instead of negative feedback.  This will
> > cause the motor to move away from the desired position instead of toward the
> > desired position.   Notice that as the blue plot starts to change the red plot
> > starts to move the wrong way.  Also the further it moves away, the faster it
> > moves away, until finally the output (green plot) hits the maximum that we have
> > allowed (200 DAC counts).
> >
> > Reverse any component in the entire servo loop to change from positive feedback
> > to negative feedback.  ie. reverse the encoder position by setting InputGain0 =
> > -1.
> >
> > Regards
> > TK
>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
Group: DynoMotion Message: 514 From: Ross Ferguson Date: 7/3/2010
Subject: Re: +-10V
Good explanation of tuning Tom and why we should persevere.
It certainly enlightened me somewhat and has encouraged me to reinvestigate my settings.
You don't want to see the violent oscillations Bengt, I can assure from experience :)
Ross

On 4/07/2010 7:42 AM, Tom Kerekes wrote:
 
Hi Bengt.
 
That's good progress.
 
Now notice that the position (red) is not quite able to go as fast as the command (blue) so it gradually falls further and further behind.  Also notice that the DAC (green) is clamped at our maximum allowed output of 200 counts (~1 Volt to the amplifier).
 
Increase the MaxOutput to a value you feel you need.  The max possible is 2047 counts (full +/- 10V).
 
You should then be ready to try to optimize the tuning.
 
Reduce the size of the move to something more modest like 1000 counts.
 
Try increasing the P gain to see if you can reduce the following error.
 
Note as the position errors become small the red and the blue plots become almost identical so it is better to change the plot type to Position Error, Output, vs Time which is plotting the difference between the red and blue plots.  The goal is to get the following errors to be acceptable for your system at the speeds required for your system.
 
If you increase the gain too much the system will become unstable and oscillate violently so be prepared to disable the axis.  Reducing the Max Output or Max Following Error Limits can help protect your system when it goes unstable.  Typically when tuning we find the point where the system goes unstable then reduce the gain to 50% of that value.
 
When changing gains use round numbers and change gains by significant amounts such as 20%.  The difference between a gain of 0.1987756 and 0.2 is unlikely to be noticeable.
 
After you find a optimal value of P, you will probably want to add a small amount of "I" gain.  Start with a small value of 0.0001.  Integral gain basically sums the errors over time so it doesn't allow a small error to persist for a long time.  With only P gain if the system has a small error, that error multiplied by the P gain will apply some voltage to the amplifier.  If that voltage is not enough to make the motor move (or overcome any friction, or load, or offset voltage, or force) the error could persist forever.  But with "I" gain the output will continuously increase (within the set limits) until the motor moves.
 
Regards,
TK
 
 
 

Group: DynoMotion Message: 516 From: Bengt Sjoelund Date: 7/4/2010
Subject: Re: +-10V
Hi Ross,
I have seen the oscillations and I am not so keen to see that happening with higher speed settings ;)
Cheers Bengt

Good explanation of tuning Tom and why we should persevere.
It certainly enlightened me somewhat and has encouraged me to reinvestigate my settings.
You don't want to see the violent oscillations Bengt, I can assure from experience :)
Ross