the holy grail...

More
31 Dec 2021 16:25 #230397 by Padstar
the holy grail... was created by Padstar
short story

i want to install linuxcnc and ethercat and do some testing.... where do i go for a set of working instructions?


the long story..... 
So the holidays have been a nice relxing time.. but to keep me busy whilst at home i started working on a little project I've had kicking about for the past XX years... 

and i've got pc's i've got ethercat servos... i know a bit about plc's i know about computers... i've got my propeller hat on ... and off we go

so i started with the linuxcnc image... installed that... and it works... splendid... 

i found a forum post on installing ethercat...

forum.linuxcnc.org/ethercat/44508-ethercat-installation-summary

and i followed that... i hit a few bumps in the road.. missing applicaitons.. odd bits that didnt work... (this was over a period of about 3 days.. )  then i got to the part where i put some mac address details in a file and that then ended upwith the machine getting cut off the network and all bets were off.....

so then i did a fresh install of debian.. thinking i could add the linuxcnc repo to the synaptics and install that... (which i'd done in the other install instructions... ) but that didnt seem to work... 

then i tried the linixcnc distro again ... and went down another rabbit hole... (it was a script i downloaded from somewhere... )

and i've just had a 2nd bash at the fresh debian install but after maybe 80 hours.... i'm very close to giving up... 

i feel like i'm missing something... but i've just run out of time to just keep trying.. does anyone know a distro or some script thats got good results if you start from a known point... 

thanks in advance... 

Pb.. 
 

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

More
31 Dec 2021 17:08 #230401 by tommylight

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

More
31 Dec 2021 18:02 - 31 Dec 2021 18:05 #230404 by Padstar
Replied by Padstar on topic the holy grail...
now in my defence... i had seen this... but was weary as it looked to be out of date...

after posting.. i've burnt it onto a usb and just finished installing... so I'm just playing as we speak....

and i can confirm... i did the install.. ran the scrip on the desktop and I'm able to see the slaves on the ethercat bus... so this is a whoop whoop moment...

thanks to everyone for keeping this project developing ... well done...

I'm going to start trying to get my savch drive spinning.. as that's definitely gonna be the next challenge

pb
Last edit: 31 Dec 2021 18:05 by Padstar.
The following user(s) said Thank You: tommylight

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

More
04 Jan 2022 18:09 #230785 by Padstar
Replied by Padstar on topic the holy grail...
so an update from me... how am I getting on? ... good question...

so ... baby steps... i've been working my way through the Hal's ini's and xml's and using the power of cut and paste... i've got something that loads...

as I say baby steps... I'm sure that you can debug the Hal using the tools, but for me, I just did it, the old-school way of edit, try it... edit it.. try it.. edit it...

and in-truth using that method it helped me figure out a bit more about how to make mods and tweak what's needed

so at this moment in time.. i've got the beckhof IO and i've managed to turn some light on, and off... (using the hal configuration tool. and setting things to true and false... )
and i've managed to load the CIA402 driver bit.. and that's doing it's stuff
like it does...

the next step is to work out how to put the drive into operation, and I'd like to see some values chance when I spin the shaft.. ( which ethercat drives do all the time in my experience.. ) but that is still yet to happen...

anyway... just wanted to show I'm making some progress......

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

More
06 Feb 2022 19:35 #234159 by Padstar
Replied by Padstar on topic the holy grail...
Good day everyone..

so i'm back on it.. and i'm finding that i take one step forward.. and then 2 back... but for the life of me, i've no idea what i need to do now

I'm starting to think that what I'm looking 2 do is actually a lot harder than it looks.. and using CIA402 ethercat drives is a bit like a ghost.. lots of people say they have seen one... but really nobody is that sure...

I'm sorry to ramble... its helps me compose my thoughts.

OK.. so what I have currently is some Backhoff ethercat IO.. and that was working... (whoop whoop.. ) well i was able to toggle one of the outputs on and off using the Hal tools...

but the problem is the Servos... I'd be hoping that with the ethercat address and the config in xml file I'd be able to so things like see the drive come online and energize the motor.. but i dont seem to be able to figure out how to do that.. and i've never been even close to getting anything to "jog" and get any spinning happening.. :-(

if anyone has some good ideas on how i should tackle a task like this.. please let me know..

Pb.

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

More
06 Feb 2022 20:01 - 06 Feb 2022 20:08 #234165 by arvidb
Replied by arvidb on topic the holy grail...
It is pretty hard actually: lots of little details that if just one of them is wrong, it just "doesn't work". It can be done though! :) My only tip is to keep at it, check all the details (xml config, things like vid and pid, dcConf and watchdog settings - it all needs to be set up correctly).

Once you are able to see the slaves on the bus using the 'ethercat slaves' command (i.e. before even messing with the linuxcnc xml bus config), you can raise your mood a bit by reading the motor position manually. Without linuxcnc running, something like:
$ ethercat upload -p 0 -t int32 0x6064 0x0
should give you a readout of the encoder count from the drive (at bus index 0 in this example). Turn the motor a little by hand, redo the command and watch it change. :)

Next step is to get the xml config in good enough state that linuxcnc and lcec loads correctly, and to hook up the correct hal signals. Now you will see the position readout live from within linuxcnc!

The next hurdle is to get the drive to turn on and respond to joint jogs. This was actually almost effortless for me thanks to db1981's cia402 hal component.

Then tuning...

Yeah, it's a long road - but a fun one, hopefully!
Last edit: 06 Feb 2022 20:08 by arvidb.

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

More
07 Feb 2022 10:58 - 07 Feb 2022 10:59 #234234 by rodw
Replied by rodw on topic the holy grail...
Well, you are trying to follow my instructions but I can't really add much to what avidb has said. He knows far more than me.
If you can see your Beckhoff IO, your drives should be there too. Just make sure the product id (PID) and Vendor ID (VID) are copied to your xml file from ethercat slaves -v
Set your config to home immediate and have conservative velocity and accel settings in your ini 
set kinstype=both so you can jog joints before homing.
set up for immediate homing.
Do NOT use Debian 11
Set your SDO stuff up if the defaults must be changed. Try and change as little as possible. remember the hi byte/lo byte order must be followed. use a online calculator to convert decimal to hex.
Move your motors by hand an see if the DROs move.

Good luck!
Last edit: 07 Feb 2022 10:59 by rodw.

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

More
10 Feb 2022 18:17 - 10 Feb 2022 18:18 #234501 by Padstar
Replied by Padstar on topic the holy grail...
thanks guys for all the help...

i have a couple of questions...

A) if I'm just trying to make a simple 1 axis test environment (as i only have one servo actually on the bench) how should configure that? or can i have a pair of dummy axis and 1 real one..
2) what can and cant i use from the stepconf wizard config... as I'm finding that editing and removing sections is not helping me understand,
iii) I've seen someone using a USB game control as an MPG... but I'm a million years away from understanding how that would be part of my configuration... is where someone who can actually do me a setup ... in exchange for money maybe.. )

thanks

Pb..
Last edit: 10 Feb 2022 18:18 by Padstar. Reason: spelling.. 1/10

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

More
11 Feb 2022 00:07 #234543 by arvidb
Replied by arvidb on topic the holy grail...
I'm doing the same thing - using a single axis only for setup & testing. The two axes you aren't using just needs a single line each in your hal file:
#*******************
#  AXIS Y JOINT 1
#*******************

net y-pos-cmd    joint.1.motor-pos-cmd => joint.1.motor-pos-fb


#*******************
#  AXIS Z JOINT 2
#*******************

net z-pos-cmd    joint.2.motor-pos-cmd => joint.2.motor-pos-fb

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

More
11 Feb 2022 00:26 #234544 by arvidb
Replied by arvidb on topic the holy grail...
When it comes to using the stepconf wizard, I'm not sure how useful that is at all with an EtherCAT setup.

Here's a very basic hal file for a single EtherCAT drive. You'll have to change the name of your-lcec-config-file.xml obviously. Homing is setup for combined home and negative limit switch here which does not work as it should with my drives, it seems. And you probably don't even have the pins n-ot and p-ot unless you've set them up in the lcec xml file, so those lines might have to be commented out for the config to load.
loadrt [KINS]KINEMATICS
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS

loadusr -W lcec_conf your-lcec-config-file.xml
loadrt lcec
loadrt cia402 count=3

addf lcec.read-all              servo-thread
addf cia402.0.read-all          servo-thread
addf cia402.1.read-all          servo-thread
addf cia402.2.read-all          servo-thread

addf motion-command-handler     servo-thread
addf motion-controller          servo-thread

addf cia402.0.write-all         servo-thread
addf cia402.1.write-all         servo-thread
addf cia402.2.write-all         servo-thread
addf lcec.write-all             servo-thread


#*******************
#  AXIS X JOINT 0
#*******************

setp                            cia402.0.pos-scale [JOINT_0]ENCODER_SCALE

# From servo (ethercat) to cia402
net x-statusword                lcec.0.j0.cia-statusword  => cia402.0.statusword
net x-opmode-display            lcec.0.j0.opmode-display  => cia402.0.opmode-display
net x-drv-act-pos               lcec.0.j0.actual-position => cia402.0.drv-actual-position

# From cia402 to servo (ethercat)
net x-controlword               cia402.0.controlword         => lcec.0.j0.cia-controlword
net x-modes-of-operation        cia402.0.opmode              => lcec.0.j0.opmode
net x-drv-target-pos            cia402.0.drv-target-position => lcec.0.j0.target-position

# From motion to cia
net x-enable                    joint.0.amp-enable-out => cia402.0.enable
net x-amp-fault                 joint.0.amp-fault-in   <= cia402.0.drv-fault
net x-pos-cmd                   joint.0.motor-pos-cmd  => cia402.0.pos-cmd
net x-pos-fb                    joint.0.motor-pos-fb   <= cia402.0.pos-fb

# Homing
net x-neg-limit                 lcec.0.j0.n-ot => joint.0.neg-lim-sw-in joint.0.home-sw-in
net x-pos-limit                 lcec.0.j0.p-ot => joint.0.pos-lim-sw-in

Note that I've named my EtherCAT drive "j0" here rather than letting it get its name from its bus number. This is done in the lcec xml file using the name parameter:
<slave idx="n" type="generic" vid="xxx" pid="yyy" name="j0" configPdos="true">

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

Time to create page: 0.125 seconds
Powered by Kunena Forum