# Changeset 951 for softGlue_examples

Ignore:
Timestamp:
Jun 20, 2012 12:50:50 PM (11 years ago)
Message:

 r922 One common way to implement a fly scan is to trigger a detector with motor pulses.  You might want the detector to acquire on every M\ :sup:th pulse, for example, and this circuit assumes the detector can be configured to do that, if needed. (If it cannot, the circuit could easily be modified to do the division by M.) But you might want motor pulses from the acceleration and deceleration portions of a move to be ignored, and to acquire only while the motor is moving at constant speed.  This circuit handles that part of the problem. pulses.  You might want the detector to acquire on every :math:N^{th} pulse, for example, but to refrain from acquiring during the acceleration and deceleration portions of a move.  That's what this circuit does. If you know the number of steps a stepper motor will move during its .. math:: N_a = ((VBAS + VELO)/2) \times (ACCL / MRES) where, VBAS, VELO, ACCL, and MRES are motorRecord fields. where, :math:VBAS, :math:VELO, :math:ACCL, and :math:MRES are motorRecord fields. The number of constant-speed steps, N\ :sub:c, is then The number of constant-speed steps, :math:N_c, is then .. math:: N_c = ((VAL_{end}-VAL_{start})/MRES) - 2N_a where VAL\ :sub:end and VAL\ :sub:start are the final and initial where :math:VAL_{end} and :math:VAL_{start} are the final and initial values of the motorRecord VAL field. :width: 100% This circuit accepts negative-going motor pulses at input signal 1, gates out the first 11 (the value of DnCntr-1_PRESET), and from then on sends motor pulses to output pin 17 until a total of 31 (the value of DnCntr-2_PRESET) have been sent. Thus, the detector would see only the 20 pulses that occurred while the motor was moving at constant speed.  The circuit is reset by writing 1! (positive-going pulse) to the input of BUF-1. This circuit accepts negative-going motor pulses at input signal 1, inverts them, gates out the first :math:N_a (the value of DnCntr-1_PRESET), and from then on sends pulses to a divide-by-N circuit, until a total of :math:N_a+N_c (the value of DnCntr-2_PRESET) have been sent. The divide-by-N sends every :math:N^{th} rising edge to output pin 17.  Thus, the detector would see only the :math:(N_a+N_c)/N divided pulses that occurred while the motor was moving at constant speed.  The circuit is reset by writing 1! (positive-going pulse) to the input of BUF-1. Down counter DnCntr-1, and flipflop DFF-1, together produce a gate