Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info
titleRevision Info

This page currently corresponds to the Ns=83 90 revision of the MCode.

Global Variable Declarations

...

  • Wiki Markup
    *Se* \- Pulse Picker mode \[Se\]lect. Refer to Mode List for a complete list of Se modes.
  • Sd - Status indicator register. Used for debugging. Refer to Status List for a complete list of statuses.
  • Wiki Markup
    *Sw* \- \[Sw\]eep distance. Number of motor steps to equal 11.25 degrees of motion.
  • Sr - Encoder sweep distance. Number of encoder steps to equal 11.25 degrees of motion.
  • Wiki Markup
    *Dr* \- Encoder \[Dr\]ift, or the difference between the encoder count the predicted encoder position.
  • Wiki Markup
    *Dl* \- Encoder \[D\]rift \[L\]imit, Ud or Ld flags will be raised if encoder drift \[Dr\] exceeds this limit
  • P0 - Center (open) position, in motor steps.
  • P1 - Positive closed position, in motor steps, nominally P0+Sw. (Repurposed from standard MCode program.)
  • P2 - Negative closed position, in motor steps, nominally P0-Sw.
  • N0 - Center (open) position, in encoder counts.
  • N1 - Positive closed position, in encoder counts, nominally N0+Sr.
  • N2 - Negative closed position, in encoder counts, nominally N0-Sr.
  • Ec - Error checking flag. (0=OFF, 1=ON)
  • Ns - Pulse Picker MCode version. (Repurposed from standard MCode program.)
  • Hb - Heartbeat counter, incremented approx. every 100ms.
  • Cs - Encoder counter shadow register (=C2)
  • Ud - Drift violation , motor drifting in + direction (0= NO ERROR, 1=VIOLATION)counter, incremented at each + limit violation
  • Ld - Drift violation , motor drifting in - direction (0=NO ERROR, 1=VIOLATION)counter, incremented at each - limit violation
  • Df - Motor position flag (see interpretation below)
  • Mo - Experimentally-determined magic offset, in motor steps, that is the distance between the negative side of the homing index mark and P1. This number will be negative so that it feeds directly into an MR command. This has no initializer and depends on being correctly set by the engineer!

...

  • If Df==1 (position is positive closed position), then
    • Let Dr=N1-Cs, such that Dr is positive if the motor is slipping (missing steps while traveling in the positive direction)
    • If Dr >= Dl (drift limit), then
      • Set Ld=Ld+1, indicating a Increment Ld drift limit violation in the negative directioncounter
    • EndIf
  • EndIf
  • Return

Drift Check at Negative Closed Position (X9)

  • If Df==-1 (position is negative closed position), then
    • Let Dr=Cs-N2, such that Dr is positive if the motor is slipping (missing steps while traveling in the negative direction)
    • If Df >= Dl (drift limit), then
      • Set Ud=Ud+1, indicating a Increment Ud drift limit violation in the positive directioncounter
    • EndIf
  • EndIf
  • Return

Mode/State Tables

...

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="bbcd339c135f0ed0-ad07e335-40404998-aefeab59-910db2945ccfbd1cb36f03d0"><ac:plain-text-body><![CDATA[

Var

Value [step/s(^2)]

[deg/s(^2)]

[rev/s(^2)]

]]></ac:plain-text-body></ac:structured-macro>

VI

5300

1192.5

3.3125

VM

156250

35156

97.656

A

1875000

421880

1171.9

D

1875000

421880

1171.9

...

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="2cc3ac68142fff81-c8952496-46774725-bda7b6a6-6dbf7ab5aa5c3cf2b9b8496a"><ac:plain-text-body><![CDATA[

Var

Value [step/s(^2)]

[deg/s(^2)]

[rev/s(^2)]

]]></ac:plain-text-body></ac:structured-macro>

VI

640

144

0.4

VM

2560

576

1.6

A

640

144

0.4

D

640

144

0.4