' ******************************************************************** ' * PIC firmware for Flex * ' * Bow Motor boards * ' * coded by dr.Godfried-Willem Raes * ' * http://www.logosfoundation.org/instrum_gwr/flex/picworks * ' * source code development directory: * ' * Flex_Bbow.bas * ' * Version 1.2 * ' * Proton Compiler version 3.5.8.1 * ' ******************************************************************** ' hardware: Midistep Rev.1, december 2006. (same board as Rotomoton) ' 24.04.2016: Start coding ' Once ready, the code for Flex_Bbow.bas will be a mere copy of this, ' with only the constants changed. ' 25.04.2016: First sketch compiles o.k. ' tests: frequency generator with Timer3 does work fine. ' laukhuff PWM o.k. as well ' To do: add coding for centering bow position ' add code for sensor reading. ' 26.04.2016: BowPos monitoring with e and Pi added ' ADC added for reading a Penny & Giles sensor ' Instead of a Penny and Giles, a Murata SCA121T-D07 can be used as well ' To do: make sure incompatible note-on's exclude each other ' calculate lookup for the motor speed done 27.02 ' add lights. ' implement accelleration curves ' 27.04.2016: Motor speed lookup added ' To do: intercept midi for the blade motors, so that we know the blade ' position in this code. ' 25.05.2016: First test on the actual assembly. ' no response... ' bug 1: motor wiring wrong. This bug now solved. ' bug 2: does not repond to all notes off nor power down. Relates to bug 3 ' bug 3: e-Pi works only once... causes endless loop somewhere... ' Motor running file cw/cww, but needs ramping on accellerations ' 26.05.2016: assembler crash... symbol not previously defined (PBP#VAR0HH) ' as soon as we pwm the laukhuff's the PIC seems to crash. ' lowering the pwm frequency seems to improve the situation ' adc is not working properly. ' Sampling rate bit was'nt toggling..., reading the high byte of TMR0 seems not working. ' solved by introducing a new counter byte and sstg bit ' TO DO: add speed ramping for motor ' improve bow movement. ' 27.05.2016: Minforce variable added and mapped on ctrl 40 ' the default value on startup stored in Minforce_default ' AttackForce added and mapped on ctrl 41 ' Motor ramping added using the variables MotSpeed and SollSpeed ' This be version 1.0 ' File for the back bow created. ' Further improvement on bowpositioning code implemented. ' Hysteresis controller added. ' 04.06.2016: Compiler upgraded to Proton 3.5.8.1 ' computer newly installed and configured. ' 19.06.2016: Work on firmware taken up again. ' 20.06.2016: a full day of development of the bow movement coding. ' this version works arleady reasonably well. ' 21.06.2016: modify ramping code such that we can change the ramping speed with a controller ' and using timers instead of having this code in the main loop. ' Ramping curve changed (Dur5[] lookup. ' Suffering from motor stalling now... Some oil on the bearings solved this issue. ' Minforce variable and controller removed. ' Hysteresis variable and controller removed. ' Check out whether using 8 bits for the sensor wouln't make the movement less shaky. Include "18F2525.inc" 'version for the Flex boards. (40MHz) 'Include "18F2520.inc" 'also possible. (40MHz) Clear ' Mapping defines for midi-events on pin outputs and inputs: ' IB106 motor controller: $define mot_klok PORTA.5 ' generated in the Timer3 interrupt $define mot_dir PORTC.0 ' cw/cww $define mot_nc PORTC.3 ' not used $define mot_enable PORTA.4 ' 0= enable, 1= disable ' Laukhuff solenoid: $define Pi_blade PORTC.1 ' PWM port HPWM 2 $define e_blade PORTC.2 ' PWM port HPWM 1 ' Mosfet outputs: $define clutch PORTB.4 ' dc solenoid brake - not yet mounted. $define Lite1 PORTB.3 ' lamp 1 $define Lite2 PORTB.2 ' lamp 2 $define Lite3 PORTB.1 ' lamp 3 $define Lite4 PORTB.0 ' lamp 4 ' inputs: $define sensor1 PORTA.0 ' sensor left - for tilt sensor we use only this one Y-channel $define sensor2 PORTA.1 ' sensor right - X-channel - not used. $define sensor3 PORTA.2 ' not used $define sensor4 PORTA.3 ' not used ' LED's: $define BlueLed PORTC.4 ' lites on when bow is against Pi-blade $define RedLed PORTC.5 ' lites on when bow is against e-blade ' when both are ON, the bow is in a center position $define Debug_Led PORTB.5 ' for testing - yellow led - watchdog 'Declare All_Digital = True ' makes all analog pins, digital for I/O Clear SSPCON1.5 ' make sure RC3 is free for use. ' configure the input and output pins: TRISA = %11000011 'bits set to 0 are output, 1 = input - bits 6 and 7 are the clock! TRISB = %11100000 'bits 6 and 7 are for the ICP, bit 5 is the red LED TRISC = %11000000 'RC6 en RC7 zijn USART I/O and must be set to input Declare Adin_Res = 10 ' 10-bit result required 'Declare Adin_Tad = FRC ' RC oscillator chosen Declare Adin_Stime = 50 ' Allow 50us sample time 'constant definitions: ' midi-mapping for front bow: Symbol fPwm = PWMminF '21000 if we use high frequency here, the PIC crashes due to the EMI. Symbol Bow_cw = 50 '48 for frontbow Symbol Bow_ccw = 51 '49 for frontbow Symbol Bow_Pi = 62 '60 for frontbow Symbol Bow_e = 63 '61 for frontbow Symbol Center = 65 ' 64 for the frontbow Symbol Brake = 67 ' 66 clutch frontbow Symbol Lit_1 = 124 ' lites 120-123 are on the frontbow Symbol Lit_2 = 125 Symbol Lit_3 = 126 Symbol Lit_4 = 127 Symbol True = 1 Symbol False = 0 Symbol Pi = 3 ' used for BowPos monitoring Symbol e = 2 ' if bowpos is 0, the bow position is centered or undefined. 'Symbol MinForce_default = 150 ' startup default value for MinForce, controlled with CC40 - removed 21.06.2016 Symbol AttackForce_default = 240 'CC41 Symbol AttackTime_default = 127 'pointer to the Vels[] lookup table - CC43 'Symbol Hysteresis_default = 3 ' 7 'CC42 20.06.2016 no longer used. Symbol Rampspeed_default = 64 'cc44 'initialisations for the midi input parser: Symbol Midichannel = 12 ' Flex_Channel Symbol NoteOff_Status = 128 + Midichannel ' 2 bytes follow Symbol NoteOn_Status = 144 + Midichannel Symbol Keypres_Status = 160 + Midichannel Symbol Control_Status = 176 + Midichannel Symbol ProgChange_Status = 192 + Midichannel ' 1 byte message Symbol Aftertouch_Status = 208 + Midichannel ' 1 byte follows Symbol Pitchbend_Status = 224 + Midichannel ' lsb msb follow ' Setup the USART Declare Hserial_Baud = 31250 ' Set baud rate for the USART to MIDI specs. Declare Hserial_TXSTA = 0x24 ' instead of the normal 0x20 - ?? 0x24 ' Declare Hserial_Clear = On ' should clear on errors. Bytes get lost of course... ' Create variables: ' Dim Cnt As Dword System '32 bit counter ' Dim CntHw As Cnt.Word1 ' Word System 'used in the timer0 interrupt, where it is incremented Dim CntLw As TMR0L.Word 'this is the trick to read both TMR0L and TMR0H 'it makes Cntlw the low word of cnt, when we use cnt.word0=CntLw ' Dim Tim1 As TMR1L.Word 'not used here ' Dim Tim2 As TMR2 'not used here ' Dim Cnt3 As Dword System ' Dim Cnt3Hw As Cnt3.Word1 Dim Tim3 As TMR3L.Word ' same trick for timer3 ' Dim Sr As TMR0L.7 '512 S/s - this works but these DO NOT WORK!!!: Dim Sampler_Clock As CntLw.7 ' Dim Sr As TMR0H.0 'sampling rate bit, 256 S/s ' DIM Sr as CntLw.8 ' As TMR0H.1 would be 128 S/s ' As TMR0H.2 would be 64 S/s ' As TMR0H.3 would be 32 S/s ' As TMR0H.4 would be 16 S/s Dim Bytein As Byte System ' midi byte read from buffer Dim StBit As Bytein.7 ' highest bit of ByteIn Dim i As Byte System ' general purpose counter ' midi variables Dim statusbyte As Byte System Dim noteUit As Byte System ' note off + release value Dim release As Byte System Dim noteAan As Byte System ' note on + release value Dim velo As Byte System Dim notePres As Byte System ' note pressure + pressure value Dim pres As Byte System Dim Ctrl As Byte System ' continuous controller + value Dim value As Byte System Dim prog As Byte System ' program change + program-byte Dim aft As Byte System ' channel aftertouch Dim pblsb As Byte System ' pitch bend lsb Dim pbmsb As Byte System ' pitch bend msb Dim Velflags As Byte System ' so we can have only 8 tasks Dim CC66 As Byte System ' global on/off switch Dim PowerOn As CC66.0 ' handled on the hub board. Dim notes As Byte System ' notes.7 used for flashing the tungsten lite! Dim BowPos As Byte ' 0=undefined, 2 = e = e-side, 3 = Pi = Pi-side Dim CC30 As Byte System ' repeat freq. controller Dim velo0 As Word System Dim velo1 As Word System ' Dim velo2 As Word System ' Dim velo3 As Word System ' Dim velo4 As Word System ' Dim velo5 As Word System Dim time As Dword System ' 32-bit, incremented in loopcounter Dim maxtim As time.31 ' overflow bit, will cause timer reset after 1h45 Dim t As Byte System ' loopcounter, running at 4 times time-clock Dim tog As Byte System Dim tsamp As Byte System ' increments at 152Hz, so bit 3 should give 19Hz Dim tg As tog.0 ' divide by 4 bit Dim stg As tog.1 ' sampling rate bit 152Hz Dim sstg As tog.2 ' divided sampling rate 19 Hz Dim ssstg As tog.3 ' rate for the bow positioning regulation Dim sssstg As tog.4 ' rate for the motor ramping function Dim TimVals[6] As Dword ' lijst met timer waarden - de kleinste is eerst aan de beurt Dim Nxt As Dword System ' waarde voor de eerstvolgende timer Dim idx As Byte System ' index voor de eerstvolgende timer Dim MotSpeed As Byte System ' actual motor speed Dim SollSpeed As Byte System ' requested motor speed Dim RampSpeed As Byte System ' ramping speed parameter (cc#44) Dim Bow_Pres As Byte System ' 8 bit velo for bow pressure PWM on Laukhuff Dim Period As Word System ' for motor speed in timer3 IRQ Dim sensorval As Word System ' 10 bit value Dim BowPosSensor As Byte System ' 7 bit value for sensor measurement of bow position Dim BowPosMin As Byte System Dim BowPosMax As Byte System Dim BowPosMid As Byte System Dim force As Word System 'Dim MinForce As Byte System ' for code development. Controlled by ctrl 40 Dim Attackforce As Byte System ' cc41 'Dim Hysteresis As Byte System ' cc42 Dim bowerror As SByte System ' signed byte - added 20.06.2016 , range -19 to +19 '----------------------------------------------------------------------------------------- ' Load the USART Interrupt handler and buffer read subroutines into memory Dim Ringbuffer[256] As Byte ' Array for holding received characters Include "Flex_Irq.inc" ' for UART,Timer0, Timer3 Interrupt 'Include "pconfig.inc" ' required for the ADC library 'Include "ADCdefs.inc" ' defines for the ADC library 'Include "ADC.inc" ' load the ADC library ' velocity lookup table Dim Vels[128] As Word ' for Laukhuff solenoid Dim Dur[128] As Word ' duration lookup for repetitions Dim Dur5[128] As Word ' duration lookup for lite flashing repetitions Dim Freqs[128] As Word ' lookup table for motor speeds with Timer3 ' Main program starts here MAIN: High Debug_Led DelayMS 10 ' wait for stability Low Debug_Led Low BlueLed Low RedLed Low Lite1 Low Lite2 Low Lite3 Low Lite4 Low clutch Low mot_klok Low mot_dir ' cw on Low mot_nc High mot_enable ' disable Low sensor3 ' used for debugging only = PortA.2 ' Low sensor4 ' not used ' MinForce = MinForce_default ' Hysteresis = Hysteresis_default Attackforce = AttackForce_default RampSpeed = Rampspeed_default HPWM 1, 0, fPwm ' solenoid Pi-side HPWM 2, 0, fPwm ' solenoid e-side Clear notes Clear Velflags Set TimVals ' no timers running on startup Clear CC66 ' power off Clear BowPos ' this should cause the bows to center after power on MotSpeed = 1 SollSpeed =1 Init_Usart_Interrupt ' Initiate the USART serial buffer interrupt ' this procedure is in the include file Clear_Serial_Buffer ' Clear the serial buffer and reset its pointers ' in the include as well ' Configure Timer0 for: ' Clear TMR0L and TMR0H registers ' Interrupt on Timer0 overflow ' 16-bit operation ' Internal clock source 40MHz ' 1:256 Prescaler : thus 40MHz / 256 = 156.250kHz ' 6.4 us per clock-tick ' Opentimer0 (Timer_INT_On & T0_16BIT & T0_SOURCE_INT & T0_PS_1_256) ' replacing above macro with in-line coding: Clear T1CON Clear IntConBits_T0IF ' clear interrupt flag Set INTCONBITS_T0IE ' enable interrupt on overflow T0CON = %10000111 ' bit 7 = enable/disable ' bit 6 = 1=8 bot, 0=16 bit ' bit 5 = 1 pin input, 0= Internal Clk0 ' bit 4 = HL or LH transition when bit5 =1 ' bit 3 = 1= bypass prescaler, 0= input from prescaler ' bit 2-0 = prescaler select: 111= 1:256 ' Setup the High priorities for the interrupts ' TIMER1: if enabled, all midi-in is blocked, so it must interfere with the UART ' Configure Timer1 for: ' Clear TMR1L and TMR1H registers ' Interrupt on Timer1 overflow ' 16-bit read/write mode ' Internal clock source ' 1:8 Prescaler ' OpenTimer1(TIMER_INT_ON & T1_16BIT_RW & T1_SOURCE_INT & T1_PS_1_8) ' dit kompileert o.k. ' TIMER2: if enabled, the UART stops working... ' Opentimer2 (Timer_Int_On & T2_POST_1_16 & T2_PS_1_16) ' dit lukt... maar de timer is nodig voor de UART... ' TIMER3: ' Configure Timer3 for: ' Interrupt on Timer3 overflow ' 16-bit read/write mode ' Internal clock source ' 1:8 Prescaler ' Dont sync external clock input ' doing it this way seems to work: Clear T3CON Clear PIR2BITS_TMR3IF ' clear IRQ flag Set PIE2BITS_TMR3IE ' irq on Clear Tim3 ' Clear TMR3L And TMR3H registers Set RCONbits_IPEN ' Enable priority interrupts Clear IPR2bits_TMR3IP ' Set Timer3 as a low priority interrupt source ' we can also set T3Con in one instruction as: T3CON = %10110001 ' oef, now it works... ' bit 7 = 16 bit mode ' bit 6,3 = 0, 0 ' bit 5,4 = 1:8 prescale ' bit 2 = 0 ' bit 1 = 0 Internal clock = Fosc/4 ' bit 0 : 1= enable timer 3, 0= disable ' maximum count = 52.42ms, 1 tick =0.8uS, freq.=19Hz ' Set up priority interrupts. ' IPR1bits_TMR1IP = 0 ' Set Timer1 as a low priority interrupt source ' INTCONbits_PEIE = 1 ' Enable peripheral interrupts ' INTCONbits_GIE = 1 ' Enable global interrupts ' Open the ADC: ' Fosc/32 ' Right justified for 10-bit operation ' Tad value of 0 ' Vref+ at Vcc : Vref- at Gnd ' Make AN0 an analogue input ' OpenADC(ADC_FOSC_32 & ADC_RIGHT_JUST & ADC_0_TAD, ADC_REF_VDD_VSS, ADC_1ANA) ADCON2 = %10000010 ' right justified,0_TAD, Fosc/32 ADCON1 = %00001110 ' A0 is analog input ADCON0 = %00000001 ' bits 5-2 =0 selects A0 , bit 1 is the ready bit. Can be read. ' sensorval = ReadADC 0 ' initialize with the value on startup - 10 bit resolution sensorval = ADIn 0 BowPosMin = 35 '127 ' minimum should go around 35 1.375V BowPosMax = 73 '0 ' maximum should go around 73 2.866V BowPosMid = 54 '49 ' 2.120V BowPosSensor = sensorval >> 3 ' reduce to 7-bit GoSub Dur_Lookup GoSub Vels_Lookup GoSub Freq_Lookup ' start the main program loop: LOOP: ' Create an infinite loop Inc t ' byte If t.1 = tg Then Btg tg Inc time ' dword EndIf Bytein = HRSIn ' Read data from the serial buffer, with no timeout ' Start the midi parser. Midi_Parse: If Bytein > Pitchbend_Status Then ' here higher statusses are not implemented. If Bytein > 253 Then '254 = midiclock, 255= reset 'midiclock can interrupt all other msg's... '255 had to be intercepted since thats what we 'get when no new byte flows in. Else Clear statusbyte 'reset the status byte End If GoTo Check_Timers 'throw away... EndIf If StBit =1 Then 'should be faster than If Bytein > 127 Then 'status byte received, bit 7 is set Clear statusbyte 'if on another channel, the statusbyte needs a reset Select Bytein 'eqv to Select case ByteIn Case NoteOff_Status statusbyte = Bytein Set noteUit 'reset value. Cannot be 0 !!! Set release '0 is a valid midi note! Case NoteOn_Status statusbyte = Bytein Set noteAan '= 255 Set velo '= 255 Case Keypres_Status statusbyte = Bytein notePres = 255 pres = 255 Case Control_Status ' controllers and switches statusbyte = Bytein Set Ctrl Set value Case ProgChange_Status ' could be used for different lookup tables statusbyte = Bytein prog = 255 Case Aftertouch_Status ' for fingered vibrato, freq.changes during notes statusbyte = Bytein Set aft Case Pitchbend_Status ' not on this board. statusbyte = Bytein pblsb = 255 pbmsb = 255 End Select Else 'midi byte is 7 bits Select statusbyte Case 0 'not a message for this channel GoTo Check_Timers 'disregard Case NoteOff_Status If noteUit = 255 Then noteUit = Bytein Else release = Bytein 'message complete, so we can do the action... Select noteUit Case Bow_cw ' note 50 strijkstok motor 'Clear T3CONBITS_TMR3ON ' stop timer 3 Set mot_enable ' disable MotSpeed = 1 SollSpeed = 1 Clear notes.6 Clear Velflags.2 Set TimVals[2] Case Bow_ccw ' note 51 strijkstok motor 'Clear T3CONBITS_TMR3ON ' stop timer 3 Set mot_enable ' disable MotSpeed = 1 SollSpeed = 1 Clear notes.7 Clear Velflags.2 Set TimVals[2] Case Bow_Pi ' note 62 Pi side HPWM 1, 0, fPwm ' release laukhuff BowPos = 0 ' will center bow Clear notes.0 Set TimVals[0] Case Bow_e ' note 63 e-side HPWM 2, 0, fPwm BowPos = 0 Clear notes.1 Set TimVals[1] Case Center ' note 65 Clear notes.0 Clear notes.1 Clear BowPos ' stop motor! Set mot_enable 'stop motor Clear notes.6 Clear notes.7 MotSpeed =1 SollSpeed =1 Set TimVals[2] Clear Velflags.2 Case Brake ' note 67 Clear clutch Set mot_enable ' disable bow motor Clear notes.0 Clear notes.1 Clear notes.3 Clear notes.6 Clear notes.7 Clear BowPos Set TimVals[2] Clear Velflags.2 Case Lit_1 ' 124 Clear Lite1 Case Lit_2 Clear Lite2 Case Lit_3 Clear Lite3 Case Lit_4 Clear Lite4 End Select Set noteUit '= 255 'reset GoTo resort EndIf GoTo Check_Timers Case NoteOn_Status If noteAan = 255 Then noteAan = Bytein Else velo = Bytein If velo = 0 Then Select noteAan Case Bow_cw ' note 50 'Clear T3CONBITS_TMR3ON ' stop timer 3 Set mot_enable MotSpeed = 1 SollSpeed = 1 Clear notes.6 Clear Velflags.2 Set TimVals[2] Case Bow_ccw ' note 51 'Clear T3CONBITS_TMR3ON ' stop timer 3 Set mot_enable MotSpeed = 1 SollSpeed = 1 Clear notes.7 Clear Velflags.2 Set TimVals[2] Case Bow_Pi ' note 62 HPWM 1, 0, fPwm ' release laukhuff Clear BowPos Clear notes.0 Set TimVals[0] Case Bow_e ' note 63 HPWM 2, 0, fPwm Clear notes.1 Clear BowPos Set TimVals[1] Case Center ' note 65 ' does it make sense to do anything on center note-off? Clear notes.0 Clear notes.1 Clear BowPos Set mot_enable 'stop motor Clear notes.6 Clear notes.7 MotSpeed =1 SollSpeed =1 Clear Velflags.2 Set TimVals[2] Case Brake ' note 67 Clear clutch Set mot_enable Clear notes.0 Clear notes.1 Clear notes.3 Clear notes.6 Clear notes.7 Clear BowPos Clear Velflags.2 Set TimVals[2] MotSpeed = 1 SollSpeed = 1 Case Lit_1 Clear Lite1 Case Lit_2 Clear Lite2 Case Lit_3 Clear Lite3 Case Lit_4 Clear Lite4 Case Else GoTo Check_Timers End Select GoTo resort Else Select noteAan Case Bow_cw ' note 50 backbow motor clockwize ' the velo byte should set the motor speed SollSpeed = velo If notes.7 = 1 Then 'if direction of rotation has changed Clear notes.7 'we must ramp from zero again MotSpeed = 1 EndIf ' code with ramping function If PowerOn = 1 Then 'Clear T3CONBITS_TMR3ON ' stop timer 3 Period = Freqs[MotSpeed] ' set to the actual motor speed now 'Set T3CONBITS_TMR3ON ' restart timer Clear mot_dir ' run cw Clear mot_enable ' enable motor Set notes.6 ' here we set a timer to control the ramping speed ' the timer runs out when motspeed equals sollspeed TimVals[2] = time + Dur5[RampSpeed] Set Velflags.2 EndIf Case Bow_ccw ' 51 backbow motor counterclockwize SollSpeed = velo If notes.6 = 1 Then Clear notes.6 MotSpeed = 1 EndIf If PowerOn = 1 Then 'Clear T3CONBits_TMR3ON Period = Freqs[MotSpeed] 'Set T3CONBITS_TMR3ON Set mot_dir ' run ccw Clear mot_enable ' enable motor Set notes.7 TimVals[2] = time + Dur5[RampSpeed] Set Velflags.2 EndIf Case Bow_Pi ' 62 Bow_Pres = velo << 1 ' make 8-bits Set notes.0 Clear notes.1 Clear clutch Clear notes.3 BowPos = Pi ' soll position ' start a timer to move the bow to the Pi side with full force HPWM 2, 0, fPwm HPWM 1, Attackforce, fPwm ' full force , ca.30V - attackforce is ctrl.#41 Set Velflags.0 TimVals[0] = time + Vels[velo0] 'controlled with #43 Case Bow_e ' 63 Bow_Pres = velo << 1 Clear notes.0 Set notes.1 Clear notes.3 Clear clutch BowPos = e HPWM 1, 0, fPwm HPWM 2, Attackforce, fPwm Set Velflags.1 TimVals[1] = time + Vels[velo1] 'controlled with #43 Case Center ' this requires a task in the main loop ' as reading the sensor is required. Clear notes.0 Clear notes.1 Clear BowPos ' this will cause the centering procedure in the main loop to start ' stop motor! Set mot_enable 'stop motor Clear notes.6 Clear notes.7 MotSpeed =1 SollSpeed =1 Clear Velflags.2 Set TimVals[2] Case Brake Clear notes.0 Clear notes.1 Set notes.3 ' stop motor! Set mot_enable 'stop motor Clear notes.6 Clear notes.7 MotSpeed =1 SollSpeed =1 Clear BowPos ' will move the bow to center and once there, activate the clutch 'Set clutch ' happens in the main loop Clear Velflags.2 Set TimVals[2] Case Lit_1 Set Lite1 Case Lit_2 Set Lite2 Case Lit_3 Set Lite3 Case Lit_4 Set Lite4 Case Else Set noteAan GoTo Check_Timers End Select Set noteAan '= 255 GoTo resort EndIf EndIf GoTo Check_Timers Case Keypres_Status If notePres = 255 Then notePres = Bytein Else pres = Bytein GoSub KeyPres GoTo resort ' changing motspeed requires timers! EndIf GoTo Check_Timers Case Control_Status 'this is where the action takes place for controllers If Ctrl = 255 Then Ctrl = Bytein Else value = Bytein GoSub Controller EndIf GoTo Check_Timers Case ProgChange_Status ' not used for Flex If prog = 255 Then 'single byte message prog = Bytein GoSub ProgChange EndIf GoTo Check_Timers Case Aftertouch_Status ' not used for flex If aft = 255 Then aft = Bytein GoSub Aftertouch EndIf GoTo Check_Timers End Select EndIf resort: GoSub SortTimers ' so we resort only if an incoming midi command changed something Check_Timers: If idx < 6 Then ' we moeten alleen checken wanneer er een timer loopt If time >= Nxt Then ' nagaan of de eerstvolgende timer afgelopen is... ' in dit geval is de eerste timer afgelopen en moeten we de juiste aktie ondernemen: Set Nxt.31 ' timer reset, is immers afgelopen ' aan de hand van idx weten we welke timer dit is Select idx Case 0 ' note Bow_Pi Laukhuff solenoid If notes.0 = 0 Then ' note off received for Pi-bow HPWM 2, 0, fPwm HPWM 1, 0, fPwm Else ' note is active HPWM 2, 0, fPwm HPWM 1, Bow_Pres, fPwm ' velo-programmed force 'BowPos = Pi EndIf Set TimVals[0] ' cancel timer Clear Velflags.0 Case 1 ' note Bow_e Laukhuff If notes.1 = 0 Then ' note off received for e-bow HPWM 1,0, fPwm ' note off HPWM 2,0, fPwm Else ' note is active HPWM 1, 0, fPwm HPWM 2, Bow_Pres, fPwm ' velo-programmed force 'BowPos = e EndIf Set TimVals[1] ' cancel timer Clear Velflags.1 Case 2 ' used for ramping of the motor Select MotSpeed Case SollSpeed 'cancel timer as the motor is running at the requested speed Set TimVals[2] Clear Velflags.2 Period = Freqs[MotSpeed] Case < SollSpeed Inc MotSpeed 'Clear T3CONBITS_TMR3ON ' stop timer 3 Period = Freqs[MotSpeed] ' set to the increased motor speed now 'Set T3CONBITS_TMR3ON ' restart timer 3 TimVals[2] = time + Dur5[RampSpeed] Set Velflags.2 Case > SollSpeed Dec MotSpeed 'Clear T3CONBITS_TMR3ON ' stop timer 3 Period = Freqs[MotSpeed] ' set to the increased motor speed now 'Set T3CONBITS_TMR3ON ' restart timer 3 TimVals[2] = time + Dur5[RampSpeed] Set Velflags.2 End Select Case 3 ' this never sets a timer, so we do not have to handle it here. Set TimVals[3] Clear Velflags.3 Case 4 Clear clutch Set TimVals[4] Clear Velflags.4 Case 5 Set TimVals[5] Clear Velflags.5 'Case Else ' ' in dit geval is idx geset ' GoTo jumpout End Select GoSub SortTimers ' find a new nxt and idx EndIf ' beveiliging tegen overflow crashes... If maxtim = 1 Then Clear time Clear notes Set TimVals EndIf Else ' idx > 5, no timers running, so to avoid overflows, we can reset the loop timer If maxtim = 1 Then Clear time ' 16.06.2015 EndIf Sampler: ' Sampling the position sensor in the main loop: ' we use timer0 as a source for the sampling rate If Sampler_Clock = stg Then ' sampler_clock = CntLw.7 Btg stg ' = tog.1 Inc tsamp ' byte var EndIf If tsamp.2 = sstg Then '.4 geeft 9.5Hz, .3 geeft 19Hz Tektronix measurement. ' .2 geeft 38Hz - experiment 20.06.2016 Btg sstg ' = tog.2 Btg PORTA.2 ' for debugging (measurement of sampling rate) sensorval = ADIn 0 ' 10-bit value BowPosSensor = sensorval >> 3 ' reduce to 7 bit value ' with integration: ' BowPosSensor = ((BowPosSensor * 7) + (sensorval >> 3) ) >> 3 'seems to give more overshoot ' following code works for dynamic adaptation of the range. ' however it suffers from overshoots on the sensor data ' If BowPosSensor > BowPosMax Then ' BowPosMax = BowPosSensor ' BowPosMid = BowPosMax + BowPosMin ' makes 8 bit ' BowPosMid = BowPosMid >> 1 ' reduce to 7 bit again ' EndIf ' If BowPosSensor < BowPosMin Then ' BowPosMin = BowPosSensor ' BowPosMid = BowPosMax + BowPosMin ' makes 8 bit ' BowPosMid = BowPosMid >> 1 ' reduce to 7 bit again ' EndIf Select BowPosSensor Case < BowPosMid Set RedLed ' bow is on the e-side Clear BlueLed Case > BowPosMid Clear RedLed Set BlueLed ' bow is on the Pi-side Case Else Set RedLed Set BlueLed End Select 'EndIf 'endif for the sampling rate ' procedure to correct the bowposition, running at the sampling rate itself. ' we thought this would actually work better at a much slower rate but that ' revealed untrue: it works better when it runs faster! 'If tsamp.7 = ssstg Then ' .6 gives ca. 2Hz .7 ca. 1Hz ' If tsamp.2 = ssstg Then ' try with ca. 8Hz .4 , or 16Hz .3 ' test op de halve sampling rate (nu ca.38Hz) tsamp.3 ' tsamp.2 = sampling rate ' Btg ssstg If PowerOn = 1 Then ' dont do autoregulation if power is off. GoSub Bow_Positioning EndIf EndIf 'endif for the sampling rate Btg PORTB.0 ' average loop-speed: 10 microseconds or 84kHz (Tektronix measurement, 27.05.2016) ' with glitches ca. 50 microseconds in length. GoTo LOOP SortTimers: 'look up the next smallest timer value in the Timvals array ' zoek de de volgende kleinste timer waarde: Set idx ' makes it 255 Set Nxt.31 ' nxt is set on entry. - for speed, we just set the highest bit For i = 0 To 5 If TimVals[i] < Nxt Then Nxt = TimVals[i] ' 5 dword comparisons idx = i EndIf Next i Return Bow_Positioning: bowerror = BowPosSensor - BowPosMid 'sbyte, if positive the bow is on the Pi side ' if negative it is on the e-side ' new version using quadratic scaling: force = bowerror * bowerror 'always a positive value force = force >> 1 'range 0 to 180 Select Case BowPos 'soll position Case 0 If bowerror > 0 Then 'leaning towards Pi 'so we have to move towards e HPWM 2, force, fPwm HPWM 1, 0, fPwm ElseIf bowerror < 0 Then 'leaning towards e 'so we have to move towards Pi HPWM 2, 0, fPwm HPWM 1, force, fPwm Else HPWM 2, 36, fPwm HPWM 1, 36, fPwm If notes.3 = 1 Then Set clutch EndIf ' bow should move to midpos, away from either sawblade EndIf Case e ' =2 - we want the bow to be on the e-saw If Velflags.1 = 0 Then ' not when a timer is still running If bowerror > 0 Then ' bow is on the Pi side, so we have to move to the e saw force = force + (force >>1) If force > 255 Then force = 255 HPWM 1, 0, fPwm HPWM 2, force ,fPwm Else ' the bow is already on the e-side HPWM 1, 0, fPwm HPWM 2, Bow_Pres, fPwm EndIf EndIf Case Pi '=3 - we want the bow on the Pi-saw If Velflags.0 = 0 Then If bowerror < 0 Then 'bow is on the e-side so we have to move it to the Pi saw force = force + (force >>1) If force > 255 Then force = 255 HPWM 2, 0, fPwm HPWM 1, force, fPwm Else HPWM 1, Bow_Pres, fPwm HPWM 2, 0, fPwm EndIf EndIf End Select Return KeyPres: ' used for bow pressure pwm and motor speed modulation Select notePres Case Bow_cw If notes.6 = 1 Then ' key pressure for motor speed can only be applied if the note is ON SollSpeed = pres ' cw motion If SollSpeed <> MotSpeed Then TimVals[2] = time + Dur5[RampSpeed] Set Velflags.2 EndIf EndIf Case Bow_ccw If notes.7 = 1 Then SollSpeed = pres ' ccw motion If SollSpeed <> MotSpeed Then TimVals[2] = time + Dur5[RampSpeed] Set Velflags.2 EndIf EndIf Case Bow_Pi Bow_Pres = pres << 1 If notes.0 = 1 Then ' apply pressure only if note is ON If BowPos = Pi Then ' and on the condition the bow must go to the Pi side HPWM 1, Bow_Pres, fPwm HPWM 2, 0, fPwm EndIf EndIf Case Bow_e Bow_Pres = pres << 1 If notes.1 = 1 Then If BowPos = e Then HPWM 1, 0 , fPwm HPWM 2, Bow_Pres, fPwm EndIf EndIf EndSelect ' we do need to resort here Set notePres '= 255 Return ProgChange: Set prog '= 255 'this is not realy required Return Pitchbend: Set pblsb Return Aftertouch: 'this is the channel aftertouch, affecting any playing note Set aft ' reset Return Controller: Select Ctrl 'Case 30 ' can be used for global repeat frequency ' Case 40 ' ' mainly used for code and PID development. ' MinForce = value << 1 '0-63 range Case 41 ' for code and PID development Attackforce = 128 + value '128-255 range ' Case 42 ' Hysteresis = value >> 3 ' range 0-15 Case 43 velo0 = value 'steers the duration of the bow attack pulse. Range 1-127 velo1 = value Case 44 RampSpeed = value 'steers the accelleration rate of the motor Case 66 'on/off for the robot If value = 0 Then Clear PowerOn 'CC66.0 =0 GoSub PowerDown Else Set PowerOn 'CC66.0 =1 EndIf Case 123 ' all notes off - no controller resets ' bowpos stays what it is. (?) shouldn't we better reset it? 'Clear Velflags Clear BowPos 'go to center position Clear notes Clear clutch Clear Lite1 Clear Lite2 Clear Lite3 Clear Lite4 Set mot_enable ' disable motor MotSpeed = 1 SollSpeed = 1 End Select Set Ctrl 'mandatory reset Return PowerDown: ' this should also disable the autoregulation of the bow positioning in the main loop. Clear Velflags 'stop all running timers Clear notes Clear BowPos 'undefine position of bow ' clear all velo-bits Clear velo0 Clear velo1 Clear Bow_Pres Clear clutch Set mot_enable HPWM 1, 0, fPwm HPWM 2, 0, fPwm Clear Lite1 Clear Lite2 Clear Lite3 Clear Lite4 Clear mot_klok ' MinForce = MinForce_default ' reset CC40 to default value Attackforce = AttackForce_default ' reset CC41 to default value ' Hysteresis = Hysteresis_default ' reset CC42 to default value velo0 = AttackTime_default ' reset CC43 velo1 = AttackTime_default RampSpeed = Rampspeed_default ' reset CC44 MotSpeed = 1 SollSpeed = 1 Clear CC66 Return Dur_Lookup: 'lookup for Laukhuff solenoid and vibrator repeat frequencies Set Dur[0] ' not used ' durations for note repetition on Chi ' the dur values are for a half period ! ' the frequencies are for the full period. Dur[1]= 23674 ' freq= 2.11202162710146 Dur[2]= 22917 ' freq= 2.18178644674259 Dur[3]= 22548 ' freq= 2.21749157353202 Dur[4]= 22185 ' freq= 2.25377507324769 Dur[5]= 21827 ' freq= 2.29074082558299 Dur[6]= 21475 ' freq= 2.32828870779977 Dur[7]= 21129 ' freq= 2.36641582658905 Dur[8]= 20789 ' freq= 2.40511809129828 Dur[9]= 20454 ' freq= 2.44450963136795 Dur[10]= 20124 ' freq= 2.48459550785132 Dur[11]= 19800 ' freq= 2.52525252525252 Dur[12]= 19481 ' freq= 2.56660335711719 Dur[13]= 19167 ' freq= 2.60865028434288 Dur[14]= 18858 ' freq= 2.65139463357726 Dur[15]= 18554 ' freq= 2.69483669289641 Dur[16]= 18255 ' freq= 2.73897562311695 Dur[17]= 17961 ' freq= 2.7838093647347 Dur[18]= 17672 ' freq= 2.82933454051607 Dur[19]= 17387 ' freq= 2.87571173865532 Dur[20]= 17107 ' freq= 2.92278014847723 Dur[21]= 16831 ' freq= 2.97070881112233 Dur[22]= 16560 ' freq= 3.01932367149758 Dur[23]= 16293 ' freq= 3.06880255324372 Dur[24]= 16030 ' freq= 3.11915159076731 Dur[25]= 15772 ' freq= 3.17017499365965 Dur[26]= 15518 ' freq= 3.22206469905916 Dur[27]= 15268 ' freq= 3.27482315954938 Dur[28]= 15022 ' freq= 3.32845160431367 Dur[29]= 14780 ' freq= 3.382949932341 Dur[30]= 14542 ' freq= 3.43831660019254 Dur[31]= 14307 ' freq= 3.4947927587894 Dur[32]= 14077 ' freq= 3.55189315905378 Dur[33]= 13850 ' freq= 3.6101083032491 Dur[34]= 13627 ' freq= 3.66918617450649 Dur[35]= 13407 ' freq= 3.72939509211606 Dur[36]= 13191 ' freq= 3.79046319460238 Dur[37]= 12978 ' freq= 3.85267375558638 Dur[38]= 12769 ' freq= 3.91573341686898 Dur[39]= 12564 ' freq= 3.97962432346386 Dur[40]= 12361 ' freq= 4.04498017959712 Dur[41]= 12162 ' freq= 4.1111659266568 Dur[42]= 11966 ' freq= 4.17850576633796 Dur[43]= 11773 ' freq= 4.24700586086809 Dur[44]= 11583 ' freq= 4.31667098333765 Dur[45]= 11397 ' freq= 4.38711941739054 Dur[46]= 11213 ' freq= 4.45910996165165 Dur[47]= 11032 ' freq= 4.53226976069616 Dur[48]= 10855 ' freq= 4.60617227084293 Dur[49]= 10680 ' freq= 4.6816479400749 Dur[50]= 10508 ' freq= 4.75827940616673 Dur[51]= 10338 ' freq= 4.83652544012381 Dur[52]= 10172 ' freq= 4.91545418796697 Dur[53]= 10008 ' freq= 4.99600319744204 Dur[54]= 9846 ' freq= 5.07820434694292 Dur[55]= 9688 ' freq= 5.16102394715111 Dur[56]= 9532 ' freq= 5.24548887956357 Dur[57]= 9378 ' freq= 5.33162721262529 Dur[58]= 9227 ' freq= 5.4188793757451 Dur[59]= 9078 ' freq= 5.50782110597048 Dur[60]= 8932 ' freq= 5.59785042543663 Dur[61]= 8788 ' freq= 5.68957669549385 Dur[62]= 8646 ' freq= 5.78302105019662 Dur[63]= 8507 ' freq= 5.87751263665217 Dur[64]= 8370 ' freq= 5.973715651135 Dur[65]= 8235 ' freq= 6.07164541590771 Dur[66]= 8102 ' freq= 6.17131572451246 Dur[67]= 7972 ' freq= 6.27195183140993 Dur[68]= 7843 ' freq= 6.37511156445238 Dur[69]= 7717 ' freq= 6.47920176234288 Dur[70]= 7593 ' freq= 6.58501251152377 Dur[71]= 7470 ' freq= 6.69344042838019 Dur[72]= 7350 ' freq= 6.80272108843537 Dur[73]= 7231 ' freq= 6.91467293597013 Dur[74]= 7115 ' freq= 7.02740688685875 Dur[75]= 7000 ' freq= 7.14285714285714 Dur[76]= 6888 ' freq= 7.25900116144018 Dur[77]= 6777 ' freq= 7.37789582411096 Dur[78]= 6667 ' freq= 7.49962501874906 Dur[79]= 6560 ' freq= 7.62195121951219 Dur[80]= 6454 ' freq= 7.74713356058258 Dur[81]= 6350 ' freq= 7.8740157480315 Dur[82]= 6248 ' freq= 8.00256081946223 Dur[83]= 6147 ' freq= 8.13404912965674 Dur[84]= 6048 ' freq= 8.26719576719577 Dur[85]= 5951 ' freq= 8.40194925222652 Dur[86]= 5855 ' freq= 8.5397096498719 Dur[87]= 5760 ' freq= 8.68055555555555 Dur[88]= 5668 ' freq= 8.82145377558222 Dur[89]= 5576 ' freq= 8.96700143472023 Dur[90]= 5486 ' freq= 9.11410864017499 Dur[91]= 5398 ' freq= 9.26268988514264 Dur[92]= 5311 ' freq= 9.41442289587648 Dur[93]= 5225 ' freq= 9.56937799043062 Dur[94]= 5141 ' freq= 9.72573429293912 Dur[95]= 5058 ' freq= 9.88533017002768 Dur[96]= 4977 ' freq= 10.0462125778581 Dur[97]= 4897 ' freq= 10.2103328568511 Dur[98]= 4818 ' freq= 10.3777501037775 Dur[99]= 4740 ' freq= 10.548523206751 Dur[100]= 4664 ' freq= 10.7204116638079 Dur[101]= 4589 ' freq= 10.8956199607758 Dur[102]= 4515 ' freq= 11.0741971207087 Dur[103]= 4442 ' freq= 11.2561909049977 Dur[104]= 4370 ' freq= 11.441647597254 Dur[105]= 4300 ' freq= 11.6279069767442 Dur[106]= 4231 ' freq= 11.8175372252422 Dur[107]= 4162 ' freq= 12.013455069678 Dur[108]= 4095 ' freq= 12.2100122100122 Dur[109]= 4029 ' freq= 12.4100273020601 Dur[110]= 3964 ' freq= 12.6135216952573 Dur[111]= 3901 ' freq= 12.8172263522174 Dur[112]= 3838 ' freq= 13.0276185513288 Dur[113]= 3776 ' freq= 13.2415254237288 Dur[114]= 3715 ' freq= 13.4589502018842 Dur[115]= 3655 ' freq= 13.6798905608755 Dur[116]= 3596 ' freq= 13.9043381535039 Dur[117]= 3538 ' freq= 14.1322781232335 Dur[118]= 3481 ' freq= 14.3636885952312 Dur[119]= 3425 ' freq= 14.5985401459854 Dur[120]= 3370 ' freq= 14.8367952522255 Dur[121]= 3316 ' freq= 15.0784077201448 Dur[122]= 3262 ' freq= 15.3280196198651 Dur[123]= 3210 ' freq= 15.5763239875389 Dur[124]= 3158 ' freq= 15.8328055731476 Dur[125]= 3107 ' freq= 16.0926939169617 Dur[126]= 3057 ' freq= 16.3559044815178 Dur[127]= 3008 ' freq= 16.6223404255319 'lookup for flashing light: 'here used for ramping speed [21.06.2016] Set Dur5[0] ' not used Dur5[1]= 41667 ' freq= .999992000063999 Dur5[2]= 39494 ' freq= 1.0550125757499 Dur5[3]= 38450 ' freq= 1.08365843086259 Dur5[4]= 37434 ' freq= 1.11307011451265 Dur5[5]= 36445 ' freq= 1.14327525495038 Dur5[6]= 35482 ' freq= 1.17430434210774 Dur5[7]= 34544 ' freq= 1.20619113787247 Dur5[8]= 33631 ' freq= 1.23893629885126 Dur5[9]= 32743 ' freq= 1.27253662360403 Dur5[10]= 31877 ' freq= 1.30710752789367 Dur5[11]= 31035 ' freq= 1.34257021642232 Dur5[12]= 30215 ' freq= 1.37900601246621 Dur5[13]= 29416 ' freq= 1.41646269603844 Dur5[14]= 28639 ' freq= 1.45489251254117 Dur5[15]= 27882 ' freq= 1.49439303732396 Dur5[16]= 27146 ' freq= 1.53490999287802 Dur5[17]= 26428 ' freq= 1.57661066545583 Dur5[18]= 25730 ' freq= 1.61938074880166 Dur5[19]= 25050 ' freq= 1.66333998669328 Dur5[20]= 24388 ' freq= 1.70849051446066 Dur5[21]= 23743 ' freq= 1.75490319953951 Dur5[22]= 23116 ' freq= 1.8025033166061 Dur5[23]= 22505 ' freq= 1.85144042064726 Dur5[24]= 21910 ' freq= 1.90171915411532 Dur5[25]= 21331 ' freq= 1.95333864641445 Dur5[26]= 20768 ' freq= 2.006291730868 Dur5[27]= 20219 ' freq= 2.06076792455941 Dur5[28]= 19685 ' freq= 2.11667090000847 Dur5[29]= 19164 ' freq= 2.17421554303207 Dur5[30]= 18658 ' freq= 2.23317969057062 Dur5[31]= 18165 ' freq= 2.29378842095605 Dur5[32]= 17685 ' freq= 2.35604561304307 Dur5[33]= 17218 ' freq= 2.41994811631239 Dur5[34]= 16763 ' freq= 2.48563304102289 Dur5[35]= 16320 ' freq= 2.5531045751634 Dur5[36]= 15888 ' freq= 2.62252433702585 Dur5[37]= 15469 ' freq= 2.69355916133342 Dur5[38]= 15060 ' freq= 2.76671093404161 Dur5[39]= 14662 ' freq= 2.84181330423316 Dur5[40]= 14274 ' freq= 2.91906029610948 Dur5[41]= 13897 ' freq= 2.99824902257082 Dur5[42]= 13530 ' freq= 3.07957625030796 Dur5[43]= 13172 ' freq= 3.16327563518575 Dur5[44]= 12824 ' freq= 3.24911624038262 Dur5[45]= 12485 ' freq= 3.33733813910025 Dur5[46]= 12155 ' freq= 3.42794460441519 Dur5[47]= 11834 ' freq= 3.52092839840009 Dur5[48]= 11522 ' freq= 3.61627032343922 Dur5[49]= 11217 ' freq= 3.71459986330272 Dur5[50]= 10921 ' freq= 3.81527943106553 Dur5[51]= 10632 ' freq= 3.91898670679709 Dur5[52]= 10351 ' freq= 4.02537597011561 Dur5[53]= 10078 ' freq= 4.13441820467024 Dur5[54]= 9811 ' freq= 4.24693371385859 Dur5[55]= 9552 ' freq= 4.36208821887214 Dur5[56]= 9300 ' freq= 4.48028673835125 Dur5[57]= 9054 ' freq= 4.60201752448273 Dur5[58]= 8815 ' freq= 4.72679145396105 Dur5[59]= 8582 ' freq= 4.85512312592247 Dur5[60]= 8355 ' freq= 4.9870337123479 Dur5[61]= 8134 ' freq= 5.12253094008688 Dur5[62]= 7919 ' freq= 5.26160710527423 Dur5[63]= 7710 ' freq= 5.40423692174665 Dur5[64]= 7506 ' freq= 5.5511146638245 Dur5[65]= 7308 ' freq= 5.70151432220398 Dur5[66]= 7115 ' freq= 5.85617240571562 Dur5[67]= 6927 ' freq= 6.01510995621 Dur5[68]= 6744 ' freq= 6.1783313562673 Dur5[69]= 6565 ' freq= 6.34678852500635 Dur5[70]= 6392 ' freq= 6.51856487275761 Dur5[71]= 6223 ' freq= 6.69559162247576 Dur5[72]= 6059 ' freq= 6.87682235792485 Dur5[73]= 5898 ' freq= 7.06454165253758 Dur5[74]= 5743 ' freq= 7.25520924023449 Dur5[75]= 5591 ' freq= 7.45245334764204 Dur5[76]= 5443 ' freq= 7.65509216730969 Dur5[77]= 5299 ' freq= 7.86311882745172 Dur5[78]= 5159 ' freq= 8.07650061381405 Dur5[79]= 5023 ' freq= 8.29517552591413 Dur5[80]= 4890 ' freq= 8.52079072937969 Dur5[81]= 4761 ' freq= 8.75166281593503 Dur5[82]= 4635 ' freq= 8.98957209636821 Dur5[83]= 4513 ' freq= 9.23258734027624 Dur5[84]= 4393 ' freq= 9.48478640261021 Dur5[85]= 4277 ' freq= 9.74203101862676 Dur5[86]= 4164 ' freq= 10.0064040986231 Dur5[87]= 4054 ' freq= 10.277914816642 Dur5[88]= 3947 ' freq= 10.5565408326999 Dur5[89]= 3843 ' freq= 10.842223956978 Dur5[90]= 3741 ' freq= 11.1378419317473 Dur5[91]= 3642 ' freq= 11.4406004027091 Dur5[92]= 3546 ' freq= 11.7503290092122 Dur5[93]= 3452 ' freq= 12.0702974121282 Dur5[94]= 3361 ' freq= 12.3971040364971 Dur5[95]= 3272 ' freq= 12.7343113284434 Dur5[96]= 3186 ' freq= 13.0780498012136 Dur5[97]= 3102 ' freq= 13.4321942832581 Dur5[98]= 3020 ' freq= 13.7969094922737 Dur5[99]= 2940 ' freq= 14.172335600907 Dur5[100]= 2862 ' freq= 14.5585837409737 Dur5[101]= 2787 ' freq= 14.9503647889008 Dur5[102]= 2713 ' freq= 15.3581521071385 Dur5[103]= 2641 ' freq= 15.7768522024486 Dur5[104]= 2571 ' freq= 16.2064047711656 Dur5[105]= 2504 ' freq= 16.640042598509 Dur5[106]= 2437 ' freq= 17.0975242784845 Dur5[107]= 2373 ' freq= 17.5586458772299 Dur5[108]= 2310 ' freq= 18.037518037518 Dur5[109]= 2249 ' freq= 18.5267526307989 Dur5[110]= 2190 ' freq= 19.0258751902588 Dur5[111]= 2132 ' freq= 19.5434646654159 Dur5[112]= 2076 ' freq= 20.0706486833654 Dur5[113]= 2021 ' freq= 20.616856341745 Dur5[114]= 1967 ' freq= 21.182850364345 Dur5[115]= 1915 ' freq= 21.7580504786771 Dur5[116]= 1865 ' freq= 22.3413762287757 Dur5[117]= 1815 ' freq= 22.9568411386593 Dur5[118]= 1767 ' freq= 23.5804565176382 Dur5[119]= 1721 ' freq= 24.2107301956227 Dur5[120]= 1675 ' freq= 24.8756218905473 Dur5[121]= 1631 ' freq= 25.5466993664418 Dur5[122]= 1588 ' freq= 26.2384550797649 Dur5[123]= 1546 ' freq= 26.9512721000431 Dur5[124]= 1505 ' freq= 27.6854928017719 Dur5[125]= 1465 ' freq= 28.4414106939704 Dur5[126]= 1427 ' freq= 29.1987853305302 Dur5[127]= 1389 ' freq= 29.9976001919846 For i = 0 To 127 Dur5[i] = Dur5[i] >> 3 'so range becomes 8Hz to 240Hz Next i Return Vels_Lookup: ' velo lookup scale for Laukhuff solenoid. Logarithmic ' Vels_Lookup_Laukhuff: Vels[1]= 1160 ' duur= .0116 Vels[2]= 1190 ' duur= .0119 Vels[3]= 1206 ' duur= .01206 Vels[4]= 1222 ' duur= .01222 Vels[5]= 1238 ' duur= .01238 Vels[6]= 1254 ' duur= .01254 Vels[7]= 1270 ' duur= .0127 Vels[8]= 1287 ' duur= .01287 Vels[9]= 1303 ' duur= .01303 Vels[10]= 1320 ' duur= .0132 Vels[11]= 1337 ' duur= .01337 Vels[12]= 1355 ' duur= .01355 Vels[13]= 1373 ' duur= .01373 Vels[14]= 1390 ' duur= .0139 Vels[15]= 1408 ' duur= .01408 Vels[16]= 1427 ' duur= .01427 Vels[17]= 1445 ' duur= .01445 Vels[18]= 1464 ' duur= .01464 Vels[19]= 1483 ' duur= .01483 Vels[20]= 1503 ' duur= .01503 Vels[21]= 1522 ' duur= .01522 Vels[22]= 1542 ' duur= .01542 Vels[23]= 1562 ' duur= .01562 Vels[24]= 1582 ' duur= .01582 Vels[25]= 1603 ' duur= .01603 Vels[26]= 1624 ' duur= .01624 Vels[27]= 1645 ' duur= .01645 Vels[28]= 1667 ' duur= .01667 Vels[29]= 1688 ' duur= .01688 Vels[30]= 1710 ' duur= .0171 Vels[31]= 1732 ' duur= .01732 Vels[32]= 1755 ' duur= .01755 Vels[33]= 1778 ' duur= .01778 Vels[34]= 1801 ' duur= .01801 Vels[35]= 1825 ' duur= .01825 Vels[36]= 1848 ' duur= .01848 Vels[37]= 1872 ' duur= .01872 Vels[38]= 1897 ' duur= .01897 Vels[39]= 1921 ' duur= .01921 Vels[40]= 1946 ' duur= .01946 Vels[41]= 1972 ' duur= .01972 Vels[42]= 1997 ' duur= .01997 Vels[43]= 2023 ' duur= .02023 Vels[44]= 2050 ' duur= .0205 Vels[45]= 2077 ' duur= .02077 Vels[46]= 2104 ' duur= .02104 Vels[47]= 2131 ' duur= .02131 Vels[48]= 2159 ' duur= .02159 Vels[49]= 2187 ' duur= .02187 Vels[50]= 2215 ' duur= .02215 Vels[51]= 2244 ' duur= .02244 Vels[52]= 2273 ' duur= .02273 Vels[53]= 2303 ' duur= .02303 Vels[54]= 2333 ' duur= .02333 Vels[55]= 2363 ' duur= .02363 Vels[56]= 2394 ' duur= .02394 Vels[57]= 2425 ' duur= .02425 Vels[58]= 2457 ' duur= .02457 Vels[59]= 2489 ' duur= .02489 Vels[60]= 2521 ' duur= .02521 Vels[61]= 2554 ' duur= .02554 Vels[62]= 2587 ' duur= .02587 Vels[63]= 2621 ' duur= .02621 Vels[64]= 2655 ' duur= .02655 Vels[65]= 2690 ' duur= .0269 Vels[66]= 2725 ' duur= .02725 Vels[67]= 2760 ' duur= .0276 Vels[68]= 2796 ' duur= .02796 Vels[69]= 2833 ' duur= .02833 Vels[70]= 2870 ' duur= .0287 Vels[71]= 2907 ' duur= .02907 Vels[72]= 2945 ' duur= .02945 Vels[73]= 2983 ' duur= .02983 Vels[74]= 3022 ' duur= .03022 Vels[75]= 3061 ' duur= .03061 Vels[76]= 3101 ' duur= .03101 Vels[77]= 3142 ' duur= .03142 Vels[78]= 3183 ' duur= .03183 Vels[79]= 3224 ' duur= .03224 Vels[80]= 3266 ' duur= .03266 Vels[81]= 3309 ' duur= .03309 Vels[82]= 3352 ' duur= .03352 Vels[83]= 3395 ' duur= .03395 Vels[84]= 3440 ' duur= .0344 Vels[85]= 3484 ' duur= .03484 Vels[86]= 3530 ' duur= .0353 Vels[87]= 3576 ' duur= .03576 Vels[88]= 3622 ' duur= .03622 Vels[89]= 3669 ' duur= .03669 Vels[90]= 3717 ' duur= .03717 Vels[91]= 3766 ' duur= .03766 Vels[92]= 3815 ' duur= .03815 Vels[93]= 3864 ' duur= .03864 Vels[94]= 3915 ' duur= .03915 Vels[95]= 3966 ' duur= .03966 Vels[96]= 4017 ' duur= .04017 Vels[97]= 4070 ' duur= .0407 Vels[98]= 4123 ' duur= .04123 Vels[99]= 4176 ' duur= .04176 Vels[100]= 4231 ' duur= .04231 Vels[101]= 4286 ' duur= .04286 Vels[102]= 4342 ' duur= .04342 Vels[103]= 4398 ' duur= .04398 Vels[104]= 4456 ' duur= .04456 Vels[105]= 4514 ' duur= .04514 Vels[106]= 4572 ' duur= .04572 Vels[107]= 4632 ' duur= .04632 Vels[108]= 4692 ' duur= .04692 Vels[109]= 4753 ' duur= .04753 Vels[110]= 4815 ' duur= .04815 Vels[111]= 4878 ' duur= .04878 Vels[112]= 4941 ' duur= .04941 Vels[113]= 5006 ' duur= .05006 Vels[114]= 5071 ' duur= .05071 Vels[115]= 5137 ' duur= .05137 Vels[116]= 5204 ' duur= .05204 Vels[117]= 5272 ' duur= .05272 Vels[118]= 5340 ' duur= .0534 Vels[119]= 5410 ' duur= .0541 Vels[120]= 5480 ' duur= .0548 Vels[121]= 5552 ' duur= .05552 Vels[122]= 5624 ' duur= .05624 Vels[123]= 5697 ' duur= .05697 Vels[124]= 5772 ' duur= .05772 Vels[125]= 5847 ' duur= .05847 Vels[126]= 5923 ' duur= .05923 Vels[127]= 6000 ' duur= .06 Return Freq_Lookup: Freqs[0]= 53035 ' period= 10 freq= 100 RPM= 30 Bowspeed= 1.57 cm/s Freqs[1]= 53123 ' period= 9.9296 freq= 100.709 RPM= 30.21 Bowspeed= 1.581 cm/s Freqs[2]= 53211 ' period= 9.8592 freq= 101.4281 RPM= 30.426 Bowspeed= 1.5923 cm/s Freqs[3]= 53299 ' period= 9.7888 freq= 102.1576 RPM= 30.648 Bowspeed= 1.6039 cm/s Freqs[4]= 53387 ' period= 9.7184 freq= 102.8976 RPM= 30.87 Bowspeed= 1.6155 cm/s Freqs[5]= 53474 ' period= 9.6488 freq= 103.6398 RPM= 31.092 Bowspeed= 1.6271 cm/s Freqs[6]= 53562 ' period= 9.5784 freq= 104.4016 RPM= 31.32 Bowspeed= 1.6391 cm/s Freqs[7]= 53650 ' period= 9.508 freq= 105.1746 RPM= 31.554 Bowspeed= 1.6513 cm/s Freqs[8]= 53738 ' period= 9.4376 freq= 105.9591 RPM= 31.788 Bowspeed= 1.6636 cm/s Freqs[9]= 53826 ' period= 9.3672 freq= 106.7555 RPM= 32.028 Bowspeed= 1.6761 cm/s Freqs[10]= 53914 ' period= 9.2968 freq= 107.5639 RPM= 32.268 Bowspeed= 1.6887 cm/s Freqs[11]= 54002 ' period= 9.2264 freq= 108.3846 RPM= 32.514 Bowspeed= 1.7016 cm/s Freqs[12]= 54090 ' period= 9.156 freq= 109.218 RPM= 32.766 Bowspeed= 1.7148 cm/s Freqs[13]= 54178 ' period= 9.0856 freq= 110.0643 RPM= 33.018 Bowspeed= 1.7279 cm/s Freqs[14]= 54265 ' period= 9.016 freq= 110.9139 RPM= 33.276 Bowspeed= 1.7414 cm/s Freqs[15]= 54353 ' period= 8.9456 freq= 111.7868 RPM= 33.534 Bowspeed= 1.7549 cm/s Freqs[16]= 54441 ' period= 8.8752 freq= 112.6735 RPM= 33.804 Bowspeed= 1.7691 cm/s Freqs[17]= 54529 ' period= 8.8048 freq= 113.5744 RPM= 34.074 Bowspeed= 1.7832 cm/s Freqs[18]= 54617 ' period= 8.7344 freq= 114.4898 RPM= 34.344 Bowspeed= 1.7973 cm/s Freqs[19]= 54705 ' period= 8.664 freq= 115.4201 RPM= 34.626 Bowspeed= 1.8121 cm/s Freqs[20]= 54793 ' period= 8.5936 freq= 116.3657 RPM= 34.908 Bowspeed= 1.8269 cm/s Freqs[21]= 54881 ' period= 8.5232 freq= 117.3268 RPM= 35.196 Bowspeed= 1.8419 cm/s Freqs[22]= 54969 ' period= 8.4528 freq= 118.304 RPM= 35.49 Bowspeed= 1.8573 cm/s Freqs[23]= 55056 ' period= 8.3832 freq= 119.2862 RPM= 35.784 Bowspeed= 1.8727 cm/s Freqs[24]= 55144 ' period= 8.3128 freq= 120.2964 RPM= 36.09 Bowspeed= 1.8887 cm/s Freqs[25]= 55232 ' period= 8.2424 freq= 121.3239 RPM= 36.396 Bowspeed= 1.9047 cm/s Freqs[26]= 55320 ' period= 8.172 freq= 122.3691 RPM= 36.708 Bowspeed= 1.9211 cm/s Freqs[27]= 55408 ' period= 8.1016 freq= 123.4324 RPM= 37.032 Bowspeed= 1.938 cm/s Freqs[28]= 55496 ' period= 8.0312 freq= 124.5144 RPM= 37.356 Bowspeed= 1.955 cm/s Freqs[29]= 55584 ' period= 7.9608 freq= 125.6155 RPM= 37.686 Bowspeed= 1.9722 cm/s Freqs[30]= 55672 ' period= 7.8904 freq= 126.7363 RPM= 38.022 Bowspeed= 1.9898 cm/s Freqs[31]= 55760 ' period= 7.82 freq= 127.8772 RPM= 38.364 Bowspeed= 2.0077 cm/s Freqs[32]= 55848 ' period= 7.7496 freq= 129.0389 RPM= 38.712 Bowspeed= 2.0259 cm/s Freqs[33]= 55935 ' period= 7.68 freq= 130.2083 RPM= 39.06 Bowspeed= 2.0441 cm/s Freqs[34]= 56023 ' period= 7.6096 freq= 131.413 RPM= 39.426 Bowspeed= 2.0633 cm/s Freqs[35]= 56111 ' period= 7.5392 freq= 132.6401 RPM= 39.792 Bowspeed= 2.0824 cm/s Freqs[36]= 56199 ' period= 7.4688 freq= 133.8903 RPM= 40.17 Bowspeed= 2.1022 cm/s Freqs[37]= 56287 ' period= 7.3984 freq= 135.1644 RPM= 40.548 Bowspeed= 2.122 cm/s Freqs[38]= 56375 ' period= 7.328 freq= 136.4629 RPM= 40.938 Bowspeed= 2.1424 cm/s Freqs[39]= 56463 ' period= 7.2576 freq= 137.7866 RPM= 41.334 Bowspeed= 2.1631 cm/s Freqs[40]= 56551 ' period= 7.1872 freq= 139.1362 RPM= 41.742 Bowspeed= 2.1845 cm/s Freqs[41]= 56639 ' period= 7.1168 freq= 140.5126 RPM= 42.156 Bowspeed= 2.2062 cm/s Freqs[42]= 56726 ' period= 7.0472 freq= 141.9003 RPM= 42.57 Bowspeed= 2.2278 cm/s Freqs[43]= 56814 ' period= 6.9768 freq= 143.3322 RPM= 43.002 Bowspeed= 2.2504 cm/s Freqs[44]= 56902 ' period= 6.9064 freq= 144.7932 RPM= 43.44 Bowspeed= 2.2734 cm/s Freqs[45]= 56990 ' period= 6.836 freq= 146.2844 RPM= 43.884 Bowspeed= 2.2966 cm/s Freqs[46]= 57078 ' period= 6.7656 freq= 147.8066 RPM= 44.34 Bowspeed= 2.3205 cm/s Freqs[47]= 57166 ' period= 6.6952 freq= 149.3607 RPM= 44.808 Bowspeed= 2.345 cm/s Freqs[48]= 57254 ' period= 6.6248 freq= 150.948 RPM= 45.282 Bowspeed= 2.3698 cm/s Freqs[49]= 57342 ' period= 6.5544 freq= 152.5693 RPM= 45.768 Bowspeed= 2.3952 cm/s Freqs[50]= 57430 ' period= 6.484 freq= 154.2258 RPM= 46.266 Bowspeed= 2.4213 cm/s Freqs[51]= 57517 ' period= 6.4144 freq= 155.8992 RPM= 46.77 Bowspeed= 2.4476 cm/s Freqs[52]= 57605 ' period= 6.344 freq= 157.6293 RPM= 47.286 Bowspeed= 2.4746 cm/s Freqs[53]= 57693 ' period= 6.2736 freq= 159.3981 RPM= 47.82 Bowspeed= 2.5026 cm/s Freqs[54]= 57781 ' period= 6.2032 freq= 161.2071 RPM= 48.36 Bowspeed= 2.5308 cm/s Freqs[55]= 57869 ' period= 6.1328 freq= 163.0577 RPM= 48.918 Bowspeed= 2.56 cm/s Freqs[56]= 57957 ' period= 6.0624 freq= 164.9512 RPM= 49.488 Bowspeed= 2.5899 cm/s Freqs[57]= 58045 ' period= 5.992 freq= 166.8892 RPM= 50.064 Bowspeed= 2.62 cm/s Freqs[58]= 58133 ' period= 5.9216 freq= 168.8733 RPM= 50.664 Bowspeed= 2.6514 cm/s Freqs[59]= 58221 ' period= 5.8512 freq= 170.9051 RPM= 51.27 Bowspeed= 2.6831 cm/s Freqs[60]= 58308 ' period= 5.7816 freq= 172.9625 RPM= 51.888 Bowspeed= 2.7155 cm/s Freqs[61]= 58396 ' period= 5.7112 freq= 175.0946 RPM= 52.53 Bowspeed= 2.7491 cm/s Freqs[62]= 58484 ' period= 5.6408 freq= 177.2798 RPM= 53.184 Bowspeed= 2.7833 cm/s Freqs[63]= 58572 ' period= 5.5704 freq= 179.5203 RPM= 53.856 Bowspeed= 2.8185 cm/s Freqs[64]= 58660 ' period= 5.5 freq= 181.8182 RPM= 54.546 Bowspeed= 2.8546 cm/s Freqs[65]= 58748 ' period= 5.4296 freq= 184.1756 RPM= 55.254 Bowspeed= 2.8916 cm/s Freqs[66]= 58836 ' period= 5.3592 freq= 186.595 RPM= 55.98 Bowspeed= 2.9296 cm/s Freqs[67]= 58924 ' period= 5.2888 freq= 189.0788 RPM= 56.724 Bowspeed= 2.9686 cm/s Freqs[68]= 59012 ' period= 5.2184 freq= 191.6296 RPM= 57.486 Bowspeed= 3.0084 cm/s Freqs[69]= 59099 ' period= 5.1488 freq= 194.22 RPM= 58.266 Bowspeed= 3.0493 cm/s Freqs[70]= 59187 ' period= 5.0784 freq= 196.9124 RPM= 59.076 Bowspeed= 3.0916 cm/s Freqs[71]= 59275 ' period= 5.008 freq= 199.6805 RPM= 59.904 Bowspeed= 3.135 cm/s Freqs[72]= 59363 ' period= 4.9376 freq= 202.5275 RPM= 60.756 Bowspeed= 3.1796 cm/s Freqs[73]= 59451 ' period= 4.8672 freq= 205.4569 RPM= 61.638 Bowspeed= 3.2257 cm/s Freqs[74]= 59539 ' period= 4.7968 freq= 208.4723 RPM= 62.544 Bowspeed= 3.2731 cm/s Freqs[75]= 59627 ' period= 4.7264 freq= 211.5775 RPM= 63.474 Bowspeed= 3.3218 cm/s Freqs[76]= 59715 ' period= 4.656 freq= 214.7766 RPM= 64.434 Bowspeed= 3.372 cm/s Freqs[77]= 59803 ' period= 4.5856 freq= 218.074 RPM= 65.424 Bowspeed= 3.4239 cm/s Freqs[78]= 59890 ' period= 4.516 freq= 221.4349 RPM= 66.432 Bowspeed= 3.4766 cm/s Freqs[79]= 59978 ' period= 4.4456 freq= 224.9415 RPM= 67.482 Bowspeed= 3.5316 cm/s Freqs[80]= 60066 ' period= 4.3752 freq= 228.561 RPM= 68.568 Bowspeed= 3.5884 cm/s Freqs[81]= 60154 ' period= 4.3048 freq= 232.2988 RPM= 69.69 Bowspeed= 3.6471 cm/s Freqs[82]= 60242 ' period= 4.2344 freq= 236.161 RPM= 70.848 Bowspeed= 3.7077 cm/s Freqs[83]= 60330 ' period= 4.164 freq= 240.1537 RPM= 72.048 Bowspeed= 3.7705 cm/s Freqs[84]= 60418 ' period= 4.0936 freq= 244.2838 RPM= 73.284 Bowspeed= 3.8352 cm/s Freqs[85]= 60506 ' period= 4.0232 freq= 248.5584 RPM= 74.568 Bowspeed= 3.9024 cm/s Freqs[86]= 60594 ' period= 3.9528 freq= 252.9852 RPM= 75.894 Bowspeed= 3.9718 cm/s Freqs[87]= 60681 ' period= 3.8832 freq= 257.5196 RPM= 77.256 Bowspeed= 4.0431 cm/s Freqs[88]= 60769 ' period= 3.8128 freq= 262.2744 RPM= 78.684 Bowspeed= 4.1178 cm/s Freqs[89]= 60857 ' period= 3.7424 freq= 267.2082 RPM= 80.16 Bowspeed= 4.195 cm/s Freqs[90]= 60945 ' period= 3.672 freq= 272.3312 RPM= 81.702 Bowspeed= 4.2757 cm/s Freqs[91]= 61033 ' period= 3.6016 freq= 277.6544 RPM= 83.298 Bowspeed= 4.3593 cm/s Freqs[92]= 61121 ' period= 3.5312 freq= 283.1899 RPM= 84.954 Bowspeed= 4.4459 cm/s Freqs[93]= 61209 ' period= 3.4608 freq= 288.9505 RPM= 86.688 Bowspeed= 4.5367 cm/s Freqs[94]= 61297 ' period= 3.3904 freq= 294.9504 RPM= 88.488 Bowspeed= 4.6309 cm/s Freqs[95]= 61385 ' period= 3.32 freq= 301.2048 RPM= 90.36 Bowspeed= 4.7288 cm/s Freqs[96]= 61472 ' period= 3.2504 freq= 307.6544 RPM= 92.298 Bowspeed= 4.8303 cm/s Freqs[97]= 61560 ' period= 3.18 freq= 314.4654 RPM= 94.338 Bowspeed= 4.937 cm/s Freqs[98]= 61648 ' period= 3.1096 freq= 321.5848 RPM= 96.474 Bowspeed= 5.0488 cm/s Freqs[99]= 61736 ' period= 3.0392 freq= 329.034 RPM= 98.712 Bowspeed= 5.1659 cm/s Freqs[100]= 61824 ' period= 2.9688 freq= 336.8364 RPM= 101.052 Bowspeed= 5.2884 cm/s Freqs[101]= 61912 ' period= 2.8984 freq= 345.0179 RPM= 103.506 Bowspeed= 5.4168 cm/s Freqs[102]= 62000 ' period= 2.828 freq= 353.6068 RPM= 106.08 Bowspeed= 5.5515 cm/s Freqs[103]= 62088 ' period= 2.7576 freq= 362.6342 RPM= 108.792 Bowspeed= 5.6934 cm/s Freqs[104]= 62176 ' period= 2.6872 freq= 372.1346 RPM= 111.642 Bowspeed= 5.8426 cm/s Freqs[105]= 62264 ' period= 2.6168 freq= 382.1461 RPM= 114.642 Bowspeed= 5.9996 cm/s Freqs[106]= 62351 ' period= 2.5472 freq= 392.5879 RPM= 117.774 Bowspeed= 6.1635 cm/s Freqs[107]= 62439 ' period= 2.4768 freq= 403.7468 RPM= 121.122 Bowspeed= 6.3387 cm/s Freqs[108]= 62527 ' period= 2.4064 freq= 415.5585 RPM= 124.668 Bowspeed= 6.5243 cm/s Freqs[109]= 62615 ' period= 2.336 freq= 428.0822 RPM= 128.424 Bowspeed= 6.7209 cm/s Freqs[110]= 62703 ' period= 2.2656 freq= 441.3842 RPM= 132.414 Bowspeed= 6.9297 cm/s Freqs[111]= 62791 ' period= 2.1952 freq= 455.5394 RPM= 136.662 Bowspeed= 7.152 cm/s Freqs[112]= 62879 ' period= 2.1248 freq= 470.6325 RPM= 141.192 Bowspeed= 7.389 cm/s Freqs[113]= 62967 ' period= 2.0544 freq= 486.7601 RPM= 146.028 Bowspeed= 7.6421 cm/s Freqs[114]= 63055 ' period= 1.984 freq= 504.0323 RPM= 151.212 Bowspeed= 7.9134 cm/s Freqs[115]= 63142 ' period= 1.9144 freq= 522.3569 RPM= 156.708 Bowspeed= 8.2011 cm/s Freqs[116]= 63230 ' period= 1.844 freq= 542.2993 RPM= 162.69 Bowspeed= 8.5141 cm/s Freqs[117]= 63318 ' period= 1.7736 freq= 563.825 RPM= 169.146 Bowspeed= 8.852 cm/s Freqs[118]= 63406 ' period= 1.7032 freq= 587.1301 RPM= 176.142 Bowspeed= 9.2181 cm/s Freqs[119]= 63494 ' period= 1.6328 freq= 612.4449 RPM= 183.732 Bowspeed= 9.6153 cm/s Freqs[120]= 63582 ' period= 1.5624 freq= 640.041 RPM= 192.012 Bowspeed= 10.0486 cm/s Freqs[121]= 63670 ' period= 1.492 freq= 670.2413 RPM= 201.072 Bowspeed= 10.5228 cm/s Freqs[122]= 63758 ' period= 1.4216 freq= 703.4328 RPM= 211.032 Bowspeed= 11.044 cm/s Freqs[123]= 63846 ' period= 1.3512 freq= 740.0829 RPM= 222.024 Bowspeed= 11.6193 cm/s Freqs[124]= 63933 ' period= 1.2816 freq= 780.2747 RPM= 234.084 Bowspeed= 12.2504 cm/s Freqs[125]= 64021 ' period= 1.2112 freq= 825.6275 RPM= 247.686 Bowspeed= 12.9622 cm/s Freqs[126]= 64109 ' period= 1.1408 freq= 876.5778 RPM= 262.974 Bowspeed= 13.7623 cm/s Freqs[127]= 64197 ' period= 1.0704 freq= 934.2302 RPM= 280.272 Bowspeed= 14.6676 cm/s Return '[EOF]