Retrofitting Mikron WF41C: Distance coded homing success

More
16 May 2021 14:19 - 16 May 2021 14:21 #209094 by andypugh

I'm pretty indifferent regarding the distance-coded homing within the LinuxCNC homing routine or within a separate HAL-component. But modifying the Hostmot2 to allow for an index-signal trigger without resetting is basically three lines of code and in my mind simpler than doing the additional fake position math in the HAL-component.


Something, somewhere, has to calculate an absolute position from the index spacing. Putting that in the homing code will work fine, but limits the system to one specific version of scale encoding.
Doing it as a HAL component is more modular and flexible, I think. But that is only any good if it works.


HOME_ABSOLUTE_ENCODER can't be used here (with the existing code) as it prevents any axis motion, so no indexes will be found.

PS: ...the only way I could find so far to have an encoder reset during a move without the jerky stuff was by driving the servo directly with a constant voltage during homing. But I doubt that this is the way to go....


If the index-enable signal is fed to the homing code _and_ to the PID component then the system should basically ignore feedback for a thread cycle. This is specifically so that it does not respond to the step change in feedback.
Last edit: 16 May 2021 14:21 by andypugh.

Please Log in or Create an account to join the conversation.

More
16 May 2021 14:31 - 16 May 2021 14:33 #209096 by PCW

PS: ...the only way I could find so far to have an encoder reset during a move without the jerky stuff was by driving the servo directly with a constant voltage during homing. But I doubt that this is the way to go....


This suggest that the index_enable falling edge -->PID suspend FF1 calculation scheme is not working for some
reason. This normally works fine for velocity mode servos so your disable reset on index workaround is not required.
I have heard of this symptom occasionally but have not determined the exact cause.

That said, I think a better overall index system is to always latch the position on index and have LinuxCNC
use the latched position for its internal offsets and avoid steps in the joint position. This also has the advantage
of being able to use index for a position sanity check. The disadvantage of this method of index handling is
that some encoder counter hardware may only have the option to clear the count on index.
Last edit: 16 May 2021 14:33 by PCW.

Please Log in or Create an account to join the conversation.

More
16 May 2021 17:47 #209139 by cscegypt
Hi Marc,
Please inform me about the servo motor , encoder , and drives part or model numbers and its specifications if possible.
Best regards,
Heggy

Please Log in or Create an account to join the conversation.

More
28 May 2021 18:48 #210549 by mwinterm
Hello,

another update from our retrofit project...

Y-axis ballscrew issue:
I happened to find on ebay the exact ballscrew assembly for my machine in good condition at a price slightly below what I would have paid for the axial bearings only. So we bought that assembly and now have the machine back together. :)

Distance coded homing: After having the machine back operational we could continue to test distance coded homing and we know can reliably home the machine on all 3 axis! Basically it is just working now without any fuss at all :) :) :)
Currently the modifications I have done to the linuxcnc code are in the hm2 (extended to detect the index-position without resetting) and in the homing procedure itself where an option for distance coded homing was added. Besides a little bug we had to fix the code corresponds to what I posted in 209052 . The exact code can be found in my branch on GitHUB .
It actually took as a while to get it running on the Y-axis which proofed to be unrelated to the code. The problem simply was a cheap d-sub 9 female connector which sometimes didn't transmit the glasscale signal reliably.
Lesson learned: the glasscale signals are definitively delicate and all the shielding an high-quality connectors that come with the Heidenhain originals are there for a reason...
But in the process of debugging this issue the modification to hm2 became very handy as we could use it to check consistency and found that counts were lost sometimes between index-marks. So along the line what @PCW wrote in an earlier post I will keep the modification in the hm2 and implement an additional component for sanity check of the encoder signal.

PID tuning: After the initial quick success we had with the PID tuning process we realized that we are not done yet. While we really could bring the f-error down below 0.002mm with just tuning P, FF1 and FF2 as well as the current offset we found now that just adding some weight in the form of e.g. a vise is affecting our setup significantly. So some more work on PID tuning is need to give that machine a good performance over a wider operating envelop (actually I think the machine is specified for table loads up to 400kg).
I'm currently thinking about writing an optimization procedure in an external python script that would execute the same G-code reference program over and over again, accumulating the integral of the f-error as well as the max and then use some probably gradient based optimization algorithms from scipy to optimize the setup. Could this make sense? Did already someone do something like this?

Best regards,

Marc

Please Log in or Create an account to join the conversation.

More
30 May 2021 14:07 - 30 May 2021 21:06 #210677 by cscegypt
Hi Marc,
As you were thinking about writing python script that would execute g code....etc,
This repository contains a collection of Python scrips that generate simple G-Code for LinuxCNC.
github.com/LinuxCNC/simple-gcode-generators
All of these scripts, written by various authors, are licencing under the GNU General Public License.
You can either clone this repository using Git or download the whole repository as a zip file.

There are another links which i think that it will be useful to read before you begin:

linuxcnc.org/docs/2.6/html/remap/structu...:unallocated-g-codes
Python / GUI / QTpyVCP / GLADE
linuxcnc.org/docs/2.6/html/common/python-interface.html
qtpyvcp.kcjengr.com/
linuxcnc.org/docs/html/gui/gladevcp.html
Install GLADE 3.8 on debian 9 forum.linuxcnc.org/9-installing-linuxcnc...lade-linuxcnc#112162


Best regards,


Heggy
Last edit: 30 May 2021 21:06 by cscegypt.

Please Log in or Create an account to join the conversation.

More
30 May 2021 20:10 #210732 by andypugh

Distance coded homing: After having the machine back operational we could continue to test distance coded homing and we know can reliably home the machine on all 3 axis! Basically it is just working now without any fuss at all :) :) :)
Currently the modifications I have done to the linuxcnc code are in the hm2 (extended to detect the index-position without resetting) and in the homing procedure itself where an option for distance coded homing was added.


Would you be interested in testing a HAL-only solution to this, along the lines previously described?
Or, alternatively, do you know a source of a distance-coded scale that is cheap enough for me to buy without actually having any immediate use for it, just to look in to this?

Please Log in or Create an account to join the conversation.

More
01 Jun 2021 18:23 #210903 by mwinterm
Hello Andy,

sure I would be interested in testing.

Here in Europe you can find (typically Heidenhain) glasscales used starting at around 200Euro on e-bay. They are named something like LSXXXC (mine are LS403C). Important is the C at the end because only these have an index track for distance coded homing.
If you find one we would be happy to contribute one of our little interpolation boards for testing.

Best regards,

Marc

Please Log in or Create an account to join the conversation.

More
01 Jun 2021 18:26 - 01 Jun 2021 18:27 #210904 by mwinterm
Last edit: 01 Jun 2021 18:27 by mwinterm.

Please Log in or Create an account to join the conversation.

More
06 Jun 2021 22:07 #211361 by andypugh

Here in Europe you can find (typically Heidenhain) glasscales used starting at around 200Euro on e-bay. They are named something like LSXXXC (mine are LS403C). Important is the C at the end because only these have an index track for distance coded homing.


I will keep an eye out, but I am not seeing any today.

Please Log in or Create an account to join the conversation.

More
13 Jun 2021 05:47 - 13 Jun 2021 21:34 #211915 by cscegypt
HI Mark,
Good Day,
I just imported the same WF41C Mikron Machine from Europe. . I would like to use similar modified controller after you finish from designing.
Please inform me about the nice possibility of transferring similar system which you are doing / estimated cost and time /Quote.
Best regards.
Heggy
Last edit: 13 Jun 2021 21:34 by cscegypt.

Please Log in or Create an account to join the conversation.

Moderators: piasdom
Time to create page: 0.227 seconds
Powered by Kunena Forum