Jump to content
OMRON Forums

rotary - synchronous variable assignement - first lines


AnthonyLH
 Share

Recommended Posts

I can't understand a behaviour i am having on a synchronous variable assignement inside of a rotary buffer...

You will find 4 "cleaned" to strict necessary lines program below.

They all assign M variables from the beginning of the program.

Prog1 : M1 variable assignement set (to 1 and then to 0) is ignored. M2 ok. Why M1 assignment is ignored?

Prog2 : M1 variable assignement set (to 1 and then to 0) is ignored. M2 ok. Why M1 assignment is ignored?

Prog3 : Working but.. i have 10ms (oscilloscope on output) between the rising and falling edge of M1. M2 ok. Why 10ms between M1 rising and falling edges?

Prog4 : Working. I still have 10ms (oscilloscope on output) between the rising and falling edge of M1. M2 ok. Why 10ms between M1 rising and falling edges?

 

M2 ok : means I have 10ms between rising and falling edge

M1 and M2 are Mvariable pointing on outputs i spy on an oscilloscope.

 

More infos about my PPMAC:

ServoPeriod: 0.25ms

RtIntPeriod: 3 (RTI at 1ms)

SegMoveTime: 10ms (= to the TM)

 

 

-----Prog1-----

TM10 TA5 TS2.5;

M1==1;

N0 X0 M1==0

N1 X0 M2==1

N2 X0 M2==0

N3 X0

N4 X0

N5 X0

 

-----Prog2-----

TM10 TA5 TS2.5;

M1==1;

N0 X0

N1 X0 M1==0

N2 X0 M2==1

N3 X0 M2==0

N4 X0

N5 X0

 

-----Prog3-----

TM10 TA5 TS2.5;

M1==1;

N0 X0

N1 X0

N2 X0 M1==0

N3 X0 M2==1

N4 X0 M2==0

N5 X0

 

-----Prog4-----

TM10 TA5 TS2.5;

M1==1;

delay 0;// or N0 X0

delay 0;// or N0 X0

N0 X0 M1==0

N1 X0 M2==1

N2 X0 M2==0

N3 X0

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

There are a few issues here. Although, I am not sure I understand what is your end goal or what are you trying to do.

 

If you want to toggle outputs from a motion program every 10 msec, then you ought do DWELL 10 rather than playing games with move/segmentation times and zero-distance move commands.

 

The jitter you see is a function of the segmentation time. The most accurate results can be achieved by setting the SegMoveTime to the servo interrupt (0.250 in this case). This has other implications on motion and computation of course.

 

The following code will cause PMAC to toggle M1 instantaneously. Both assignments will be executed at the start of X0. That is because M1==0 is on the same line as X0.

M1==1

N0 X0 M1==0

 

Try the following, although typically synchronous variables are assigned on the previous line of a move command.

N1 X0 M1==1

N2 X0 M1==0

N3 X0 M2==1

N4 X0 M2==0

Link to comment
Share on other sites

Thank you Richard,

We want to be able to set outputs (throught M variables) on every motion point (line), so every 10ms.

I used "delay 0" on Prog4 just because i observed that it cancel the Prog1/Prog2 behaviour.

We can't use DWELL 10 as it will clear the lookahead.

"Prog3" and "Prog4" are just "tricks" to solve my lack of understanding.

 

You explained why on "Prog1" M1 was not set:

"Both assignments will be executed at the start of X0" , for the code below

X0.

M1==1

N0 X0 M1==0

 

I still don't understand the behaviour on "Prog2".

I found a simple way to test what i don't understand, see the prog below:

-----Prog5-----

N0 X0

dwell 0;

TM10 TA5 TS2.5;

dwell 0;

N1 X0

N2 X0

N3 X0

If you do a datagathering on Coord[].Nsync , you will observe that "N1" is never set

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share


×
×
  • Create New...