Changeset 951


Ignore:
Timestamp:
Jun 20, 2012 12:50:50 PM (10 years ago)
Author:
mooney
Message:

Added div-by-N

File:
1 edited

Legend:

Unmodified
Added
Removed
  • softGlue_examples/source/motor_accel_gate/index.rst

    r922 r951  
    1616
    1717One common way to implement a fly scan is to trigger a detector with motor
    18 pulses.  You might want the detector to acquire on every M\ :sup:`th` pulse, for example,
    19 and this circuit assumes the detector can be configured to do that, if needed.
    20 (If it cannot, the circuit could easily be modified to do the division by M.)
    21 But you might want motor pulses from the acceleration and deceleration portions
    22 of a move to be ignored, and to acquire only while the motor is moving at
    23 constant speed.  This circuit handles that part of the problem.
     18pulses.  You might want the detector to acquire on every :math:`N^{th}` pulse,
     19for example, but to refrain from acquiring during the acceleration and
     20deceleration portions of a move.  That's what this circuit does.
    2421
    2522If you know the number of steps a stepper motor will move during its
     
    3128.. math:: N_a = ((VBAS + VELO)/2) \times (ACCL / MRES)
    3229
    33 where, ``VBAS``, ``VELO``, ``ACCL``, and ``MRES`` are motorRecord fields.
     30where, :math:`VBAS`, :math:`VELO`, :math:`ACCL`, and :math:`MRES` are
     31motorRecord fields.
    3432
    35 The number of constant-speed steps, N\ :sub:`c`, is then
     33The number of constant-speed steps, :math:`N_c`, is then
    3634
    3735.. math:: N_c = ((VAL_{end}-VAL_{start})/MRES) - 2N_a
    3836
    39 where ``VAL``\ :sub:`end` and ``VAL``\ :sub:`start` are the final and initial
     37where :math:`VAL_{end}` and :math:`VAL_{start}` are the final and initial
    4038values of the motorRecord ``VAL`` field.
    4139
     
    4745        :width: 100%
    4846
    49 This circuit accepts negative-going motor pulses at input signal 1,
    50 gates out the first 11 (the value of ``DnCntr-1_PRESET``), and from then on
    51 sends motor pulses to output pin 17 until a total of 31 (the value of
    52 ``DnCntr-2_PRESET``) have been sent. Thus, the detector would see only the 20
    53 pulses that occurred while the motor was moving at constant speed.  The circuit
    54 is reset by writing ``1!`` (positive-going pulse) to the input of ``BUF-1``.
     47This circuit accepts negative-going motor pulses at input signal 1, inverts
     48them, gates out the first :math:`N_a` (the value of ``DnCntr-1_PRESET``), and
     49from then on sends pulses to a divide-by-N circuit, until a total of
     50:math:`N_a+N_c` (the value of ``DnCntr-2_PRESET``) have been sent. The
     51divide-by-N sends every :math:`N^{th}` rising edge to output pin 17.  Thus, the
     52detector would see only the :math:`(N_a+N_c)/N` divided pulses that occurred
     53while the motor was moving at constant speed.  The circuit is reset by writing
     54``1!`` (positive-going pulse) to the input of ``BUF-1``.
    5555
    5656Down counter ``DnCntr-1``, and flipflop ``DFF-1``, together produce a gate
Note: See TracChangeset for help on using the changeset viewer.