You are on page 1of 2

;--------------------------------------------------------------------------------------------;Description: Program for replacing the exhaust servo mechanism on a 2008-1020 Honda CBR1000RR; Hereby called the Exhaust

Servo Replacement Module (ESRM); Copyright (C) 2009 Pat Fruth;; This program is free software: you can r edistribute it and/or modify; it under the terms of the GNU General Public Licen se as published by; the Free Software Foundation.;; This program is distributed in the hope that it will be useful,; but WITHOUT ANY WARRANTY; without even the implied warranty of; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See th e; GNU General Public License for more details.;; You should have received a cop y of the GNU General Public License; along with this program. If not, see <http: //www.gnu.org/licenses/>.;;Version: 1.1;Date: 12.20.2009;MCU: PIC16F683;Author: Pat Fruth email:pat@patfruth.com;Change History:; V1.012.15.2009; Initial stable version. Implemented on PIC16F88; V1.1 12.20.2009; Ported to smaller (8-pin), b ut equally capable, PIC12F683;--------------------------------------------------------------------------------------------; DISCLAIMER:; IN NO EVENT, UNLESS RE QUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING, SHALLI, OR ANY; PERSON BE LIAB LE FOR ANY LOSS, EXPENSE OR DAMAGE, OF ANY TYPE OR NATURE ARISING OUT OF THE; US E OF, OR INABILITY TO USE THIS SOFTWARE OR PROGRAM, INCLUDING, BUT NOT LIMITED T O, CLAIMS,; SUITS OR CAUSES OF ACTION INVOLVING ALLEGED INFRINGEMENT OF COPYRIGH TS, PATENTS, TRADEMARKS,; TRADE SECRETS, OR UNFAIR COMPETITION.;--------------------------------------------------------------------------------------------;Ov erview:; The 2008-2010 Honda CBR1000RR motorcycle incorporates an exhaust gas co ntrol valve (EGCV).; The EGCV is located inside the muffler, just inside the tip of the exit. TheEGCV's purpose; is to quiet the motorcycle's exhaust note, by c losing, during low speed/rpm riding conditions.; During high speed/rpm riding, t he valve opens, allowing for maximum performance. The EGCV is; open and closed b y an electro-mechanical servo, which is controlled by the motorcycle's Engine; C ontrol Module (ECM).;; Upon replacing the CBR1000RR stock exhaust system, with a n after-market exhaust, there is often; no longer a need for the EGCV servo. Thu s, it is desirable to remove the servo.; However, simply removing the servo is n ot possible, without causing the check engine light (aka.; malfunction indicator lamp) to illuminate, due to the lack o f feedback from the EGCV servo; mechanism.;; This program effectively simulates the electrical characteristics of the EGCVservo. This; program interfaces with t he motorcycle's ECM, by interpreting signals/commands, that would; normally be s ent to the servo, and producing the necessary output signal, thatwould normally; be fed back to the motorcycle's ECM (by the servo). In doing so, the stock serv o may be; removed, thus reducing weight, and freeing up much needed space.;; The stock servo mechanism is comprised of a simple DC motor, which is coupledto an output; shaft, via a small gear reduction transmission. The end of the output sh aft has a wheel/arm; affixed, to which a cable attaches. This cable is then rout ed to the EGCV, inside the muffler.; There is a standard three-terminal 5K ohm p otentiometer (POT) mechanically fixed to the servo's; wheel/arm, which is used a s the means of determining proper servo wheel positioning. The 5K ohm; POT is co nfigured as a simple voltage divider, in a 5V circuit. Based on positioning, the ; voltage at the POT's wiper will be anywhere from 0 - 5V. The wiper voltage isf ed back to the; ECM, whereby it is then used as a means to determine proper posi tioning of theservo wheel.; The ECM will determine which direction the servo mot or needs to turn, how far,and how fast.; As the servo wheel is repositioned, the ECM continues to monitor the POT's wiper voltage, until; the proper position is achieved, at which time the servo motor is turned off.; The signal, provided by the ECM, is interrupted DC, with a 12V magnitude. Thesignal is a; 1KHz square w ave, whose duty cycle varies depending on speed.;; This program simulates the st ock servo motor by -; Interpreting which direction the ECM is commanding the mot or to run; Varying the feedback voltage sent back to the ECM;; GPIO, pins GP0 & GP1, are configured as input pins, and are used to determinewhether the; feedbac k voltage should be increased or decreased. If GP0 goes high, the thefeedback; v oltage should be decreased. If GP1 goes high, the the feedback voltage should be increased.; Feedback voltage is generated by configuring the CCP module to run

in PWM mode. The PWM; frequency is set to 1.9Khz, and the duty cycle is varied, depending on the direction inputs; (described above). The PWM signal is availabl e on the CCP1 pin. To achieve aflat/stable; feedback voltage, this 5V 1.9Khz squ are wave is then routed to a simple two stage R-C type; low pass filter. A nearl y continuously variable voltage is produced by varying the duty cycle. ;; Following are typical feedback voltages observed during design, testing, and construction of; the ESRM.; - Initial power-up.; Immediately after turning on th e motorcycle's ignition switch - 2.25V; - Starting.; While pressing the starter button - voltage briefly goes to 4.5V, then down to .3V; - Once the engine is st arted, and idling, the voltage settles to .3V; - With the engine running, and th e motorcycle in 6th gear; The voltage remains at .3V while engine RPMs are below 4,000.; Upon increasing engine RPM to 4,000 RPM or above, the voltage increases to4.5V;--------------------------------------------------------------------------------------------ERRORLEVEL -302 ;remove message about using proper bank;*** ** Declarations and microcontroller configuration *****PROCESSOR 12F683#include "P12F683.inc"__CONFIG _CP_OFF&_CPD_OFF&_BOD_ON&_MCLRE_OFF&_PWRTE_ON&_WDT_OFF&_IN TOSCIO&_FCMEN_OFF&_IESO_OFF;***** Declaration of variables *****cblock0x20; Begi nning of RAM in bank 0NEWDUTYLSB ; Least significant 2 bits of the new duty cycl eNEWDUTYMSB ; Most significant 8 bits of the new duty cycleLOOPCNT ; Loop counte r, used by the pause routineendc;***** Declaration of symbol equates *****VOLTSD OWN equ 0 ; GPIO, pin GP0, Decreace duty cycleVOLTSUP equ 1 ; GPIO, pin GP1, Inc rease duty cycle;***** Beginning of program memory structure *****ORG 0x00 ; Res et Vectorgoto Init ; After power-on-reset, jump to this locationORG 0x04 ; Inter rupt vectorgoto IntSvc ; Interrupt Service routine;***** Beginning of interrupt service routine *****; This code is executed any time an "Interrupt", of any kin d, occurs.; Here we place logic that queries the various interrupt flags in orde r to determine the reason; for the interrupt.IntSvcretfie ; Return from interrup tInit; Initialize the system clock oscillator frequencybanksel OSCCONbsf OSCCON, IRCF2; IRCF2:IRFC1:IRFC0 = b'111'bsf OSCCON,IRCF1; Configure the internal clock to run at 8MHzbsf OSCCON,IRCF0; Initialize the Watch Dog Timer prescaler for a 1 second timeoutbanksel WDTCON

You might also like