Project

General

Profile

Bug #8318

I2 doesn't set I:EOB20 correctly?

Added by Phil Adamson over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
High
Target version:
Start date:
04/13/2015
Due date:
% Done:

0%

Estimated time:
4.00 h
Spent time:
Duration:

Description

It looks like I:EOB20 is set to the end of the 8 GeV CAPDEP rather than the end of flat top (presumably dating back to the deceleration days). Please fix.


Related issues

Related to Main Injector MECAR Application (PA1665, I2) - Feature #8385: Remove all $20 cycle deceleration codeClosed04/21/2015

History

#1 Updated by Kyle Hazelwood over 4 years ago

  • Status changed from New to Assigned
  • Assignee set to Kyle Hazelwood
  • Estimated time set to 4.00 h

#2 Updated by Kyle Hazelwood over 4 years ago

Yes, PA1665 does set the $20 timers differently. A good portion of pa1665 > ramp.cpp are methods for setting $20 timers differently.

pa1665 > ramp.cpp > ramp_send() line 718 - 756

if (r->hdr.tclk == 0x20) {  /* deceleration cycle */
    times[7] = ncs.slot[ncs.hdr.num_slots-1].t;
    if (ncs.slot[(int)ncs.p1.ncs_rampup_slot].p == 
        ncs.slot[(int)ncs.p1.ncs_fltop_slot].p) {
        /* just take some numbers */
        for (i = 0; i < 7; i++) times[i] = i * times[7] / 7;
    }
    else {
        times[0] = ncs.slot[(int)ncs.p1.ncs_rampup_slot].t;
        times[1] = ncs.slot[(int)ncs.p1.ncs_fltop_slot].t;
        /* D0,D1,D2 */
        times[2] = times[1] + rampp.par.prepare_offset;
        times[3] = ncs.slot[(int)ncs.p1.ncs_rampdown_slot].t;
        times[4] = ncs.slot[(int)ncs.p1.ncs_rampdown_end_slot].t; 
        times[6] = times[7];
        times[5] = times[6] - end_abort;
    }
    sts = r_20_timers_rw(SET,times);
}
else {
    if (ncs.slot[(int)ncs.p1.ncs_rampup_slot].p == 
        ncs.slot[(int)ncs.p1.ncs_fltop_slot].p) {
        times[3] = ncs.slot[ncs.hdr.num_slots-1].t- end_abort_8gev;
        times[2] = times[3] - end_abort_8gev;
        times[1] = times[2] - end_abort_8gev;
        times[0] = times[1] - end_abort_8gev;
    }
    else {
        times[0] = ncs.slot[(int)ncs.p1.ncs_rampup_slot].t;
        times[1] = ncs.slot[(int)ncs.p1.ncs_fltop_slot].t;
        times[3] = ncs.slot[(int)ncs.p1.ncs_rampdown_slot].t;
        times[2] = times[3] - end_abort;
    }
    times[4] = ncs.slot[ncs.hdr.num_slots-1].t;

    /*10/22/13 block sending to timers when operating on MECARb */ 
    if (pgm.crate == 0) sts = r_timers_rw(SET,cyc,times);
}

For the 8GeV $20 cycles the total cycle time is split by 7 just to fill the table (potential future bug). For ramped $20 cycles times[6] represents I:EOB20 which is set to times[7] which itself was set to the time of the last ramp slot (in this case 8 GeV CAPDEP but not necessarily so). For non-$20 cycles times times[3] represents I:E0BXX and is set to the ramp down slot (the 120 GeV CAPDEP given by ncs.slot[(int)ncs.p1.ncs_rampdown_slot].t).

If we plan to use the $20 operationally I would suggest removing all unique code for the $20 in PA1665. This would'nt be that difficult considering the methods already exist to handle any cycle id.

One thing to check before we do this is: PA1665 does not allow timers to be set when it is connected to MECARB with an exception for the $20 cycle. I'll have to ask Kevin Martin whether this is intentional for testing purposes.

#3 Updated by Kyle Hazelwood over 4 years ago

  • Status changed from Assigned to Resolved

I've changed PA1665 to set I:EOB20 to the ramp down slot time. This is how the other cycles end of beam parameters are set. This is only temporary, I would like to remove all the unique $20 code from PA1665 in the future.

#5 Updated by Kyle Hazelwood over 4 years ago

  • Target version set to 1.1

#6 Updated by Kyle Hazelwood over 4 years ago

As a side note: When PA1665 sets the total cycle time it sends out the total ramp length to T_RAMPXX. The readback for T:RAMPXX always shows an additional 30 mS, this is the number that appears in the PA1665 > RAMP $XX > TIMERS window even though the actual value in the db table is T:RAMPXX - 30 mS (T_RAMPXX).

#7 Updated by Kyle Hazelwood over 4 years ago

  • Status changed from Resolved to Closed

#8 Updated by Kyle Hazelwood over 4 years ago

  • Related to Feature #8385: Remove all $20 cycle deceleration code added


Also available in: Atom PDF