CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Tue Aug 20, 2019 8:50 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Fri Apr 05, 2019 12:41 pm 
Offline

Joined: Thu Jan 28, 2016 9:55 am
Posts: 5
Is it possible to create a move with trapezoidal velocity (linear velocity, no s-ramping) via the various Cam functions without having to use the Cam editor to define a general trapezoidal shape and then scaling this etc.. to suit my actual master and slave distances?

I want to calculate (at run time) this Cam from just four points.
For example, if 'a' is some nominal master distance..

0,0
a, (a/2)
a+1, (a/2) + 1
2a + 1, a + 1

..should be able to give me a nice trapezoidal profile (where the slave axis accelerates to a 1:1 velocity ratio with the master, travels 1 unit and then ramps down to a stop).

However, whatever I try with the interpolation modes, use of SMC_CAMXYVA or other data types I cannot get linear velocity segments.

e.g.
CamData0[0].dX := 0;
CamData0[0].dY := 0;
CamData0[0].dV := 0;
CamData0[0].dA := 0;

CamData0[1].dX := 2;
CamData0[1].dY := 1;
CamData0[1].dV := 1;
CamData0[1].dA := 0;

CamData0[2].dX := 3;
CamData0[2].dY := 3;
CamData0[2].dV := 1;
CamData0[2].dA := 0;

CamData0[3].dX := 5;
CamData0[3].dY := 4;
CamData0[3].dV := 1;
CamData0[3].dA := 0;

Cam.nElements := 4;
Cam.xStart := 0;
Cam.xEnd := 5;

Any ideas?


Top
   
PostPosted: Thu Apr 11, 2019 4:14 pm 
Offline

Joined: Thu Jan 28, 2016 9:55 am
Posts: 5
Of course my example data wasn't quite right, it should be...

CamData0[0].dX := 0;
CamData0[0].dY := 0;
CamData0[0].dV := 0;
CamData0[0].dA := 0;

CamData0[1].dX := 2;
CamData0[1].dY := 1;
CamData0[1].dV := 1;
CamData0[1].dA := 0;

CamData0[2].dX := 3;
CamData0[2].dY := 2;
CamData0[2].dV := 1;
CamData0[2].dA := 0;

CamData0[3].dX := 5;
CamData0[3].dY := 3;
CamData0[3].dV := 1;
CamData0[3].dA := 0;

It still doesn't work though.....over 100 views and no-one has any idea how to get a straight line trapezoidal profile out of a CAM??...


Top
   
PostPosted: Thu Apr 11, 2019 4:25 pm 
Offline

Joined: Thu Jan 28, 2016 9:55 am
Posts: 5
I'm having a bad copy/paste day...the data should actually be...

CamData0[0].dX := 0;
CamData0[0].dY := 0;
CamData0[0].dV := 0;
CamData0[0].dA := 0;

CamData0[1].dX := 2;
CamData0[1].dY := 1;
CamData0[1].dV := 1;
CamData0[1].dA := 0;

CamData0[2].dX := 3;
CamData0[2].dY := 3;
CamData0[2].dV := 1;
CamData0[2].dA := 0;

CamData0[3].dX := 5;
CamData0[3].dY := 4;
CamData0[3].dV := 0;
CamData0[3].dA := 0;

i.e. the final vel ratio is 0 of course....

Anyway....I can get a nice poly (s-ramped) profile from this of course....but is there an easy way to get a non s-ramped version?...


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 3 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