Re: [etherlab-users] Yaskawa sigma 5 application

2017-08-10 Thread Graeme Foot
You don't need any patches to get running.  

The patches I use are a CX2100 driver, some RTAI fixes (your using Xenomi), 
some patches to increase the performance of the SDO's and some distributed 
clock fixes.
It's only the distributed clock fixes which you will need at some stage, best 
to get them from Gavin's patchset as he keeps them up to date with the latest 
release.  Mine are a few years old now.

Looking at your log it looks like it is completely failing to configure the 
PDO's.  You also have a different drive to mine (Yours: 0x0539, 0x02200301; 
 mine: 0x0539, 0x0221) so the PDO configuration may not be the same.  
To get the PDO's for your drive, repower your system (including the drive) to 
reset it, then use the "ethercat struct" command.  This will output the default 
PDO's required by the drive.


What is the results for the following commands:

ethercat struct (after repowering the system, before running your app)

ethercat debug 1

dmesg



Regards,
Graeme.



-Original Message-
From: Rahul Deshpande [mailto:rahulg...@gmail.com] 
Sent: Friday, 11 August 2017 3:20 a.m.
To: Graeme Foot 
Subject: Re: Yaskawa sigma 5 application

Hi Graeme,

Ignore the previous main.c. The one attached in this mail is what I am using to 
communicate with the drive.

On 8/10/17, Rahul Deshpande  wrote:
> Hi Graeme,
>
> I noticed you mentioned that I could be needing patches in order to 
> get yaskawa work with the master. Do we need all the patches on your 
> name or just a selective few ?.
>
> At this point I am trying to get to OP state but even after changing 
> the application I cannot surpass it. I have attached the new 
> application that I wrote and also the logs. These logs are obtained 
> after running the 'ethercat debug 1' command before running the 
> application. It is throwing an error for each domain that I have 
> defined.
>
> Looking forward to your reply.
>
> Thank you,
> Rahul
>
___
etherlab-users mailing list
etherlab-users@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-users


Re: [etherlab-users] Yaskawa sigma 5 application

2017-08-03 Thread Graeme Foot
> -Original Message-
> From: Rahul Deshpande [mailto:rahulg...@gmail.com] 
> Sent: Friday, 4 August 2017 4:17 a.m.
> To: Graeme Foot 
> Subject: Yaskawa sigma 5 application
> 
> Hi Graeme,
> 
> Building up on the previous mail. I made a few changes to my application. 
> I am still an amateur at this and have just been introduced to motion 
> control last month. I have modified the example/xenomai/main.c file to 
> suit my needs. I have attached the file. I am setting the PDOs as you had 
> mentioned. I read on some of the etherlab group archive mails that I need 
> to set the sdo's as well.
> 
> My understanding is that the SDO's consist of the data that needs to be 
> processed and the PDO's are just a way to communicate this data from slave 
> to master and vice versa. Is there any specific way to configure these ?. 
> I just intend to write a simple application.
> 
> Thank you,
> Rahul
>


Hi,

Note: Remember to always post to the etherlab forum.


1) From you attached file it looks like you have a sigma 7 rather than sigma 5 
amp.  I haven't got my hands on one yet (in the pipeline) but should be similar 
to the sigma 5.  To make sure you have the correct PDO structures use the 
"ethercat struct" command.  It will output the currently configured (or default 
if not changed) structures to work with the device.  (The items below are for 
sigma 5, but should be similar.)


2) PDO's vs SDO's:
- PDO's are the workhorse of EtherCAT.  The PDO data is communicated every 
cycle.  PDO's are realtime.  
- SDO's are generally just used to set up initial configuration parameters.  
They can be used to read/write non-PDO parameters while running, but they are 
not realtime and take multiple cycles to be sent and be returned.  They should 
also only be used for values that do not change often. 


3) You don't need to call these:
ecrt_slave_config_sdo8( sc_dig_out_01, 0x1C12, 0, 0 ); /* clear sm pdo 0x1c12 */
ecrt_slave_config_sdo16( sc_dig_out_01, 0x1C12, 1, 0x1601 ); /* download pdo 
1C12 index */
ecrt_slave_config_sdo16( sc_dig_out_01, 0x1C12, 2, 0x1602 ); /* download pdo 
1C12 index */
ecrt_slave_config_sdo16( sc_dig_out_01, 0x1C12, 3, 0x1606 ); /* download pdo 
1C12 index */
ecrt_slave_config_sdo8( sc_dig_out_01, 0x1C12, 0, 3 ); /* set number of RxPDO */
ecrt_slave_config_sdo8( sc_dig_out_01, 0x1C13, 0, 0 ); /* clear sm pdo 0x1c12 */
ecrt_slave_config_sdo16( sc_dig_out_01, 0x1C13, 1, 0x1A01 ); /* download pdo 
1C13 index */
ecrt_slave_config_sdo16( sc_dig_out_01, 0x1C13, 2, 0x1A03 ); /* download pdo 
1C13 index */
ecrt_slave_config_sdo16( sc_dig_out_01, 0x1C13, 3, 0x1A06 ); /* download pdo 
1C13 index */
ecrt_slave_config_sdo8( sc_dig_out_01, 0x1C13, 0, 3 ); /* set number of TxPDO */

That’s what ecrt_slave_config_pdos() does.


4) There are some settings that you need to set and flash before running the 
drive (and repower the drive after flashing them).
- If it's an absolute motor that you will be running in incremental mode, you 
need to (0x2002.1 = 1)
- If you do not have limit switches you will need to disable them (in 0x250a.3 
and 0x250b.0)
- If you have external regen resistors, you need to set 0x2600
- possibly some others I forget


5) You are blinking the first 8 bits of 0x6040.  That won't be doing much of 
anything that you can see.
- First thing is, is the slave in Operational mode when you go to realtime?
- Second, to enable the drive you need to go through a state machine of setting 
control bits and confirming each state with status bits

set: Control.EnableVoltage & Control.QuickStop
wait until: Status.ReadyToSwitchOn
set: Control.SwitchOn
wait until: Status.SwitchedOn
set: Control.EnableOperation
wait until: Status.OperationEnabled

You will need to set 0x6060:00 (Mode of operation) to the mode you want to run 
with (e.g. 8=cyclic position)

You should now be good to send target position values (0x607a:00).  I you don't 
have a position generator they you could try velocity mode (Mode of operation 
9) and ramp up and down the value (for acceleration / deceleration).


Regards,
Graeme.





/**
 *
 *  $Id: main.c,v 3bdd7a747fae 2012/09/20 13:28:25 fp $
 *
 *  Copyright (C) 2009-2010  Moehwald GmbH B. Benner
 * 2011  IgH Andreas Stewering-Bone
 * 2012  Florian Pose 
 *
 *  This file is part of the IgH EtherCAT master
 *
 *  The IgH EtherCAT Master is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU General Public License version 2, as
 *  published by the Free Software Foundation.
 *
 *  The IgH EtherCAT master is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
 *  Public License for more details.
 *
 *  You should have received a copy of the GNU