EtherCAT driver for a 6 axis robot

More
10 May 2022 15:00 #242495 by TheRoslyak
There is no discussion about the fact that you are going to jump on the robot.
The fact is that linuxcnc does not have ready-made tools for controlling your robot.
As I said you can use linuxcnc as a debugger. But anyway, you will have to program your own widgets that will use mux, dmux and etc.
The new firmware will not allow you to control an individual joint. More features will be added s-curve acceleration and deceleration or etc.
You don't said - you already installed etherlab master and lcec? - This will have to be done anyway.

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

More
10 May 2022 15:14 - 10 May 2022 15:20 #242496 by ftree
I am fully aware that "linuxcnc does not have ready-made tools" for my particular robot. I specifically said I wanted to "develop a LinuxCNC driver for an EtherCAT 6 axis robot - the Meca500" and asked for a starting point.  rodw seemed to grasp straight away what I was asking and provided some great advice.

I'm here to develop and contribute. I have already installed etherlab master and lcec.

"The new firmware will not allow you to control an individual joint" - are you a Mecademic employee or have one of these little chaps?
Last edit: 10 May 2022 15:20 by ftree.

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

More
10 May 2022 15:26 #242497 by TheRoslyak
Fine.
Now, if I were you, I would create an xml file that linuxcnc can display. - I think it's definitely needed
Attachments:

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

More
10 May 2022 15:39 - 10 May 2022 15:42 #242499 by ftree
Some of the steps / guides here are proving informative

sticky in this section
forum.linuxcnc.org/ethercat/45336-etherc...-step-by-step#237098

And also
gist.github.com/Bouni/8b4532d0bdf012bd83c65d3eb62f8aa2
Last edit: 10 May 2022 15:42 by ftree.

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

More
10 May 2022 16:34 #242501 by db1981
hmm, what for this case is needed is an direct cyclic control of the joint motor amps, like cyclic synchronus position or velocity mode. without an inserted controller from the robots motion system.

The joint indexs that TheRoslyak marked in his picture are only feedback information from the robot to ethercat. controlling at this firmware is reached through the motion command block with the underlaying motion que. And this sadly is not rt controllable....

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

More
10 May 2022 17:03 - 10 May 2022 17:04 #242505 by ftree
EtherCAT interface appears to support MotionCommandID with six arguments (for each joint?). Here are two - many others available. See table 7 in programming manual. "List of MotionCommandID numbers"
ID=6 MoveJoints 6 arguments in degrees
ID=23 MoveJointsVel 6 arguments in degrees / sec
Last edit: 10 May 2022 17:04 by ftree.

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

More
10 May 2022 17:04 #242506 by TheRoslyak
And I did not say that these registers are needed for control.
For control need move command (for example 1 - is line 2 - arc 3 - spline and etc)
And sub index ( is x ,y, z ,etc)
In any case, if you do it through linuxcnc, Need combinations of mux, dmux and etc
Attachments:

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

More
10 May 2022 18:11 - 10 May 2022 18:15 #242510 by ftree
The only "cyclic" modes (velocity mode) are

MoveJointsVel
MoveLinearVelWrf
MoveLinearVelTrf

These can be sent evey cycle with MoveID=0, SetPoint = 1. To stop the robot send SetPoint=0

Would a velocity mode with position feedback from each joints encoder be such a bad thing? Robot timestamp,  World Reference,  Tool Reference and Robot Base Reference are available data on the TxPDOs in various data forms.
Last edit: 10 May 2022 18:15 by ftree.

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

More
10 May 2022 18:26 - 10 May 2022 18:28 #242513 by ftree
An excerpt from the EtherCAT xml. 

              
<RxPdo Fixed="true" Mandatory="true" Sm="2">
                    <Index>#x1600</Index>
                    <Name>Robot Control</Name>
                    <Entry>
                        <Index>#x7200</Index>
                        <SubIndex>1</SubIndex>
                        <BitLen>1</BitLen>
                        <Name>Deactivate</Name>
                        <DataType>BOOL</DataType>
                    </Entry>
                    <Entry>
                        <Index>#x7200</Index>
                        <SubIndex>2</SubIndex>
                        <BitLen>1</BitLen>
                        <Name>Activate</Name>
                        <DataType>BOOL</DataType>
                    </Entry>
                    <Entry>
                        <Index>#x7200</Index>
                        <SubIndex>3</SubIndex>
                        <BitLen>1</BitLen>
                        <Name>Home</Name>
                        <DataType>BOOL</DataType>
                    </Entry>
                    <Entry>
                        <Index>#x7200</Index>
                        <SubIndex>4</SubIndex>
                        <BitLen>1</BitLen>
                        <Name>Reset Error</Name>
                        <DataType>BOOL</DataType>
                    </Entry>
                    <Entry>
                        <Index>#x7200</Index>
                        <SubIndex>5</SubIndex>
                        <BitLen>1</BitLen>
                        <Name>Sim Mode</Name>
                        <DataType>BOOL</DataType>
                    </Entry>
                    <Entry>
                        <Index>#x7200</Index>
                        <SubIndex>6</SubIndex>
                        <BitLen>1</BitLen>
                        <Name>Recovery Mode</Name>
                        <DataType>BOOL</DataType>
                    </Entry>
                    <Entry>
                        <Index>#x0</Index>
                        <SubIndex>0</SubIndex>
                        <BitLen>26</BitLen>
                    </Entry>
                </RxPdo>

I am looking at the single bit pdo settings.  The above appears to be padded by 26 bits.  What is best practice for the above?  Something like this?

<syncManager idx="2" dir="out" />
      <pdo idx="1600">
    <pdoEntry idx="7200" subIdx="00" bitLen="32" halType="Complex">
        <complexEntry bitLen="1" halPin="robot.ctrl.deactivate" halType="bit" />
        <complexEntry bitLen="1" halPin="robot.ctrl.activate" halType="bit" />
        <complexEntry bitLen="1" halPin="robot.ctrl.home" halType="bit" />
        <complexEntry bitLen="1" halPin="robot.ctrl.reset-errror" halType="bit" />
        <complexEntry bitLen="1" halPin="robot.ctrl.sim-mode" halType="bit" />
        <complexEntry bitLen="1" halPin="robot.ctrl.recovery-mode" halType="bit" />
         <complexEntry bitLen="26" />
   </pdoEntry>
Last edit: 10 May 2022 18:28 by ftree.

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

More
10 May 2022 19:28 #242515 by TheRoslyak
<pdoEntry idx="7200" subIdx="01" bitLen="1" halPin="robot.ctrl.deactivate" halType="bit" />
<pdoEntry idx="7200" subIdx="02" bitLen="1" halPin="robot.ctrl.activate" halType="bit" />
....
<pdoEntry idx="7200" subIdx="05" bitLen="1" halPin="robot.ctrl.recovery-mode" halType="bit" />
 

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

Time to create page: 0.152 seconds
Powered by Kunena Forum