CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum
Deutsche Version English version russian version 
It is currently Sat Dec 16, 2017 5:46 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 12 posts ] 
Author Message
PostPosted: Wed Sep 13, 2017 4:47 pm 
Offline

Joined: Fri Sep 08, 2017 10:11 am
Posts: 7
Hi,

I have a project in which I am trying to setup a new axis group based on PLCopen function blocks MC_AddAxisToGroup/MC_SetKinTransform/MC_GroupEnable.
I wrote an SFC program for which the first step is the creation of the axis group. I've declared an AXIS_GROUP_REF_SM3 variable in the SFC program variable declaration header. This program is running on the only task of the project (MainTask).
When I call MC_AddAxisToGroup with the declared axis group and an axis (a servo drive in this case (SM_Drive_Servo/AXIS_REF_SERVO) as inputs, I get the following error:
Code:
SMC_AXIS_GROUP_AXIS_IN_DIFFERENT_TASK - An axis belonging to an axis group must be executed in the same task


I couldn't figure out what's wrong with my program and the error message didn't make it clearer.
Could anyone help me understanding this error message and debuging this issue ?
Thanks ahead


Top
   
PostPosted: Thu Sep 14, 2017 10:10 am 
Offline
Frequent User
Frequent User

Joined: Wed May 04, 2016 6:00 pm
Posts: 180
Te task where the axe runs has to be the same as the task wher the group is created.

See in axe:


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Thu Sep 14, 2017 10:48 am 
Offline

Joined: Fri Sep 08, 2017 10:11 am
Posts: 7
Thanks for your quick reply.
I've changed the bus cycle task of my servo drives to MainTask which is the task where my SFC program is running (and one step of my SFC is creating the axis group). I still encounter the same error message though. Do you have any other suggestions ?

BTW, in case you'd find it helpful, I've checked the field m_hTask of my axis group and it is set to 16#000000 wheras the field hTask in the servo drive variable (AXIS_REF_SERVO type) is 16#0883BAA0. This sounds to me like the drive and the program are still running in two different tasks, even though I did the change you've suggested (but not knowing what these two variables really stand for, this may have nothing to do with the current error...).


Top
   
PostPosted: Thu Sep 14, 2017 11:02 am 
Offline

Joined: Fri Sep 08, 2017 10:11 am
Posts: 7
I've created a simpler project to test this issue in isolation.
I have a single program, assigned to MainTask (only task running in this application):
Code:
PROGRAM PLC_PRG
VAR
   ax_group : AXIS_GROUP_REF_SM3;
   addaxg : MC_AddAxisToGroup;
END_VAR

addaxg(
   AxisGroup:= ax_group,
   Axis:= SM_Drive_Servo,
   Execute:= TRUE,
   Done=> ,
   Busy=> ,
   Error=> ,
   ErrorID=> );

SM_Drive_Servo is a servo drive connected to Adafruit_PWM_SoftMotion on an I2C master on the I2C bus of a Raspberry Pi 3.
The drive as well as the Adafruit_PWM_Softmotion objects have the bus cycle task set to MainTask.

Even with this simple project, the error SMC_AXIS_GROUP_AXIS_IN_DIFFERENT_TASK is raised.


Top
   
PostPosted: Thu Sep 14, 2017 12:44 pm 
Offline
Frequent User
Frequent User

Joined: Wed May 04, 2016 6:00 pm
Posts: 180
It seems that you not have a task assigned to the axis group.


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Thu Sep 14, 2017 1:46 pm 
Offline

Joined: Fri Sep 08, 2017 10:11 am
Posts: 7
Ok, I see.
The thing is, I was trying to make a new axis group based solely on PLCopen function blocks (MC_AddAxisToGroup/MC_SetKinTransform/MC_GroupEnable).
Hence I only declare the axis group and then populate it with the axes and a kinematic transform (basically just the same as what is described in PLCopen part4, paragraph 4.1). Is this not possible with CodeSys 3.5SP11 ? Do I have to use the axis group configurator in any case ?
If yes, then my next question will be how to set my custom kinematics to an axis group ? I've implemented the TRAFO.MC_KIN_REF_SM3 interface but I don't see it appearing in the list of kinematics in the axis group configurator. My implementation of the MC_KIN_REF3 interface is a POU in the same application where I want to configure an axis group.


Top
   
PostPosted: Thu Sep 14, 2017 2:53 pm 
Offline
Frequent User
Frequent User

Joined: Wed May 04, 2016 6:00 pm
Posts: 180
Have you test to call your refgroup from the beguining of your program?


Top
   
PostPosted: Thu Sep 14, 2017 3:17 pm 
Offline

Joined: Fri Sep 08, 2017 10:11 am
Posts: 7
Is this not what the program I've copied in a previous post doing ?
I'm not sure I fully understand your comment. Maybe you would like to attach some example code to make your comment more clear for me?

EDIT: For your convenience, I am attaching a simple project which can be used to reproduce the SMC_AXIS_GROUP_AXIS_IN_DIFFERENT_TASK error.


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Fri Sep 15, 2017 9:39 am 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 2333
Hi,
it does not make really sense to add all these fb's manually in the appication code.
All these global init code and implcit fb calls are missing then (which gives the SoftMotion if you use the editors/configuration).
So I would recommend to check the examples (which are all using the configuration for kinematics)

BR
Edwin


Top
   
PostPosted: Fri Sep 15, 2017 10:12 am 
Offline

Joined: Fri Sep 08, 2017 10:11 am
Posts: 7
Hi Edwin,
Thanks for your reply.
I guess this means the answer to my previous question about implementing an axis group the way it is done in PLCopen part4, paragraph 4.1 is no.
Fine for me.

Actually I do also prefer using the axis group configurator. However, my robot's kinematic is not supported by the SM3_Transformation library. I've then followed the steps defined in Softmotion's documentation to define my own kinemactics. As mentionned earlier, I've implemented the TRAFO.MC_KIN_REF_SM3 interface but I don't see it appearing in the list of kinematics in the axis group configurator. My implementation of the MC_KIN_REF3 interface is a POU in the same application where I want to configure an axis group.
How can I make my custom kinematics visible from the axis group configurator ?
Do you have an example project you could share with me that I could use to look into how to create my own custom kinematics ?
Thanks ahead.


Top
   
PostPosted: Sat Sep 16, 2017 7:00 pm 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 2333
Hi,
there will come an example implementation for an Gantry kinematic in this example project.
Attached an exampleproject.

BR
Edwin


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Mon Sep 18, 2017 6:52 pm 
Offline

Joined: Fri Sep 08, 2017 10:11 am
Posts: 7
Many thanks!
Your example project helped me solving the issues I was facing.
Thanks for your great support.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 12 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited