EtherCAT driver for a 6 axis robot

More
4 years 3 months ago #247768 by db1981
Replied by db1981 on topic EtherCAT driver for a 6 axis robot
-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
4 years 3 months ago #247771 by ftree
Replied by ftree on topic EtherCAT driver for a 6 axis robot
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
4 years 3 months ago - 4 years 3 months ago #247825 by ftree
Replied by ftree on topic EtherCAT driver for a 6 axis robot

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: 4 years 3 months ago by ftree.

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

More
4 years 3 months ago - 4 years 3 months ago #247828 by ftree
Replied by ftree on topic EtherCAT driver for a 6 axis robot

-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?
Code:
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?
Code:
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: 4 years 3 months ago by ftree.

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

More
4 years 3 months ago - 4 years 3 months ago #247830 by ftree
Replied by ftree on topic EtherCAT driver for a 6 axis robot
I believe I may need to look at "immediate homing" for the Meca500 if the robot provides its own homing mechanisms.  Thoughts?

Code:
SEARCH_VEL = 0 LATCH_VEL = 0 USE_INDEX = NO HOME_SEQUENCE = 0 #homing net a1-home-index <= joint.0.index-enable => lcec.0.Meca500.status.homed net a2-home-index <= joint.1.index-enable => lcec.0.Meca500.status.homed net a3-home-index <= joint.2.index-enable => lcec.0.Meca500.status.homed net a4-home-index <= joint.3.index-enable => lcec.0.Meca500.status.homed net a5-home-index <= joint.4.index-enable => lcec.0.Meca500.status.homed net a6-home-index <= joint.5.index-enable => lcec.0.Meca500.status.homed
Last edit: 4 years 3 months ago by ftree.

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

More
4 years 3 months ago #247837 by ftree
Replied by ftree on topic EtherCAT driver for a 6 axis robot
db1981 Are you suggesting a comp "glue" layer similar to
github.com/dbraun1981/hal-cia402/blob/main/cia402.comp

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

Time to create page: 0.349 seconds
Powered by Kunena Forum