Build Thread Tree325 Retrofit Started - Page 6


Page 6 of 18 FirstFirst ... 345678916 ... LastLast
Results 101 to 120 of 343

Thread: Tree325 Retrofit Started

  1. #101
    Member PeterTheWolf's Avatar
    Join Date
    Aug 2008
    Location
    USA
    Posts
    213
    Downloads
    0
    Uploads
    0

    Default Re: Tree325 Retrofit Started

    .....
    .....
    Quote Originally Posted by TomKerekes View Post
    Do you understand the basic concept of a servo? ....
    Tom, as I mentioned in the beginning of this project, I have very much to learn in electronics/motion … which includes servos. I greatly appreciate when you take the time to articulate these steps in

    this retrofit.


    Quote Originally Posted by TomKerekes View Post
    #1 the Encoder must count up and down correctly
    This requirement has been meant correctly: --> Results <--


    Quote Originally Posted by TomKerekes View Post
    #2 the DAC Output must cause the motor to move forward and backward reasonably
    This requirement has been meant correctly. Proven with a 1.5V battery in series with a 1K Ohm resistor across the “Velocity Command” lines AND with Kmotion command DAC0,1,2 = 100 or (-100).

    Quote Originally Posted by TomKerekes View Post
    #3 the Axis must be configured properly and enabled
    This requirement has been meant on X-axis successfully; however, I am still experiencing "Run-Away" on the Y-axis and Z-axis when I "Zero" and "Enable" using an "OutputGain" of "1" and "-1" on the Axis

    Configuration Screen while having the (which I believe is configured correct based on what I have learned here so far).

    Quote Originally Posted by TomKerekes View Post
    I thought you already verified #1 and #2. And #3 looks correct to me. But somewhere there must be a problem.

    The Axis Configuration actually involves parameters on 3 screens: Config/Flash, Step Response, and IIR Filters. You haven't shown us the other 2 screens for each axis. But if you have loaded the

    default configuration KanalogInitialPID.mot into each axis I'm assuming those are correct.

    It should be obvious from the KMotion Status Screens what is wrong. The Axis Screen shows the desired Destination and what the Encoder is doing. The Analog Screen will show what the Output DAC is

    commanded to drive the Motor.

    Alternatively you can use the Step Response Screen to Plot exactly what is going wrong. Select Position, Command, Output vs Time Plot Type. Select a move Size of 0. Push "Zero" and "Move". Study the

    Plot to see what happened or post it for us to review.
    .... Yes, something is still wrong which leaves me at a stand-still on knowing what to do next. I have captured three screens images, one for each axis as I tried the "Zero" and "Enable" using an

    "OutputGain" of "1" on X-axis and "-1" on the Y-axis and Z-axis with the default configuration "KanalogInitialPID.mot". These screen images include all the dialog screens I believe you advised to share

    including the Position, Command, Output vs Time Plot Type where I selected the Move Size = 0. Then I hit the "Zero" and then "Move" button before I capture these plots. Unfortunately, these plots

    are above my understand and what needs to be tried to resolve the "Run-Away" axis.

    Here are the screens images I captured of these results.

    .....
    .....

    J325 Quick Links:

    Machine
    Existing Machine Schematics
    Electronic Cabinet-Right Side
    Electronic Cabinet-Back SIde
    Existing Drive Board SD1525-10
    J325 Servo Drive-SD1525 Manual
    3-Phase Rotary Convert Used
    RickB's J325 Retrofit Wiring
    KFLOP 5VDC/15Watt/3A Power Supply
    KANALOG Mounted & Connected
    Kmotion - Axis Encoder Manual Test of Position via Manual Movement
    Kanalog-Encoder Voltage High/Low Checks & 1KOhm Resister
    Kmotion Configuration Screens "RUN-AWAY"

    .....
    .....



  2. #102
    Member
    Join Date
    Jun 2004
    Location
    Scotland
    Posts
    355
    Downloads
    0
    Uploads
    0

    Default Re: Tree325 Retrofit Started

    Peter,

    Just to check the basics, once you've changed the Output Gain setting (or any setting for that matter), have you tried clicking the download button?
    Whenever you change a setting on the Config&Flash screen, you have to download it to the KFlop, otherwise it doesn't alter what the KFlop is running.

    It's also good practice to click the Upload button first, to ensure the screens show what values the KFlop is already using.



  3. #103
    Member
    Join Date
    Jun 2013
    Location
    USA
    Posts
    1041
    Downloads
    0
    Uploads
    0

    Default Re: Tree325 Retrofit Started

    I may be wrong. My understanding is that when you press the move button on the step response screen all settings from all windows is downloaded automatically.

    Ben

    Sent from my HTC6525LVW using Tapatalk



  4. #104
    Member
    Join Date
    Jun 2004
    Location
    Scotland
    Posts
    355
    Downloads
    0
    Uploads
    0

    Default Re: Tree325 Retrofit Started

    I always thought the step/response screen only changed PID/motion settings...

    I'm sure Tom will clarify.



  5. #105
    Member
    Join Date
    Jun 2013
    Location
    USA
    Posts
    1041
    Downloads
    0
    Uploads
    0

    Default Re: Tree325 Retrofit Started

    You can see the effect easily. Make a move on the step response screen with no backlash comp. Then turn on comp and set the amount to 100. Then perform another move on the step response. The knew move should be off by 100 counts. When you hit move the axis is disabled. Then all screens are compiled and downloaded. Then the axis re enables and performs the move.

    Ben

    Sent from my HTC6525LVW using Tapatalk



  6. #106
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4045
    Downloads
    0
    Uploads
    0

    Default Re: Tree325 Retrofit Started

    All the Axis parameters from the screens Step Response, Config/Flash, and IIR Filters are downloaded each time Enable, Move, or Step is pushed. The idea is to make it easy to tune by simply changing a parameter and pushing "Move" to immediately see the effect.

    Hi PeterTheWolf,

    It sure looks to me like you have positive feedback on Y and Z.

    I realize this is all new to you and I admire your attitude, persistence, and patience. But it would be helpful to help you if you attempted to describe what you see in the plots. Imagine someone asking you to write down instructions on how to drive a car and saying I know absolutely nothing about cars... It makes it hard to know where to begin.

    In the tests much of the interesting stuff happens when you push the Zero and Enable buttons before the "Move" plot begins so it is missed. But the Plot still tells a story.

    For X it is pretty boring as the axis is just sitting still. You can see that because the Axis Position (Red) is steady at 5 counts. The Commanded Destination (Blue) is 0. So there is an error of 5 counts. Very small but significant. The Output (Green) is a constant -1. Note that Red and Blue use the Position Scale on the left and Green uses the DAC Output Scale on the right. So we now know the DAC must be at a value of -1 for the axis to remain still. Why not zero? Because of small offset errors in the analog electronics aren't perfect. Notice our P gain has a low value of 0.2. The motor configuration is chosen to start off will super conservative low gains and low limits on everything in order to attempt to just make sure things will work. The error of 5 counts multiplied by the P gain of 0.2 sets the output at -1. When things were originally enabled (which we can't see in the plot) everything should have been zero. Zero error and Zero output. But zero output causes the motor to drift positive After the position drifted to +5 there was enough error to change the output to -1 which stopped the axis from moving and that is the result we see.

    For Y we also missed the start of things. In the plot we can see the desired Destination Blue is at 0. But the Axis Position (Red) is running away. Not terribly fast but at a significant speed. The error is thousands of counts. The output (green) is pegged at -40 DAC counts. Why -40 ? Because we have a Max Error setting of 200. This tells the servo to limit and ignore errors more than 200 counts. So even though the error is in the +thousands and growing it is still treated as +200. 200 multiplied by the P gain of 0.2 causes the servo to attempt to correct the error by setting the DAC to -40. But the result is that the axis just keeps running away the wrong direction.

    It seems clear we have positive feedback instead of negative feedback and need to reverse the output. I realized you claim to have already tried that but I have my suspicions Lets focus on only getting the Y axis to work at the moment. Reverse the Output by changing the Output Gain from -1 to +1 and repeat the experiment and post the Plots for Y only.

    HTH
    Regards

    Regards
    TK http://dynomotion.com


  7. #107
    Member PeterTheWolf's Avatar
    Join Date
    Aug 2008
    Location
    USA
    Posts
    213
    Downloads
    0
    Uploads
    0

    Default Re: Tree325 Retrofit Started

    Quote Originally Posted by TomKerekes View Post

    For X it is pretty boring as the axis is just sitting still. You can see that because the Axis Position (Red) is steady at 5 counts. The Commanded Destination (Blue) is 0. So there is an error of 5 counts. Very small but significant. The Output (Green) is a constant -1. Note that Red and Blue use the Position Scale on the left and Green uses the DAC Output Scale on the right. So we now know the DAC must be at a value of -1 for the axis to remain still. Why not zero? Because of small offset errors in the analog electronics aren't perfect. Notice our P gain has a low value of 0.2. The motor configuration is chosen to start off will super conservative low gains and low limits on everything in order to attempt to just make sure things will work. The error of 5 counts multiplied by the P gain of 0.2 sets the output at -1. When things were originally enabled (which we can't see in the plot) everything should have been zero. Zero error and Zero output. But zero output causes the motor to drift positive After the position drifted to +5 there was enough error to change the output to -1 which stopped the axis from moving and that is the result we see.
    Ok ... this helps me understand, a little, of what this plot is suppose to show. Thanks for your patients and explanation... I really appreciate the details.



    Quote Originally Posted by TomKerekes View Post
    It seems clear we have positive feedback instead of negative feedback and need to reverse the output. I realized you claim to have already tried that but I have my suspicions Lets focus on only getting the Y axis to work at the moment. Reverse the Output by changing the Output Gain from -1 to +1 and repeat the experiment and post the Plots for Y only.
    OK, I just got done testing one more time. Since this testing (plotting) is dynamic (and not static) I can see how you were missing important information to help in the analysis of my "Run-Away" issue.
    I started once more from the beginning (with the "OutputGain" set to "1" on all axis and recorded (via videos) what exactly what I did in Kmotion. However, to my surprise, NOW there is no "Run-Away" on any of the axis.

    It would seem that all axis will hold position when enabled with the "OutputGain" set to "1". However, I am getting a higher error count on Y-axis and Z-axis as compared to the X-axis, which is 5.

    Here are three video links to the Kmotion screens as I made this test. I trust they will help in understand better what I am doing (or not doing correctly). The plots do look different from axis to axis and still leave me confused as to what I am looking for as needed corrections and what to do as my next step.

    I choose to provide these videos as links (as downloadable ZIP files) instead uploading to YouTube, as I am sure the world does not care about my ignorance on this project.

    Link -- Video #1 (Compressed 122mb)

    Link -- Video #2 (Compressed 122mb)

    Link -- Video #3 (Compressed 83mb)

    .....
    .....

    J325 Quick Links:

    Machine
    Existing Machine Schematics
    Electronic Cabinet-Right Side
    Electronic Cabinet-Back SIde
    Existing Drive Board SD1525-10
    J325 Servo Drive-SD1525 Manual
    3-Phase Rotary Convert Used
    RickB's J325 Retrofit Wiring
    KFLOP 5VDC/15Watt/3A Power Supply
    KANALOG Mounted & Connected
    Kmotion - Axis Encoder Manual Test of Position via Manual Movement
    Kanalog-Encoder Voltage High/Low Checks & 1KOhm Resister
    Kmotion Configuration Screens "RUN-AWAY"

    .....
    .....



  8. #108
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4045
    Downloads
    0
    Uploads
    0

    Default Re: Tree325 Retrofit Started

    Hi PeterTheWolf,

    Its working !!

    Thanks for the Videos and the Play-by-Play it gives great insight into the difficulties Users have with the software.

    All 3 Axes are servoing and holding with the OutputGain 1 settings.

    Here are some comments:

    When you change any parameter you can then just click "Move" (no need to click anywhere else or anything)

    Only use the "Move" button (Move does a smooth accelerated motion of the size specified, Step does a sudden jump. In your test of size 0 they both do the same thing and don't move at all)

    After pushing "Move" you should wait 3 seconds for the move to complete, upload, and plot before clicking anything else

    Your X axis has only a small DAC offset ~1 counts

    Y and Z have a bit more of 4 or 5 counts. This is normal.

    Because Y and Z have an offset of ~5 the error will grow to about 25 before there is enough error to correct for the offset. 25 counts is actually pretty small. Maybe 0.001 inches on your machine. Later I Gain can be used to eliminate this. But let's not worry about it now.

    Your X axis tends to sit still, where Y and Z tend to dither around 1 count. This is normal. The plots look messy and confusing but if you study them you should see that encoder is just randomly dithering ~1 count. This is a microscopic amount and will just vary randomly based on friction, vibrations, and such. This is normal. The software automatically zooms way in to such an exaggerated scale that it looks ugly. If plotted on a scale of say 1 inch (or 1Volt on the DAC) you would not even be able to see any change.

    So the next step is to make a move of a significant size. ie 1000 counts.

    Experiment with different sizes.

    We will then begin to increase gains and limits to see what kind of performance and accuracy we can achieve.

    HTH
    Regards

    Regards
    TK http://dynomotion.com


  9. #109
    Member PeterTheWolf's Avatar
    Join Date
    Aug 2008
    Location
    USA
    Posts
    213
    Downloads
    0
    Uploads
    0

    Default Re: Tree325 Retrofit Started

    ....
    ....
    Quote Originally Posted by TomKerekes View Post
    So the next step is to make a move of a significant size. ie 1000 counts.

    Experiment with different sizes.

    We will then begin to increase gains and limits to see what kind of performance and accuracy we can achieve.
    I made some more tests (plots) based on different size counts as advised.

    Results are as follows:

    1.) 1000 Size count Plot -- Video (Zip file 30mb)

    2.) My interpretation of the plot -- Video (Zip file 42mb)

    3.) 2000 Size count Plot -- Video (Zip file 25mb)

    4.) 10,000 Size count Plot -- Video (Zip file 48mb)

    5.) 20,000 Size count Plot -- Video (Zip file 29mb)

    6.) 200,000 Size count Plot -- Video (Zip file 62mb)

    I think I am ready for some needed advice on what to start changing on the "increase gains and limits to see what kind of performance and accuracy we can achieve".

    Would it be possible for someone to post a image of a good looking (Tuned) "Position, Command, Output vs Time Plot Type" I could use for reference as I start making Gain/Limit changes.


    .....
    .....

    J325 Quick Links:

    Machine
    Existing Machine Schematics
    Electronic Cabinet-Right Side
    Electronic Cabinet-Back SIde
    Existing Drive Board SD1525-10
    J325 Servo Drive-SD1525 Manual
    3-Phase Rotary Convert Used
    RickB's J325 Retrofit Wiring
    KFLOP 5VDC/15Watt/3A Power Supply
    KANALOG Mounted & Connected
    Kmotion - Axis Encoder Manual Test of Position via Manual Movement
    Kanalog-Encoder Voltage High/Low Checks & 1KOhm Resister
    Kmotion Configuration Screens "RUN-AWAY"

    .....
    .....



  10. #110
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4045
    Downloads
    0
    Uploads
    0

    Default Re: Tree325 Retrofit Started

    Hi PeterTheWolf,

    Very good. Its great to have your interpretations of what you see and understand. That allows us to correct you when you are a bit off the mark.

    All your axes hardware are behaving well and the same so let's just focus on one axis the X axis to save time.

    Some comments/corrections.

    The Output (green plot) always refers to the scale on the right.

    The goal is to get the Position (red) to closely follow the Command (blue). btw as we tune things better they should follow so closely that you won't be able to see the difference at this scale. So we will need to zoom in (left click drag) or plot the difference (error) instead. But you don't have that issue now

    The green plot should not match the red/blue plots. It is basically commanded speed which is something completely different than position. Its like comparing the speedometer in your car with the odometer. Two completely different things. The relationship is the the speedometer should determine how fast the odometer is changing. Or in the plot the value of the green determines the slope of the red.

    Your resolution should be 20480 counts/inch. So a move of 10000 counts should be about 1/2inch which would be many revs of the motor not 1/2 rev as you mentioned.

    The basic issue right now is with the current settings we are severely limiting the speed of the motor. A Max Error of 200 and P Gain of 0.2 severely limits the output to 40 DAC counts. From your earlier experiments manually setting DAC values you should realize this is fairly slow. Compared to the max value of 2047 (10Volts). We are limited to about 2% of full speed. This is like putting a brick under the gas pedal in your car and then trying to follow someone in a Tesla. This is really my mistake for not telling you to increase things before doing the tests. But hopefully a great example to help understand how the Max Limits effect things.

    I've captured your X plot of size 10000 move and added some notes.

    Tree325 Retrofit Started-move10000-png

    You might think of it like this: Imagine the blue plot is the Testla. The Red Plot is you. The Green Plot is your Gas pedal position. Can you see these elements in the Plot:

    #1 The Tesla Speeds far away and stops for a while.

    #2 You quickly peg the gas pedal down to the brick in an attempt to follow

    #3 You gradually move in the direction the Tesla went

    #4 The Tesla quickly returns back to the starting point

    #5 As the Tesla quickly passes you you reverse direction and gradually follow him home even though you didn't go nearly as far as the Tesla did.

    #6 After arriving home you release the gas to almost nothing which is just enough to hold still and not drift away.


    So I suggest the next thing to do is take the brick out from under your gas pedal. Change the Max limits error to 100000. This allows with a big enough error the output to go to essentially any value (even with a modest P of 0.2). However the Max limit output of 200 would still limit the Output to 200 (10% of full speed). Let's increase that also to 2047 to permit the amplifier to give full speed and power.

    HTH
    Regards

    Regards
    TK http://dynomotion.com


  11. #111
    Member PeterTheWolf's Avatar
    Join Date
    Aug 2008
    Location
    USA
    Posts
    213
    Downloads
    0
    Uploads
    0

    Default Re: Tree325 Retrofit Started

    ....
    .....

    Quote Originally Posted by TomKerekes View Post
    Your resolution should be 20480 counts/inch. So a move of 10000 counts should be about 1/2inch which would be many revs of the motor not 1/2 rev as you mentioned.
    ....
    .....

    So I suggest the next thing to do is take the brick out from under your gas pedal. Change the Max limits error to 100000. This allows with a big enough error the output to go to essentially any value (even with a modest P of 0.2). However the Max limit output of 200 would still limit the Output to 200 (10% of full speed). Let's increase that also to 2047 to permit the amplifier to give full speed and power.
    Tom, Thank you very much for breaking this all down with the "Word-Picture" and the "Sketched-Up" image. It really helps to accelerate my understanding of what I am trying to archive.

    I just got done doing the next test with the following parameters ....

    on the "Step Response" screen:

    "Max Limits":
    Output -- set to 2047
    Error -- set to 100,000

    It would seem that my Yugo still just cannot keep up with the Tesla on a short move; however, if it gets to a bit longer of a chase distance then the old Yugo just may have a chance of keeping up.

    In any case, here is the plot of this test:

    Video of Output/Error increase (Zip file 44mb)

    .....
    .....

    J325 Quick Links:

    Machine
    Existing Machine Schematics
    Electronic Cabinet-Right Side
    Electronic Cabinet-Back SIde
    Existing Drive Board SD1525-10
    J325 Servo Drive-SD1525 Manual
    3-Phase Rotary Convert Used
    RickB's J325 Retrofit Wiring
    KFLOP 5VDC/15Watt/3A Power Supply
    KANALOG Mounted & Connected
    Kmotion - Axis Encoder Manual Test of Position via Manual Movement
    Kanalog-Encoder Voltage High/Low Checks & 1KOhm Resister
    Kmotion Configuration Screens "RUN-AWAY"

    .....
    .....



  12. #112
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4045
    Downloads
    0
    Uploads
    0

    Default Re: Tree325 Retrofit Started

    Hi PeterTheWolf,

    Great. Getting better. Now at least the Position (red) is moving nearly the amount it is supposed to (blue). Notice the Output (green) is going up to around 1000 of the 2047 available and there are no longer any flat section where the gas is being pegged to the brick or now to the floorboards.

    Tree325 Retrofit Started-move10000_nolimit-png

    Soon you should try to understand that the Motion Profile - Velocity, Acceleration, and Jerk determine the trajectory (blue plot). Or think of it of how the Tesla drives. Jerk determines how fast the Tesla Driver moves the accelerator pedal. Acceleration determines how far he is allowed to push the accelerator. Velocity is at what speed he backs off the accelerator to not exceed a speed limit. Of course if we were to slow down the Testa or reduce its acceleration we could follow it much better. But I think for the moment the motion profile is probably set reasonably as something we should be able to follow well. So let's leave that alone for now.

    We will now begin "tuning" the servo. This changes how the servo reacts to errors to follow the trajectory with the least error. This is a very complex problem that depends on the dynamic response of your system. Mechanical compliances, delays, backlash, resonances, etc... Fortunately several simple techniques usually provide sufficient control to give acceptable performance.

    Right now we only have a small P gain of 0.2 as our entire control strategy. This means that the error has to grow to a pretty big value before we command much output. Or we watch the Tesla go pretty far ahead before we push the accelerator significantly. To get the Output to be at a level to keep up (~1200 DAC counts) the error must be (~6000 counts = ~ 1/4 inch) because 6000 x 0.2 = 1200. If you look at your last big move example (100000 counts / 20480 = 4.8828 inches) you should be able to see a lag of ~6000 encoder counts during the constant speed portion of the trajectory with the output at ~1200 DAC counts. So the next step is to increase the P Gain. This will cause the servo to more aggressively follow the trajectory and reduce the error. However this only works up to a point. Imagine the Tesla starts inching ahead and we stomp the accelerator all the way to the floor. We will likely overshoot and then have to stomp on the brakes. This will result in an ever growing oscillation. A similar situation is trying to drive straight down a road. If you start drifting off of the center line (or the road curves) the steering wheel should be corrected by the correct amount to get back on track quickly. An excessive correction will result in weaving down the road and possibly even crashing.

    So begin increasing the P gain and run tests. The following errors should reduce. Continue up to a point where things go unstable. Then back off a safe margin (maybe 30%). Note the oscillation sometimes becomes very violent so be prepared to disable your amplifiers. Later after we get a bit better following we can set the Max Following Error to a smaller value so that if the system starts to go unstable it will automatically disable.

    Tips on choosing increasing gains: Note a change of 1% is not likely to be even noticeable. So make significant changes of 10-100% Keep numbers simple with only 1 or 2 significant digits. The difference between a gain of 0.3 and 0.30012345 will not be significant so just keep the numbers simple.

    HTH
    Regards

    Regards
    TK http://dynomotion.com


  13. #113
    Member PeterTheWolf's Avatar
    Join Date
    Aug 2008
    Location
    USA
    Posts
    213
    Downloads
    0
    Uploads
    0

    Default Re: Tree325 Retrofit Started

    ....
    .....
    Quote Originally Posted by TomKerekes View Post
    So begin increasing the P gain and run tests. The following errors should reduce. Continue up to a point where things go unstable. Then back off a safe margin (maybe 30%). Note the oscillation sometimes becomes very violent so be prepared to disable your amplifiers. Later after we get a bit better following we can set the Max Following Error to a smaller value so that if the system starts to go unstable it will automatically disable.

    Tips on choosing increasing gains: Note a change of 1% is not likely to be even noticeable. So make significant changes of 10-100% Keep numbers simple with only 1 or 2 significant digits.
    Tom, This is cool stuff .... once the confusion starts getting replaced with more and more understanding. Thanks to your commitment to us all on this forum in making this happen.

    I increased the Gain -P from 0.200 to 2.2 in 0.200-0.400 increments. I captured this all in the the following Kmotion video. When you say I should back off 30% from where I see oscillation, do you mean where I see it not settling down. In the Kmotion video you will see it start in the plot at about P=1.6 and it will not stop oscillation at P=2.2 ... so I should be backing off 30% from the P=2.2. Or can I reply on the test plots and to find a Gain P value where I just start to see the (RED) line begin to oscillate at the peck and end of the motion?

    Video Link to the Kmotion Gain P Test Increase. (ZIP file 128mb)

    Video of the X-axis Pulley beginning to Oscillate (ZIP file 111mb)

    .....
    .....

    J325 Quick Links:

    Machine
    Existing Machine Schematics
    Electronic Cabinet-Right Side
    Electronic Cabinet-Back SIde
    Existing Drive Board SD1525-10
    J325 Servo Drive-SD1525 Manual
    3-Phase Rotary Convert Used
    RickB's J325 Retrofit Wiring
    KFLOP 5VDC/15Watt/3A Power Supply
    KANALOG Mounted & Connected
    Kmotion - Axis Encoder Manual Test of Position via Manual Movement
    Kanalog-Encoder Voltage High/Low Checks & 1KOhm Resister
    Kmotion Configuration Screens "RUN-AWAY"

    .....
    .....



  14. #114
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4045
    Downloads
    0
    Uploads
    0

    Default Re: Tree325 Retrofit Started

    Hi PeterTheWolf,

    Congratulations you did that perfectly. I'd say at around P=1.6 you still have a very stable system with greatly improved accuracy.

    Tree325 Retrofit Started-move1000_p1-6-png

    Its becoming hard to see clearly how much difference there is between Command(blue) and Position(red). It appears to around 1000 counts (1000/20480 = 49mils). If you plotted error it would be obvious. Also if you saved the raw data as a text file and posted it then we can import it back into KMotion and plot and zoom it however we want. Note the raw data does not include all the axis settings so always include those with the data.

    The next step is to add D Gain to see if that allows us to get better performance. D Gain functions as a form of damping. Think of it like dragging the brakes. Or like submersing a mechanism like a tuning fork in honey. It tends to resist motion and to kill oscillation. Mathematically how it is achieved is we take the first derivative (or difference - this is where the D comes from) of the Encoder Position to get velocity. Then include a factor times this in the output. Theoretically we could apply any amount of damping we wish, however in the real world there are limits mainly due to delays in the mechanics and electronics. If too much output is applied too late then the result will no longer dampen but rather excite the system.

    So the next step is to add some D Gain and increase it to find how much D Gain we can add before the system goes unstable and oscillates, then back off some amount as a safety margin.

    Note the Tachometers connected to the Amplifiers should be already performing this function. So it is hard to say how beneficial this exercise will be. If the damping in the drive is optimal then there may not be much or any improvement. There may be some potentiometers on the drives to tune the tachometer gain. But I'd suggest just leaving that alone and see what we can get with D Gain in KFLOP.

    There is a difficulty in computing the derivative of the encoder position to get velocity that you should understand. The problem arises because the Encoder Position is not a smoothly changing analog value that we can easily measure the rate-of-change (velocity). Unfortunately it changes in "steps" of one encoder count. Think of measuring the slope of a staircase. It goes along flat for a while and then has a sudden jump up one step. Quantization is the name for this effect. If we were to simply add D gain the effect would be spikes in the output whenever the encoder changes. The height of the spikes will be equal to the amount of D Gain we use. Your amplifier might not like the spikes. Fortunately there is a simple remedy: Add a low pass filter to smooth out the spikes in the output. A low pass filter allows slower things to pass with little change but not fast things. Because the normal changes in the output to make motor correction is relatively slow and the spikes are relatively fast if we choose a cutoff frequency towards the middle we can smooth out the spikes while having a negligible effect on the servo performance. On the IIR Filter Screen add this filter as filter #2 (the last and third one because this filter will smooth any Feed Forward we might add later).

    Filter #2
    #1 Select type Low Pass 2nd
    #2 Enter Freq=500Hz and Q=1.4
    #3 Push the Compute Button

    This Servo Flow Diagram might help fit together how the Servo operates. Try and locate the Max Error, Max Output, P, D, and Filter #2 that we have been discussing:

    Tree325 Retrofit Started-servoflowdiagram-png

    You should now be ready to try adding D gain. Every system is different but D gain usually work best with a value between 2 ~ 20 of the P Gain value.

    So in your case you might start with P = 1.6 and D = 3.0

    Unfortunately P and D gain interact in a complex manner that won't normally allow you to simply find the best value of one and then the other independently. In fact after adding the D gain you would normally find that the servo performance is slower and worse (because of all the drag added). But then you may be able to increase the P Gain to higher values than you were able to before and the result should be better than before. It is somewhat of a two variable optimization game. I find the following method usually will get there:

    #1 Optimize P only (as you already have done)
    #2 Start with D = 2P and increase until system goes unstable
    #3 Back off D about 30%
    #4 Re-optimize P

    This is usually fairly optimized but sometimes tweaking P and or D up/down from those values may have better results.

    When finished you should verify that there are reasonable stability margins in that you can increase P or D by at least 20% and the system will still be stable.

    HTH
    Regards

    Regards
    TK http://dynomotion.com


  15. #115
    Member
    Join Date
    May 2012
    Location
    canada
    Posts
    537
    Downloads
    0
    Uploads
    0

    Default Re: Tree325 Retrofit Started

    Good to see your making progress



  16. #116
    Member PeterTheWolf's Avatar
    Join Date
    Aug 2008
    Location
    USA
    Posts
    213
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by mmurray70 View Post
    Good to see your making progress
    Hello mmurray70.... dont go too far away, you were my motivating inspirations in taking on this project and I still have a very long ways to go; however, Tom has, mostly, single-handedly taken me from the "diaper" stages of begining this retrofit and enabled me to actual get me beyond "crawling" to where servo tuning is now happening.
    I trust many others on this forum will benefit by his great patients and technical input to get me this far.
    ....
    ....
    ....



  17. #117
    Member
    Join Date
    May 2012
    Location
    canada
    Posts
    537
    Downloads
    0
    Uploads
    0

    Default Re: Tree325 Retrofit Started

    Quote Originally Posted by PeterTheWolf View Post
    Hello mmurray70.... dont go too far away, you were my motivating inspirations in taking on this project and I still have a very long ways to go; however, Tom has, mostly, single-handedly taken me from the "diaper" stages of begining this retrofit and enabled me to actual get me beyond "crawling" to where servo tuning is now happening.
    I trust many others on this forum will benefit by his great patients and technical input to get me this far.
    ....
    ....
    ....
    Sorry for not posting for a while. I've been following your project but I didnt have much to contribute to the last few issues you had with selecting a power supply, getting encoders to count properly with pull up resistors etc, I thought it was best to let Tom answer those issues. And now at the tuning stage im not knowledgeable like some on here. But if i see something i can help with ill try my best. Your making good progress. Once you have your servos moving and tuned properly the rest will probably be a little easier.



  18. #118
    Member PeterTheWolf's Avatar
    Join Date
    Aug 2008
    Location
    USA
    Posts
    213
    Downloads
    0
    Uploads
    0

    Default Re: Tree325 Retrofit Started

    ...
    ....

    Quote Originally Posted by TomKerekes View Post
    Also if you saved the raw data as a text file and posted it then we can import it back into KMotion and plot and zoom it however we want. Note the raw data does not include all the axis settings so always include those with the data.
    How do I go about saving the raw data as a text file? Or is this data file captured as I test from the "Step Response" dialog screen use and resides on the OS?

    Quote Originally Posted by TomKerekes View Post

    You should now be ready to try adding D gain. Every system is different but D gain usually work best with a value between 2 ~ 20 of the P Gain value.

    So in your case you might start with P = 1.6 and D = 3.0

    Unfortunately P and D gain interact in a complex manner that won't normally allow you to simply find the best value of one and then the other independently. In fact after adding the D gain you would normally find that the servo performance is slower and worse (because of all the drag added). But then you may be able to increase the P Gain to higher values than you were able to before and the result should be better than before. It is somewhat of a two variable optimization game. I find the following method usually will get there:

    #1 Optimize P only (as you already have done)
    #2 Start with D = 2P and increase until system goes unstable
    #3 Back off D about 30%
    #4 Re-optimize P

    This is usually fairly optimized but sometimes tweaking P and or D up/down from those values may have better results.

    When finished you should verify that there are reasonable stability margins in that you can increase P or D by at least 20% and the system will still be stable.
    My results for the increase of Gain "D" seem to be minimum. I started out with P=1.6 and incremented Gain "D" from 3.2 to 20 with minimum results. So then I started increasing "D" much higher. The main thing, I think I was trying to achieve was to remove as much of the "ripple" of the Red line as possible without introducing more "ripple".

    I settled on the results of the P=1.4 with D=40 ... then when I increased by 20% to P=1.68 I saw still saw very little RED ripple being introduced. The 20% increase on the "D" gain only made the RED line look better. If fact, I never did see any oscillation with high amounts of "D" gain ... in fact it actually made the RED line look better; however, I did see the GREEN line get worst on ripple on large "D" values.

    Here is a video of my testing as I tried to gain understanding. (ZIP File 76mb)

    Here is a video on, what I think, should be the end results. (ZIP File 18mb)

    Am I on track with these tests numbers and watching/changing correctly?
    .....
    .....

    J325 Quick Links:

    Machine
    Existing Machine Schematics
    Electronic Cabinet-Right Side
    Electronic Cabinet-Back SIde
    Existing Drive Board SD1525-10
    J325 Servo Drive-SD1525 Manual
    3-Phase Rotary Convert Used
    RickB's J325 Retrofit Wiring
    KFLOP 5VDC/15Watt/3A Power Supply
    KANALOG Mounted & Connected
    Kmotion - Axis Encoder Manual Test of Position via Manual Movement
    Kanalog-Encoder Voltage High/Low Checks & 1KOhm Resister
    Kmotion Configuration Screens "RUN-AWAY"

    .....
    .....



  19. #119
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4045
    Downloads
    0
    Uploads
    0

    Default Re: Tree325 Retrofit Started

    Hi PeterTheWolf,

    How do I go about saving the raw data as a text file? Or is this data file captured as I test from the "Step Response" dialog screen use and resides on the OS?
    After you do a "Move" on the Step Response Screen push the "Save Data" button.

    I settled on the results of the P=1.4 with D=40 ... then when I increased by 20% to P=1.68 I saw still saw very little RED ripple being introduced. The 20% increase on the "D" gain only made the RED line look better. If fact, I never did see any oscillation with high amounts of "D" gain ... in fact it actually made the RED line look better; however, I did see the GREEN line get worst on ripple on large "D" values.

    Here is a video of my testing as I tried to gain understanding. (ZIP File 76mb)

    Here is a video on, what I think, should be the end results. (ZIP File 18mb)

    Am I on track with these tests numbers and watching/changing correctly?
    It looks like you get the idea. Here is the original with P=1.6 D=0

    Tree325 Retrofit Started-p1-6d0withripple-png

    Now with P=1.6 D=40

    Tree325 Retrofit Started-p1-6d40noripple-png

    Notice less ripple in the Position.

    I didn't really see where you pushed D to the point where it went nuts. btw the Position is what is important. Ripple in the output might be bad or good. It is good if it is preventing oscillation in the Axis Position. Bad if it is causing oscillation. Let's leave things at P=1.6 and D=40 and move on to I Gain (Integrator).

    Integrator Gain is mainly used to eliminate errors that persist over time. Think of it like the servo having an offset knob that it can turn. If it sees the Position stuck below the target it starts turning the knob up. If it sees the Position stuck above the target it starts turning the knob down. The speed that the knob is turned depends on the size of the error and the value of the I Gain. Therefore higher I Gain corrects errors faster. However I gain is very destabilizing. Cranking the knob too rapidly is likely to cause large overshoot and instability.

    Having any I gain at all guarantees zero average error. Any error at all will cause the output to increase and increase until eventually the error will be reduced to zero (and possibly overshoot). This assumes the amplifier has enough power or there isn't some other abnormal limitation. Using the "follow the Tesla" example it is like deciding to gradually advance the accelerator pedal until you catch up to the Tesla. Given enough time you are guaranteed to catch up (and likely pass) the Tesla unless your pedal pegs to the floor boards.

    I gain virtually forces overshoot. This is required in order to have zero average error. The amount behind and the amount ahead must be equal. Mathematically the area between the red and blue plots above and below must be equal over all time.

    Looking at the plots above there is a significant persistent following error while moving. By adding I gain we should be able to prevent it from growing so large and then to drive it back to zero.

    I Gain values are normally very small because they rapidly (every 90us) accumulate. Start with a very small number such as 0.00001. Or the smallest number necessary to see little or no effect. Then increase. Errors should reduce. Change the Plot type to Error and Output to see Error magnitudes better. At some point the system will go unstable. As usual back off by a significant margin and until the motion is most desirable.

    Regards

    Regards
    TK http://dynomotion.com


  20. #120
    Member
    Join Date
    Aug 2008
    Location
    USA
    Posts
    228
    Downloads
    0
    Uploads
    0

    Default Re: Tree325 Retrofit Started

    I have a J325 that I did a retrofit on several years ago and want to embark on an upgrade to that previous retrofit. I will go through the thread and watch closely. My goal is to have a closed loop control

    Bill



Page 6 of 18 FirstFirst ... 345678916 ... LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Tree325 Retrofit Started

Tree325 Retrofit Started