- Posts: 790
- Thank you received: 276
Ethercat HAL driver
- db1981
- Offline
- Platinum Member
-
try to start your config without the twincat workaround.
this are the init cmds for your drive, for your desired PDO configuration. You can put them manually in your ethercat config with
an "sdo_config" line or as an external .xml file.
These commands are sent in the transition between preop and safeop state, before the master configs the pdos, goes to realtime and in op mode.
with beckhoff or sercos drives this list is very long, because it contains the whole drive configuration. These drives configurations are empty after power loose. I hope this is not so with the indradrives.
At CIA Can Profile the scaling and weigthing is handled with other units, as descriped in the indradrive manual for this firmware. but first get the drive to op without twincat, then we can get an aim at the scaling.
- jc2ktr
- Offline
- Premium Member
-
- Posts: 87
- Thank you received: 17
db1981 wrote: i have added an line to your ethercat_conf.xml, please put the additional file in your machine config folder.
try to start your config without the twincat workaround.
this are the init cmds for your drive, for your desired PDO configuration. You can put them manually in your ethercat config with
an "sdo_config" line or as an external .xml file.
These commands are sent in the transition between preop and safeop state, before the master configs the pdos, goes to realtime and in op mode.
with beckhoff or sercos drives this list is very long, because it contains the whole drive configuration. These drives configurations are empty after power loose. I hope this is not so with the indradrives.
At CIA Can Profile the scaling and weigthing is handled with other units, as descriped in the indradrive manual for this firmware. but first get the drive to op without twincat, then we can get an aim at the scaling.
I know these Commands, they are listed in the startup tab from TwinCAT, i think they are stored in the drive, because i only had to use TwinCAT once to configure them.
But i did not know how to use them without TwinCAT.
Thanks i do a reset of the drive tomorrow and set it up with your additional XML and then get it hopefully to work.
Greets Sven
- db1981
- Offline
- Platinum Member
-
- Posts: 790
- Thank you received: 276
if you once did start the drive with Twincat, you can start it again direct with linuxcnc after an power cycle?
- bkt
- Offline
- Platinum Member
-
- Posts: 1111
- Thank you received: 114
regards
bkt
- db1981
- Offline
- Platinum Member
-
- Posts: 790
- Thank you received: 276
If you take a look at this:
this is the ethercat reading for an HAL_TYPE=float value.
So if you setup your PDO as float, lcec read it as S32. (if you set it as "float-unsigned", it will read U32). After this scaling and offset are attached.
If your nodes S32 Value is 5 with :
scale = 1.0 , your halpin(float) will be =5.0 ;
scale = 10000, your halpin is =50000.0 ;
scale = 0.001, your halpin is = 0.005 .
that is it for reading.
At the writing your value is first multiplyed with the scale and then converted to an S32.
If you halpin(float) is 5.123 with :
scale =1.0, Value to to the node = 5;
scale =1000, value to the node = 5123;
scale = 10, value to the node = 51;
scale = 0.1, value to the node = 0 ( float 5.123 * 0.1 = 0.5123 -> cast to INT = 0);
halpin = 51.23, scale 0.1, value to the node = 5.
Maybe i have unsettled you with one of my past post. Sorry but there has been only the code from the master in my head, i had not took a look at the generic_slave and that theres an native scale in it, because i always write complete drivers for slaves i have to controll.
- jc2ktr
- Offline
- Premium Member
-
- Posts: 87
- Thank you received: 17
db1981 wrote: ah ok,
if you once did start the drive with Twincat, you can start it again direct with linuxcnc after an power cycle?
Yes after one time setup with TwinCAT the drive was able to start in Linuxcnc even after powerloss.
I tested your solution from yesterday with the default settings loaded in the drive and then Changed to EtherCAT protocol without using TwinCAT, the only thing i had to do to get it to work was rearranging the devices in my BusTopology, first the drive then the io devices.
Seems that TwinCAT also configures the adresses of the devices. Which was not done by Indraworks.
But the drive runs, but scaling was also changed, seems to be that this is done by the cia402 Control setting.
bkt wrote: @bd1981 .... about your suggested xml file, you sign 607A as s32 type .... but sign it as float with scale = 10000 is the same things or really different? And why is different? .... sorry but I did not understand this thing and I would like to understand better .... some post ago you had doubts about my use of the float value and I wanted to dig deep into this aspect of linuxcnc-ethercat ...
regards
bkt
I used float first but LinuxCNC started with an error about wrong signaltypes, after change to s32 it was starting without errors.
The scaling is done in my axis.hal file but i first have to resolve the problem that my drive is using angular degrees to set position.
I calculated that my max travel were 7614° which are roundabout 211,5mm from my linear axis.
And the velocity in Linuxcnc is far away from usual.