Please enable JavaScript to view this site.

Identifier of a block of instructions (executed on interrupt($RULE) at a frequency set by the rule_freq instruction) intended to describe and determine the rules of behavior of one or more axes.

Syntax

RULE num

    axes n[,n,n,...,n] | axes_m m

    ref

       ; REF BLOCK (optional)

    end_ref

    motion

        if(first_time())

          ; only the first time

        endif

        ; MOTION LOCK

    end_motion

    aux

       ; AUX BLOCK (optional) 

    end_aux

END_RULE

num

It is the identification number of the rule.

It must be a constant. Within the $RULE file the user can write infinite rules.

Up to 32 rule executors(rc) can be active simultaneously in the sampling.

To decide which rules to run in the next sampling, the user has the group instruction, and to decide the order of execution in the sampling, the user has the order instruction.

order: instruction used only once in initialization

group: widely used instruction since the active rules must change according to the state of the machine

axes (n[,n,n])

(alternative to axes_m) This is the identifier used to declare which axes are manipulated by the rule (1-:-32).

n are the axis identifiers. At least one axis must be declared

axes_m (mask)

(alternative to axes) Allows the mask of the axes involved to be written (the value can be an expression).

Note: This declaration is also optional. No checks are performed in either compilation or execution.

ref

If omitted, the compiler will handle the position loop closure algorithm by the following default formula "Proportional position loop closure with velocity feed forward."

epos(n) = p_ip(n, ipp_idx) – cp(n)

sref(n) = epos(n) * pro_gai(n) + kff(n) * iv(n)

The user will simply have to use the predefined variables pro_gai and kff to calibrate the axes.

If you do not wish to have a speed feed forward component, simply set the kff variables of the affected axes to 0. If, on the other hand, a null value of pro_gai is imposed, open-loop axis drive is achieved.

Keep in mind that with purely proportional feedback, the position error that is obtained is directly proportional to the velocity. The feed forward component is inserted to bring the error in velocity to zero.

The user will need to set the values of ser_thr and ser_gai appropriately for proper tracking alarm(sam) handling. Remember that in the predefined variable ser_cthr RTE provides the current threshold (calculated sampling by sampling) of theservo alarm.

Use the oscilloscope tool from RDE to set the correct ser_thr and ser_gai values

end_ref

End of block ref

motion

The rule motion field describes the equations that govern the state of the system governed by Robox axis controls and programmed in R3 language. The equations will bind the state variables of the system, variables that can be, in general, of any type, but, given the type of Robox steering units, they will be fundamentally kinematic, namely, positions, velocities, accelerations. That is, in R3 language:

ip (ideal position) i.e.

iv (ideal velocity) i.e. the ideal speed

ia (ideal acceleration) i.e., the ideal acceleration

and also:

cp (current position) i.e. the actual position

cv (current velocity) i.e., the actual velocity

ca (current acceleration) i.e., the actual acceleration

Where ideal units are the reference units, that is, the value that, at a given time, one would like position, velocity and acceleration to have. The actual quantities are the actual values of position, velocity and acceleration as measured through the appropriate transducers.

The measured quantity is usually position, so actual velocity and acceleration are derived by numerical derivation. Velocity will be the change in position over a sampling interval (equal to si); similarly, acceleration will be the change in velocity over a sampling interval.

It should be focused that the ideal position (ip) represents the desired position for a certain axis at a certain time. It should not be confused with the position where you want the axis to go, obeying a certain law of motion (and therefore taking a certain amount of time). In the motion field of each rule, the law of motion of one or more axes is expressed. One and only one of the variables ip, iv, ia may be represented there in explicit form (i.e., appear in an assignment instruction to the left of the "=" sign).

It is not permissible to assign values to more than one of the above three variables. RTE takes charge of correctly calculating the two missing variables in the manner given below.

If two or three variables, referring to the same axis, are assigned in the motion field, RTE generatesalarm 2800 during execution.

If none of the three variables are assigned explicitly, there is no error reporting by the compiler, but some important checks(servo alarm, crash alarm, speed alarm etc.) are missed during execution; the automatic calculation of the remaining axis-related variables is also missed.

Multiple axis-related laws are allowed in the RULE. It is inadvisable to use the same RULE to describe the motion of mutually independent axes.

In particular:

 

IF IP IS ASSIGNED THE BEHAVIOR WILL BE AS FOLLOWS:

If the set position is greater than/minor than the software limit switches parametrized in the predefined variables max_str(n) and min_str(n) and the predefined variable cam is enabled then:

* If the ideal quota ip is outside the software limit switches max_str and min_str and you want to move further away RTE generates the crash alarm and the imposed IP is ignored (the previous one is kept).

* If the ideal quota ip is on the software endpoints max_str and min_str and you want to move out RTE generates the crash alarm and the imposed ip is limited to the relative end of strokes.

As long as the ip is outside the end of strokes, the alarm cannot be reset.

By acting on the predefined variable ip_write_bounds, changing its default value (0xFFFFFF), it will be possible to change the behavior as follows:

* If the ideal ip quota is on the software limit switch max_str and min_str and you want to exit RTE generates the crash alarm and the imposed ip, even if outside the end of strokes is assumed.

Even if the ip results outside the end of strokes it will be possible to reset the alarm. It will be regenerated if an attempt is made to move further away.

The speed is then calculated by RTE. If it results greater than the maximum speed parametrized in the predefined variables max_spe(n) and the spam alarm is enabled, the speed alarm is issued.

The acceleration is calculated by RTE. If it results greater than the maximum acceleration parametrized in the predefined variables max_acc(n) and the acam alarm is enabled, the acceleration alarm is issued.

The Servo (tracking) alarm is handled if enabled via the predefined variable sam

 

IF IV IS ASSIGNED, THE BEHAVIOR WILL BE AS FOLLOWS:

If the set speed is greater than the maximum speed parametrized in the predefined variables max_spe(n):

* It is limited to the maximum speed itself (max_spe(n)) if and only if the predefined variable spam is enabled.

* A warning is given to the user via the predefined variable splm if and only if the spam predefined variable is enabled.

The acceleration is calculated by RTE. If it results greater than the maximum acceleration parametrized in the predefined variable max_acc(n):

* Acceleration alarm is generated if and only if the predefined variable acam is enabled.

The position is then calculated by RTE based on the formula: ip = ip + iv * si

If the position results greater than/minor than the software limit switches parametrized in the predefined variables max_str(n) and min_str(n) and the predefined variable cam is enabled, the 'crash alarm (lower and upper) is issued.

The Servo (tracking) alarm is handled if enabled via the predefined variable sam

 

SE È ASSEGNATO IA IL COMPORTAMENTO SARÀ IL SEGUENTE:

Se l'accelerazione è maggiore della accelerazione massima parametrizzata nelle variabili predefinite max_acc(n):

* Viene limitata alla accelerazione massima stessa se e solo se la variabile predefinita acam è abilitata.

* Viene data segnalazione all'utente tramite la variabile predefinita acclm se e solo se la variabile predefinita acam è abilitata.

Viene quindi calcolata da RTE la velocità in base alla formula: iv = iv + ia * si

Se la velocità risulta maggiore della velocità massima parametrizzata nelle variabili predefinite max_spe(n) e l'allarme spam è abilitato, viene emesso l'allarme velocità.

Viene quindi calcolata da RTE la posizione in base alla formula = ip + iv * si

Se la posizione risulta maggiore/minore dei finecorsa software parametrizzati nelle variabili predefinite max_str(n) e min_str(n) e la variabile predefinita cam è abilitata, viene emesso l' allarme crash (lower e upper).

L'allarme servo (inseguimento) viene gestito se abilitato tramite la variabile predefinita sam

end_motion

End of the motion block

aux

In the aux fields of each RULE typically all those boundary conditions necessary to manage the process are expressed.

The order in which the aux, motion blocks are written is free and determines their order of execution

end_aux

End of aux block

Validità

Rule

Note

The ref block, if any, must be the first block in the rule.

There is no limit to the number of aux blocks within a rule block.

You cannot have more than one motion block, nor more than one ref block.

The declaration of formulas will use the normal instructions of the R3 language

 

  

Keyboard Navigation

F7 for caret browsing
Hold ALT and press letter

This Info: ALT+q
Page Header: ALT+h
Topic Header: ALT+t
Topic Body: ALT+b
Contents: ALT+c
Search: ALT+s
Exit Menu/Up: ESC