EtherCAT driver for a 6 axis robot

More
19 May 2022 16:41 #243350 by ftree
Well it compiles now! Yey.

Some dots to connect now....

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

More
25 May 2022 21:04 - 25 May 2022 21:37 #243841 by ftree
github.com/djsftree/linuxcnc-ethercat/bl...r/src/lcec_meca500.c

Not quite sure how to handle
1). the setting of bits on the slave during init() - active / home
2). the reading and writing of REAL to and from the slave
Last edit: 25 May 2022 21:37 by ftree.

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

More
27 May 2022 18:48 - 27 May 2022 18:57 #244016 by ftree
Given up on the C version and reverting back to manual xml.

The Meca500 encoder is REAL format.

Using halType float does not return the correct value even if scaled.

However, if i set the ethercat pdo data as halType u32 ....

24 u32 OUT 0xC28A5415 lcec.0.encX.encoder.a1.raw
24 u32 OUT 0xC0B478C3 lcec.0.encY.encoder.a2.raw
24 u32 OUT 0x411BFEF1 lcec.0.encZ.encoder.a3.raw
24 u32 OUT 0xC2B59246 lcec.0.encA.encoder.a4.raw
24 u32 OUT 0xC2B11573 lcec.0.encB.encoder.a5.raw
24 u32 OUT 0xC1F06666 lcec.0.encC.encoder.a6.raw

If I use an online hex to float converter the values looks right

gregstoll.com/~gregstoll/floattohex/

Ie 0xC2B range is about -90 degrees, 0x42B about +90 - that aligns with the physical device.

Is there a conv for hex to float? Or a better way to read whatever REAL format Meca500 uses to float? [/code][/code]
Last edit: 27 May 2022 18:57 by ftree.

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

More
28 May 2022 19:21 #244072 by ftree
How do you decide what PDO INITs need bit position arguments?

If i uncomment L140 linux cnc fails to start. The PDO address and offset seem ok. I'm stumped!

github.com/djsftree/linuxcnc-ethercat/bl.../lcec_meca500.c#L140

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

More
29 May 2022 14:51 - 29 May 2022 14:53 #244129 by ftree
ok, after looking at dmesg it seems etherlabs doesn't like "gaps" with 0x000 x00
[ 6938.151342] EtherCAT ERROR 0-0: SDO upload 0x0000:00 aborted.
[ 6938.151357] EtherCAT ERROR 0-0: SDO abort message 0x06020000: "This object does not exist in the object directory".
[ 6938.151362] EtherCAT ERROR 0-0: Failed to read number of mapped PDO entries.
[ 6938.151365] EtherCAT ERROR 0-0: Failed to read mapped PDO entries for PDO 0x0000.
[ 6938.156310] EtherCAT ERROR 0-0: SDO upload 0x0000:00 aborted.
[ 6938.156325] EtherCAT ERROR 0-0: SDO abort message 0x06020000: "This object does not exist in the object directory".
[ 6938.156331] EtherCAT ERROR 0-0: Failed to read number of mapped PDO entries.
[ 6938.156334] EtherCAT ERROR 0-0: Failed to read mapped PDO entries for PDO 0x0000.
 
Last edit: 29 May 2022 14:53 by ftree.

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

More
19 Jul 2022 12:07 #247760 by ftree
Hi!

I am a little over my head setting up LinuxCNC with the Meca500 robot.  I am looking for paid help as I am at impasse.

Is there anyone on here able to look at my LinuxCNC ini and hal files for a fee?

Here are my LinuxCNC project files

github.com/djsftree/linuxcnc-ethercat/tree/master/wip-meca500

I am struggling with the pid feedback, estop setup, axes setup, following errors when attempting to jog.

The only thing that appears to work so far are the six encoders correctly reporting the joint angles. 

Image attached.

Some barriers to my thought and progress.

1).  When coming out of estop and to activate the robot I need to send the following sequence with a few 10ms pause between each.  How do I so that and where in a HAL LinuxCNC friendly way?  I can do this manually using the "HAL Configuration" buttons.

lcec.0.Meca500.ctrl.deactivate 1
lcec.0.Meca500.ctrl.activate 1
lcec.0.Meca500.ctrl.home 1

The robot activation can be check with
lcec.0.Meca500.status.activated

all joints of the machine are then homed by the robot firmware - status check by
lcec.0.Meca500.status.homed

If anyone can help I would be much appreciated.  Like I said, I'm happy to pay for your time if you think you can help.
Attachments:

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

More
19 Jul 2022 14:58 #247768 by db1981
-i would prefer to write a small c component for the initializing sequence, with an managed passthrough of the joints amp-enable-out and error pins...

-did you survive to get proper motion without pid, are the scaling correct ?

-does this descripe that everytime estop is raised, the robot lost its homing? does the robot send continous encoder values during its "own" homing sequence? this would raise a lot of following errors.
The following user(s) said Thank You: tommylight, rodw, ftree

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

More
19 Jul 2022 15:41 #247771 by ftree
Hi!

So, without any PID and just using the motion controller outputs

joint.0.vel-cmd => lcec.0.Meca500.vel-cmd.a1
joint.0.motor-pos-fb  <= lcec.0.Meca500.encoder.a1

I was able to jog each axis ok (with following error after a few seconds).

At power-up, the Meca500 knows the approximate angle of each of its joints, with a couple of degrees of uncertainty. To find the exact joint angles with high accuracy, each motor must make one full revolution. This motion is the essential part of a procedure called homing. During homing, all joints rotate simultaneously. Each of joints 1, 2 and 3 rotates 3.6∘, joints 4 and 5 rotate 7.2∘ each, and joint 6 rotates 12∘. Then, all joints rotate back to their initial angles. The whole sequence lasts a few seconds.


Initially (at application startup) clear both the MoveID and SetPoint fields.
setp lcec.0.Meca500.motion.move-id      0
setp lcec.0.Meca500.motion.set-point     0

To start moving the robot
setp lcec.0.Meca500.vel-command        21
setp lcec.0.Meca500.motion.set-point     1
setp lcec.0.Meca500.motion.move-id      0
lcec.0.Meca500.vel-cmd.a1 thru a6 (degree/sec as REAL float)

To stop the robot, you must reset
setp lcec.0.Meca500.motion.set-point     0

absolute encoder positions (degree as REAL float) are read from
lcec.0.Meca500.encoder.a1 thru a6

joint velocities (degree/sec as REAL float) can be read from
lcec.0.Meca500.velocity.a1 thru a6

REAL floats was made possible by this commit
github.com/sittner/linuxcnc-ethercat/pull/114

 

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

More
20 Jul 2022 09:14 - 20 Jul 2022 09:14 #247825 by ftree

does the robot send continous encoder values during its "own" homing sequence? this would raise a lot of following errors.

Just checked, yes it does.
Last edit: 20 Jul 2022 09:14 by ftree.

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

More
20 Jul 2022 09:54 - 20 Jul 2022 10:38 #247828 by ftree

-i would prefer to write a small c component for the initializing sequence


What would the C look like for setting the following at application startup?
lcec.0.Meca500.ctrl.deactivate         0
lcec.0.Meca500.ctrl.activate           0
lcec.0.Meca500.ctrl.home               0
lcec.0.Meca500.ctrl.reset-errror       0
lcec.0.Meca500.motion.move-id          0
lcec.0.Meca500.motion.set-point        0

At what stage would you then "activate" , "robot home" and check for a sucessful home? Insert this routine to the power on button in the UI?
lcec.0.Meca500.ctrl.activate                  1
wait 1 seconds
check that lcec.0.Meca500.status.activated =  1
lcec.0.Meca500.ctrl.home                      1
wait 4 seconds
check for lcec.0.Meca500.status.homed =       1

with an managed passthrough of the joints amp-enable-out and error pins...

Last edit: 20 Jul 2022 10:38 by ftree.

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

Time to create page: 0.432 seconds
Powered by Kunena Forum