Rookie: Ethercat Servos wont budge...

More
11 Mar 2021 16:11 #201828 by thomaseg
Hi,

I'm completely new to LinuxCNC, so bear with me...

I have EtherCAT servodrives which uses DS402 and some beckhoff modules. I have everything working kinda: i can turn on/off the output modules and read input. I can read the position and state of the servo-drives. I can also turn on the servo-drive(=the drive "locks" the servoshaft)....but i cannot make it move, not even a bit....inside linuxcnc i enable the machine and tries to jog X-axis and nothing... i can see it says "velocity 17" or something similar on the screen when i job, but the servo does not move...

The setup is pretty basic. I've only got one axis for testing and i've tried a couple of things which seems to work for others. But nothing at all.... and it makes me wonder if i'm missing something basic in order to move the motor...?

I've just taken the basic axis-demo and modified the .hal and .ini to suite what i have, so nothing fancy. The ethercat_conf.xml matches DS402 and the manufacturers manual. All attached here...

Any pointers/help for a beginner like me would really help! Thanks!

/Thomas
Attachments:

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

More
11 Mar 2021 17:03 #201831 by db1981
Hello,

first read on this page the message about execution order

forum.linuxcnc.org/24-hal-components/223...al-driver?start=1140

your hal file makes no sence in the actual state, reading from bus and directly written again, without any action. you have to think like an plc programmer.


after this read in the Cia402 specification about the modes of operation. Currently you have set your drive to profile position mode (1) this is nice for stand alone use (you can set speed, accel, deccel, jerk, and target position in the drive parameters, then trigger the bit "new target setpoint" [X-cmd-ModeSpecific4] and the drives moves to the target controlled by his own motion planner and tells you if targes is reached.
For CNC application you would need to use cyclic position or velocity mode.

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

More
11 Mar 2021 18:52 #201850 by thomaseg

first read on this page the message about execution order forum.linuxcnc.org/24-hal-components/223...al-driver?start=1140
your hal file makes no sence in the actual state, reading from bus and directly written again, without any action. you have to think like an plc programmer.

Really appreciate your input! :-)

Umm, yeah, makes sense, i just saw some people doing it like this and it worked to get the Beckhoff modules in OP-state, so i thought it was the way to do it... the problem, for me, is that i don't know how an PLC programmer thinks :-D The learning curve is kinda steep on this stuff...

after this read in the Cia402 specification about the modes of operation. Currently you have set your drive to profile position mode (1) this is nice for stand alone use (you can set speed, accel, deccel, jerk, and target position in the drive parameters, then trigger the bit "new target setpoint" [X-cmd-ModeSpecific4] and the drives moves to the target controlled by his own motion planner and tells you if targes is reached. For CNC application you would need to use cyclic position or velocity mode.

ah, yes, makes sense! I cannot find the real CIA402 specification, it seems like you have to be a paying member of some sort to be able to download it. I tried signing up with no real luck:-( I can piece some of it together from different driver vendors manuals...but it is not the "pure standard"...anywhere one can download it?

After reading up on the modes, i see that the cyclic position mode properly is the one i should use. I've changed it and moved the lcec.0.write to the end of the HAL file...but the result is exactly the same... I'm trying to imaging what a PLC-programmer would do, but honestly, i haven't got a clue :-)
Attachments:

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

More
11 Mar 2021 19:12 #201852 by db1981
execution order:

move the line "addf lcec.0.read servo-thread"
above the both lines:
addf motion-command-handler servo-thread
addf motion-controller servo-thread

because you want that motion works with the values you have read from ethercat.

Realtime/PLC means that we have on loop which is worked from top to bottom once every cycle period. (this only is for the addf lines, they call the modules in the order you have written them in the hal file)

Servo not working:

check with halshow, if there is realy output on your "lcec.0.4.X-cmd-TargetPosition" pin.
What is the value of the "X-status-ModeDisplay" pin? it should be 8.

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

More
11 Mar 2021 20:31 - 11 Mar 2021 20:32 #201854 by thomaseg

execution order:

move the line "addf lcec.0.read servo-thread"
above the both lines:
addf motion-command-handler servo-thread
addf motion-controller servo-thread

because you want that motion works with the values you have read from ethercat.

Realtime/PLC means that we have on loop which is worked from top to bottom once every cycle period. (this only is for the addf lines, they call the modules in the order you have written them in the hal file)

Ah! So the "addf"-lines adds stuff to the thread that will be running in a loop? and the nets are just wiring up inputs and outputs of the functions added to the threads, so their ordering doesn't matter....i think i'm starting to understand something here :-)

Servo not working:

check with halshow, if there is realy output on your "lcec.0.4.X-cmd-TargetPosition" pin.
What is the value of the "X-status-ModeDisplay" pin? it should be 8.

yes, the "lcec.0.4.X-cmd-TargetPosition" follows what i'd expect(changes when i jog) and the ModeDisplay is 8. In fact all the pins are what "i expect them to be", nothing seems strange. But the motor does not turn:-/ i can see that TargetPosition changes but ActualPosition stays the same(plus/minus minor fluctuations due to noise i think). Why the motor does not follow suit, i don't know. Could i be missing some sort of setup in the driver to tell it to follow? How does it determin how fast it should move to that target? Does it use the TargetSpeed or something else? (it does also change accordingly when i jog)

Thanks again for your time!

/Thomas
Last edit: 11 Mar 2021 20:32 by thomaseg.

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

More
11 Mar 2021 22:38 #201894 by db1981

Ah! So the "addf"-lines adds stuff to the thread that will be running in a loop? and the nets are just wiring up inputs and outputs of the functions added to the threads, so their ordering doesn't matter....i think i'm starting to understand something here


exact !!!

is X-status-OperationEnabled true?

Target speed is only used in cyclic velocity mode, in position mode speed is derivated from the target position.

Does the driver work without linuxcnc? Softlimits in the driver? motor max speed?
strange.
Are you shure you have the right scaling? Are the control loops in the drive tuned?

for testing you can set modes of operation manual to cyclic velocity mode, an set an target velocity manual. Maybe the position loop in the drive is not working.

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

More
13 Mar 2021 17:02 #202113 by db1981
may be this could help : forum.linuxcnc.org/24-hal-components/418...can-bus-ethercat-etc

but i guess that the problem is servo configuration related.

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

More
17 Mar 2021 19:05 - 17 Mar 2021 19:38 #202618 by thomaseg
Hi,

I tried to create a hal-file that would dump the values of the entire control and status word to maybe give an insight into what i'm doing wrong. Then i called everything manually without connecting anything to the motioncontroller, pure setp-commands... But walking through each value step by step doesn't reveal anything apparent to me:
imgur.com/a/RVh3IDB
...the followerror and actualposition is continuesly updated, and if i change something, e.g. ModeSelection then ModeDisplay follows suit...so communication works as it should...

Unless you guys can see anything odd, then my guess is that i need to change something in driver to make it work...except i have no idea what....ideas to what i could try to investigate from here?
Last edit: 17 Mar 2021 19:38 by thomaseg.

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

More
17 Mar 2021 21:25 #202648 by arvidb
Do your drivers have positive & negative overtravel inputs that needs to be pulled low to enable movement?

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

More
18 Mar 2021 01:23 #202694 by db1981
Do you have torque at the motorshaft, does it hold if you try turning?
I can't see something wrong, and all feedbacks from the drive are ok too.

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

Time to create page: 0.146 seconds
Powered by Kunena Forum