Building ProtoBuf data structure for command: MT_EMC_AXIS_SET_HOMING_PARAMS

28 views
Skip to first unread message

Klemen Zhivko

unread,
Aug 22, 2019, 1:59:13 AM8/22/19
to Machinekit
Maybe somebody knows how to prepare data packet for homing parameters or direct me to documentation how to use it.
I believe ContainerType is: MT_EMC_AXIS_SET_HOMING_PARAMS

But I am not sure how to build the command with all parameters (copied from .ini):

HOME =                  0.000
HOME_OFFSET =           250
HOME_IGNORE_LIMITS =    YES
HOME_USE_INDEX =        NO
HOME_SEQUENCE =         0
HOME_IS_SHARED = YES

Especially I am interested in HOME_OFFSET.

Probably there is a way how to set variable for homing parameters like "HOME_OFFSET" and value of this parameter. Is there any client using MT_EMC_AXIS_SET_HOMING_PARAMS so I could see how to use it?

PS: for homing I have following JAVA code in place (and it works):

            pb.Message.Container.Builder builder = Container.newBuilder();
            pb.Status.EmcCommandParameters emcCommandParameter = pb.Status.EmcCommandParameters.newBuilder().setIndex(axes[i])
                    .build();
            builder.setType(ContainerType.MT_EMC_AXIS_HOME);
            builder.setEmcCommandParams(emcCommandParameter);
            builder.setTicket(getNextTicket());
            Container container = builder.build();
            socket.send(container.toByteArray(),0);
            try {
                parseAndOutput(2);
            } catch (InvalidProtocolBufferException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

justin White

unread,
Aug 22, 2019, 12:56:20 PM8/22/19
to Machinekit
Can't help ya with sending messages since it's not my forte but any particular reason  why you don't just change the values in the .ini directly? Not sure how you're setup but Even if you had to SSH into the controller it seems that it would be easier since this is a pretty much done deal one it's setup.

justin White

unread,
Aug 22, 2019, 8:30:21 PM8/22/19
to Machinekit
Back to the boards with it....

I solved it by connecting signal to my component...
Similary I added home switch for Z axis (axis 2).
What bothers me now is fact that homing both axes at same time somehow doesn't work - axis2 homes OK, but axis0 doesn't move at all, and when I press home again it says that axis 0 is homing:
"
22:41:51 MT_EMC_OPERATOR_ERROR 
22:41:51 homing already in progress
"

Shared ini and config at my github repository as previous.

I'd assume that's because you're probably not recieving all the messages through protobuf. I'm not too familiar with Machinekit but I know from my current project that messages are relayed, but not as complete as a standard LinuxCNC install.

It's probably because according to your hal file on github, your home_offset is equal to your max limit. HOME in your .ini file is the position your axis will move to after homing it sounds like this is what you are trying to achieve with home offset. HOME_OFFSET is not well explained in the docs and I almost feel that it is explained falsely. All of my machines I have this set at 0.25" to 0.5" or 6-12mm either positive or negative depending on the homing direction. In practice it seems that this is the distance from the home switch that becomes your MIN or MAX_LIMIT depending on the direction you're homing. If your home switch is in the middle of the axis and you home to it, your MIN/MAX_LIMIT is however far away from your home switch you set HOME_OFFSET to. You are homing to a limit switch, not a remotely mounted home switch so the offset from the limit switch to your MAX_LIMIT is going to be very small.

If what you want to do is drop the axis off in a certain spot after homing then do what you need to do to get homing to complete, then jog to that spot on the axis and record it's current position. Enter that in the .ini as HOME. The Relative "0" that you use to coordinate with the workpiece will be set while you're touching off so if you're trying to set it up so zero is in the middle of the axis it's not really what you want to do in my experience.  
Reply all
Reply to author
Forward
0 new messages