Results 1 to 8 of 8

Thread: Fundamental problem with scale feedback

  1. #1
    Registered
    Join Date
    Mar 2007
    Location
    USA
    Posts
    31
    Downloads
    0
    Uploads
    0

    Fundamental problem with scale feedback

    Hello,

    I have a milling machine with stepper motors and linear scales. I have everything talking and working, and I have run into a problem with using the scale feedback. Axis doesn't provide for a pin to feed actual joint position into. I tried feeding it into the motor position pin, but because I am using screw comp, this causes issues, especially with homing. The screw comp also causes problems using the method outlined in the EMC wiki.

    Axis does provide a pin called actual joint position, but it is an output. What I need is a pin in axis that is actual joint position input. A actual and commanded delta output would be nice too.

    Thoughts?

    Brian


  2. #2
    Registered
    Join Date
    Mar 2004
    Location
    St. Louis, MO
    Posts
    332
    Downloads
    0
    Uploads
    0
    Quote Originally Posted by EFI-Unlimited View Post
    Hello,

    I have a milling machine with stepper motors and linear scales. I have everything talking and working, and I have run into a problem with using the scale feedback. Axis doesn't provide for a pin to feed actual joint position into. I tried feeding it into the motor position pin, but because I am using screw comp, this causes issues, especially with homing. The screw comp also causes problems using the method outlined in the EMC wiki.

    Axis does provide a pin called actual joint position, but it is an output. What I need is a pin in axis that is actual joint position input. A actual and commanded delta output would be nice too.

    Thoughts?

    Brian
    First, Axis has nothing to do with this, it is only the on-screen GUI. You are probably using the stepgen component of EMC, which is not a servo system. You need to use a step generator that can work in the servo mode of operation. Second, you need a method to read the encoder inputs into the computer. While you can do this with an extra parallel port and the HAL encoder component, there is an upper limit to the rate at which the software can read the encoder without losing counts. You can calculate the upper limit from the BASE_THREAD rate. You never want the encoder to be sending counts in at a rate faster than every couple BASE_THREAD ticks.
    So, if the BASE_THREAD is 50000, or 50 microseconds, that is 20 KHz. So, you don't want more than 10000 encoder counts per second. If the encoder has a resolution of .0004" (metric scale of ,01mm) or 2540 counts/inch, and you are moving at 60 IPM or one inch per second, then that is only 2540 counts/second, so that should work.

    But, it eats up most of a whole parallel port doing this. So, you might look at some of the hardware "accelerators" available for EMC.

    Anyway, I know how to do this using my Universal PWM Controller, I'm not sure of the exact details of doing this using all EMC-Hal components, but you definitely need to add in the PID component, which is the central part of closing a servo loop. You can look at the univstep configs files that are on your EMC system to see how all this is hooked up.
    ppmc.0.encoder.00.position is the scaled position out of the encoder counter. ppmc.0.stepgen.00.velocity is the step rate output to the hardware step generator.

    Jon


  3. #3
    Registered
    Join Date
    Mar 2007
    Location
    USA
    Posts
    31
    Downloads
    0
    Uploads
    0
    Quote Originally Posted by jmelson View Post
    First, Axis has nothing to do with this, it is only the on-screen GUI. You are probably using the stepgen component of EMC, which is not a servo system. You need to use a step generator that can work in the servo mode of operation. Second, you need a method to read the encoder inputs into the computer. While you can do this with an extra parallel port and the HAL encoder component, there is an upper limit to the rate at which the software can read the encoder without losing counts. You can calculate the upper limit from the BASE_THREAD rate. You never want the encoder to be sending counts in at a rate faster than every couple BASE_THREAD ticks.
    So, if the BASE_THREAD is 50000, or 50 microseconds, that is 20 KHz. So, you don't want more than 10000 encoder counts per second. If the encoder has a resolution of .0004" (metric scale of ,01mm) or 2540 counts/inch, and you are moving at 60 IPM or one inch per second, then that is only 2540 counts/second, so that should work.

    But, it eats up most of a whole parallel port doing this. So, you might look at some of the hardware "accelerators" available for EMC.

    Anyway, I know how to do this using my Universal PWM Controller, I'm not sure of the exact details of doing this using all EMC-Hal components, but you definitely need to add in the PID component, which is the central part of closing a servo loop. You can look at the univstep configs files that are on your EMC system to see how all this is hooked up.
    ppmc.0.encoder.00.position is the scaled position out of the encoder counter. ppmc.0.stepgen.00.velocity is the step rate output to the hardware step generator.

    Jon
    Jon,

    I think I am a few steps ahead of you. I already have HAL reading both scales correctly. I have already done the math for the input frequency. When I say axis has no provision for joint feedback, I am referring to the HAL component 'axis'. specifically, axis.0.joint-pos-fb being an OUT. I need that pin to be an IN. Once I get that, I can take the difference of axis.0.joint-pos-cmd and axis.0.joint-pos-fb and add that to the stepgen input. This likely wouldn't even need a PID loop.

    Again, I am way past the rudimentary connection and setup problems. What I am up against is a missing 'feature' of the HAL component 'axis'.

    Brian


  4. #4
    Registered
    Join Date
    Feb 2008
    Location
    USA
    Posts
    134
    Downloads
    0
    Uploads
    0
    Quote Originally Posted by EFI-Unlimited View Post
    Jon,

    I think I am a few steps ahead of you. I already have HAL reading both scales correctly. I have already done the math for the input frequency. When I say axis has no provision for joint feedback, I am referring to the HAL component 'axis'. specifically, axis.0.joint-pos-fb being an OUT. I need that pin to be an IN. Once I get that, I can take the difference of axis.0.joint-pos-cmd and axis.0.joint-pos-fb and add that to the stepgen input. This likely wouldn't even need a PID loop.

    Again, I am way past the rudimentary connection and setup problems. What I am up against is a missing 'feature' of the HAL component 'axis'.

    Brian
    axis.xxxx in not needed for actual control, just a way to pass parameters to the AXIS GUI...

    As Jon said, The normal way a closed loop stepgen driven servo is done in EMC is by feeding the commanded position and the encoder position feedback into a PID component than drives a stepgen running in velocity mode. The PID loop needs to have feedforward set to one and maybe a small amount of P and or I to compensate for clock differences (Hardware stepgens only) or delays in changing direction (Both hardware and software stepgens)


  • #5
    Registered
    Join Date
    Mar 2007
    Location
    USA
    Posts
    31
    Downloads
    0
    Uploads
    0
    I must not be explaining the issue clearly.

    I am not concerned with how to close the loop with a PID controller.

    The only place I can connect the encoder data to in EMC has the screw comp added to it later (axis.x.motor-pos-fb) I need a pin that is after the screw comp, but before the gui.

    The reason I need this is so when I disable the motors and manually wheel the table around, EMC can keep track of whats going on.

    Brian


  • #6
    Registered
    Join Date
    Mar 2004
    Location
    St. Louis, MO
    Posts
    332
    Downloads
    0
    Uploads
    0
    Quote Originally Posted by EFI-Unlimited View Post
    I must not be explaining the issue clearly.

    I am not concerned with how to close the loop with a PID controller.

    The only place I can connect the encoder data to in EMC has the screw comp added to it later (axis.x.motor-pos-fb) I need a pin that is after the screw comp, but before the gui.

    The reason I need this is so when I disable the motors and manually wheel the table around, EMC can keep track of whats going on.

    Brian
    OK, so what you seem to be wanting is to run open-loop stepper drives, but have the position feedback going to the Axis display. This seems to be how the lost position sensing works on Mach3, but is very counter to how EMC is set up. I seriously doubt you can do this without major code changes.

    All I know is how it is done in a servo system where EMC is part of the servo loop. I don't use screw error compensation on my system, but the kinematics IS handling it, if I were to provide a comp table. And, on both of my machines, it definitely is able to follow machine position when I hit E-stop and manually move the machine. If I generated and entered the comp tables, it would automatically be conpensating for screw errors, too. I THINK that the on-screen display would show the corrected position, but as I have not used this function, I can't absolutely verify that.
    Maybe you had better run this question by the EMC developers to check that it works that way.

    Jon


  • #7
    Registered
    Join Date
    Mar 2007
    Location
    USA
    Posts
    31
    Downloads
    0
    Uploads
    0
    Jon,

    I have tested it, and it does work the way you propose. I connected the scales to the motor position feedback, and with motors disabled, axis would follow the table around. Because of the backlash (acme screws) and the wear in the center of the x screw, I really need to use the screw comp, and this is at odds with the fore mentioned method.

    I am sure it will take a code change, but I don't think it would be a major one. I was kinda hoping to catch the eye of one of the developers, and maybe see if it could get worked in. I would dig into the code, and contribute the change myself, but I don't have time to familiarize myself with the source and make the patch. Especially when I know there are guys that are already familiar with it, and I suspect could implement it fairly easily. The way the axis component is already structured, I am kinda surprised this hasn't already been done.

    Is there a better way to bring this to a developers attention?

    Brian


  • #8
    Registered
    Join Date
    Mar 2004
    Location
    St. Louis, MO
    Posts
    332
    Downloads
    0
    Uploads
    0
    Quote Originally Posted by EFI-Unlimited View Post
    Jon,


    Is there a better way to bring this to a developers attention?

    Brian
    Yes, of course. There is the EMC Developer's list on SourceForge
    emc-developers@lists.sourceforge.net


    The info on joining is in the linuxcnc.org home page, but here's the subscribe page
    for the developer's list :
    https://lists.sourceforge.net/lists/...emc-developers

    The other problem is that backlash compensation doesn't actually work. For commanding positioning-only control
    from G-code, it can be done. For sensing position from shaft angle measurement, it kinda-sorta works, but is far
    from ideal. For actual machining with interpolation, it just is awful, because the leadscrew is not in control of the table
    position. If the leadscrew cannot hold the table in position, the cutting tool can take control, causing the workpiece
    to JUMP toward the tool, with often spectacular results. So, if there is any way at all to reduce the backlash, such
    as cutting the Acme nuts and pushing them together, you really ought to do it.

    Jon
    Last edited by jmelson; 07-05-2010 at 12:38 AM. Reason: typo


  • Similar Threads

    1. DRO Scale Problem
      By ranchak in forum Benchtop Machines
      Replies: 4
      Last Post: 09-15-2008, 03:54 PM
    2. Need to make scale tire mold for 1/6 scale car
      By thuffner3 in forum Moldmaking
      Replies: 2
      Last Post: 04-29-2008, 01:57 AM
    3. scale feedback
      By camtd in forum Mach Software (ArtSoft software)
      Replies: 6
      Last Post: 09-03-2007, 06:51 PM
    4. G320 receiving feedback from linear scale
      By Paraprop in forum Gecko Drives
      Replies: 3
      Last Post: 04-14-2007, 12:54 AM
    5. scale
      By craig in forum Mastercam
      Replies: 4
      Last Post: 03-09-2007, 09:10 AM

    Posting Permissions


     


    About CNCzone.com

      We are the largest and most active discussion forum from DIY CNC Machines to the Cad/Cam software to run them. The site is 100% free to join and use, so join today!

    Follow us on

    Facebook Dribbble RSS Feed


    Search Engine Friendly URLs by vBSEO ©2011, Crawlability, Inc.