Ethercat HAL configuration for Beckhoff EL7041 without encoder

More
25 Nov 2017 17:54 - 25 Nov 2017 19:30 #102339 by Hawkeye
I am new to this forum and this is my first topic.
Yes, I checked the already existing topics and postings to this, and did not find an answer yet.

In the last months, I build and setup my own cnc router.
Due to continues improvement, I decided to move away from parallel port to beckhof.
All my common input/output signals went already over to beckhof ethercat connectors.
No, I try to move my axis engines over to EL7041 (without extension "-1000").
All seems to be working so far (HAL driver seems to be ok,...), but when I try to move the axis,
LinuxCnc stops with message "joint 2 following error".

Please note that I am using the Beckhoff EL7041 without an encoder.
My engines are still simple 4 connector (A+ A- B+ B-) engines.
I guess at the moment, that EL7041 is waiting for encoder signal, because when I start LinuxCnc machine,
I can see LEDs for RUN, ENCODER, DRIVER, POWER, ENABLE.
And when I try to move the engine, WARNING Led lights up, and ENABLE is getting dark.

My XML-File looks like this:
<masters>
  <master idx="0" appTimePeriod="1000000" refClockSyncCycles="1000">
	<!--                                    		-->
    <!-- EK1100 EtherCAT-Koppler (2A E-Bus) 		-->
    <slave idx="0" type="EK1100" name="D1"/> 
    <!--                                           	-->
    <!-- EL1084 4K. Dig. Eingang 24V, 3ms, negativ 	-->
    <slave idx="1" type="EL1084" name="D2"/>
    <!--                                   			-->
    <!-- EL2008 8K. Dig. Ausgang 24V, 0.5A 			-->
    <slave idx="2" type="EL1008" name="D3"/>
    <!--                                   			-->
    <!-- EL2008 8K. Dig. Ausgang 24V, 0.5A 			-->
    <slave idx="3" type="EL1008" name="D4"/>
    <!--                                  			-->
    <!-- EL1008 8K. Dig. Eingang 24V, 3ms 			-->
    <slave idx="4" type="EL2008" name="D5"/>
    <!--                                  			-->
    <!-- EL1008 8K. Dig. Eingang 24V, 3ms 			-->
    <slave idx="5" type="EL2008" name="D6"/>
    <!--                                  			-->
    <!-- EL1008 8K. Dig. Eingang 24V, 3ms 			-->
    <slave idx="6" type="EL7041-1000" name="D7"/>
    <!--                                  			-->
    <!-- EL6614 4 Port Switch (Ethernet, CoE)   	-->
    <!--<slave idx="4" type="EL6614" name="D5"/>	-->
  </master>
</masters>

My HAL-File looks similar to this:
github.com/koppi/mk/blob/master/linuxcnc...c/koppi-cnc-axis.hal
github.com/koppi/mk/blob/master/linuxcnc...cnc/koppi-cnc-io.hal

Please understand that it feels a bit embarrassing for me if I would show you my HAL file,
as it has suffered hours and hours of try and error (I will clean it up within the next hours).

Thank you,
Hawkeye
Last edit: 25 Nov 2017 19:30 by Hawkeye.

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

More
26 Nov 2017 10:02 #102348 by db1981
Hello,

it seems you are using an hal file which was generated for an machine with encoders.
In your hal file you are telling x-pid-feedback to use x-pos-feedback which is an encoder connected to
lcec.0.4.enc-pos .
If you have a machine with steppers without feedback, you have to use "simulation" feedback.
I think in your configuration:

#net x-pos-cmd <= axis.0.motor-pos-cmd #
net x-pos-cmd => axis.0.motor-pos-fb #sim
#net x-pos-fb => axis.0.motor-pos-fb #

take a look at some Stepconf hal files.
The following user(s) said Thank You: Hawkeye

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

More
26 Nov 2017 13:40 - 26 Nov 2017 14:14 #102350 by Hawkeye
After I struggled for hours yesterday, I started a new hal configuration file this morning.
This file is part of my machine configuration which consists of several hal files.

#
# Testfile for defintion of EL7041-0000 without separate hardware encoder
#


# load position controller PID instances
loadrt pid names=z-pid						

addf z-pid.do-pid-calcs servo-thread


setp lcec.0.D7.srv-scale 		[AXIS_2]SCALE
#setp lcec.0.6.enc-pos-scale 	[AXIS_2]ENC_SCALE		
#setp lcec.0.D7.srv-min-dc		1
#setp lcec.0.D7.srv-max-dc		2


net z-enable    		=> lcec.0.D7.srv-enable
net z-amp-fault 		<= lcec.0.D7.srv-error
net z-vel-cmd   		=> lcec.0.D7.srv-cmd
net z-pos-fb    		<= lcec.0.D7.enc-pos


# position controler
#setp z-pid.Pgain 		[AXIS_2]P							
#setp z-pid.Igain 		[AXIS_2]I							
#setp z-pid.Dgain 		[AXIS_2]D							
#setp z-pid.FF0 		[AXIS_2]FF0							
#setp z-pid.FF1 		[AXIS_2]FF1							
#setp z-pid.FF2 		[AXIS_2]FF2							
#setp z-pid.deadband 	[AXIS_2]DEADBAND					
#setp z-pid.maxoutput 	[AXIS_2]MAX_OUTPUT					
net z-enable 			=> z-pid.enable
net z-pos-cmd 			=> z-pid.command
net z-pos-fb 			=> z-pid.feedback
net z-vel-cmd 			<= z-pid.output


# axis interface
net z-enable 			<= axis.2.amp-enable-out
net z-amp-fault 		=> axis.2.amp-fault-in
#net z-pos-cmd 			<= axis.2.motor-pos-cmd	
net z-pos-cmd 			<= axis.2.motor-pos-fb 
#net z-pos-fb 			=> axis.2.motor-pos-fb
#net z-pos-joint 		<= axis.2.joint-pos-fb	
#net z-homed 			<= axis.2.homed			
#net z-homing 			<= axis.2.homing		
#net z-neg-lim-in 		=> axis.2.neg-lim-sw-in	
#net z-pos-lim-in 		=> axis.2.pos-lim-sw-in	
#net z-home-sw-in 		=> axis.2.home-sw-in	


To be honest, I am also a bit unsure whether I connected the motor to the EL7041 in the correct way,
as the labeling is different between my old parallel port based step motor amplifier(A+ A- B+ B-) and Beckhoff(A1, A2, B1, B2).
As motor for testing, I use a 23HS8430
Datasheet: images-na.ssl-images-amazon.com/images/I...LTncpIL._SL1147_.jpg
The old connection layout was as follows:
B- = RED
B+ = GREEN
A- = BLUE
A+ = YELLOW


Regards,
Hawkeye
Last edit: 26 Nov 2017 14:14 by Hawkeye.

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

More
26 Nov 2017 19:57 #102365 by andypugh
Can you describe the system in a bit more detail? Is the PID something that you are putting it?

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

More
26 Nov 2017 23:40 #102372 by Allan
My understanding is that EL7041 terminals always have feedback active whether there is an encoder attached or not. By default terminals are set to internal feedback (no external encoder attached). You can read the current setting by issuing an ethercat command from the command line:

ethercat -p 6 upload --type uint8 0x8012 0x08

The 6 in the above command relates to the ethercat address of your terminal. Reading the XML file you attached, your terminal is set to ID = 6. The result of the command: 1 = internal feedback, 0 = external feedback.

To set your terminal to use internal feedback issue the following command:

sudo ethercat -p 6 download --type uint8 0x8012 0x08 1

The parameters of this command are detailed in Bechoff's 7041 PDF documentation on page 197, Feedback type:

7041 documentation

Hoping this helps.

Allan
The following user(s) said Thank You: Hawkeye

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

More
27 Nov 2017 05:37 #102377 by Hawkeye
Hello andypugh,

I am not sure whether I understood your question or not,,,
As I am a beginner, please ask a bit more precise, so I have the chance to give you a good answer.

Regards,
Hawkeye

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

More
27 Nov 2017 05:41 #102378 by Hawkeye
Hello Allan,

thank you - this was helpful indeed.

My EL7041 appearently used the external encoder.
I changed the settings now to internal encoder, but still the same issue.
Can you give me more details about your hardware(which EL7041 Version), setup, hal-file, xml-file, (...)

Best Regards,
Hawkeye

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

More
27 Nov 2017 21:19 #102404 by Allan
Hello Hawkeye

Firstly, I have a few confessions to make:

I do not have a working machine, only four motors on a desktop connected to a line of EtherCAT terminals.
And the configuration files I am using are blatant copies of Koppi's Machinekit machine

I am using EL7041-1000 terminals.

I have attached a copy of the my current .xml file - there are four EL7041-1000 terminals; two will be used to drive a gantry.

Koppi's machine has a number of HAL files breaking the HAL configuration into functional units. I have attached my slightly
modified koppi-cnc.io.hal file since this handles the bulk of the connections to the EtherCAT terminals. All of Koppi's files
are available that the above link.

Hoping this helps.

Allan
Attachments:
The following user(s) said Thank You: Hawkeye

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

More
28 Nov 2017 19:11 - 28 Nov 2017 19:21 #102450 by Hawkeye
Hello Allan,

first of all, sorry for delay..

What I did in the meantime is that I reviewed the Beckhoff document you provided.
I checked mainly the parts beginning page 196 up to page 221.
This seems to contain all data objects relevant for EL7041.

What I found was a bit surprising to me, as I did not expect that Beckhoff stores
basic configurations on each terminal... Anyway, I hat a look at the encoder setup and in fact it was
configured to operate with external encoders. After I did some try and error download/upload operations,
I decided to do a factory reset of the sessings. I hope that this way, beckhoff did all basic settings for their customers,
so they get a running product, no matter which kind of motor, encoder, ... they are connecting to the terminal.

Now, it feels like the terminal is ready to operate with my motor..
And yes, it just feels like this, because the motor did not any movement yet.
So far, I had a look at the following configuration areas:
- basic motor settings = looks ok: encoder is now internal
- pos settings = looks ok to me
- stm input ch1 = looks ok, no error, no warning, status is now "ready"
- pos input ch1 = looks ok, When I try to move the motor, an error flag will be raised at 6020:03 (BOOL) ??reason??
- a010 stm diag data ch1 = looks ok, no over temperature, voltage ok, no short circuit at A or B

Do you know how I can try to move the motor without linuxcnc?

//edit:
Do you think it would be worth to have a look at complex configuration in stead of simple configuration?
As far as I know, I have to create an XML-File using Beckhoff EthercatConfiguration Tool and have to load it somewhere into the
driver area of linuxcnc. I havn't done this and have not seen a step by step guide on how to do it yet.


Best Regards,
Hawkeye
Last edit: 28 Nov 2017 19:21 by Hawkeye.

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

More
28 Nov 2017 20:56 #102456 by db1981
for easy testing, download Beckhoff Twincat V2.xx, install the 30 days trial Version.

launch System Manager, ADD an ethercat Master, patch your network Kard, scan configuration and boxes, add an
ptp axis, patch it tho the EL7041, . launch the configuration and you can control the cards....

there exists quick start pdfs.

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

Time to create page: 0.166 seconds
Powered by Kunena Forum