Horsepower Monitor


Horsepower Monitor

 

Horsepower Monitor

 


This device is designed to measure the torque in an automobile drive shaft and provide an output to a vehicle data recording system or a portable computer via an RS-232 interface. The received data can then be combined with RPM measurements from the data recording system to calculate horsepower. It consists of the sensor unit, (Figure 1), which attaches to the driveshaft, and the receiver unit, , which provides the serial output signal. The sensor unit is battery powered and communicates with the receiver via a 433 Mhz RF data link.The receiver unit is powered by the vehicle electrical system. Circuit operation is shown in the diagram.

Horsepower Monitor

The sensor unit is contained in a cylindrical housing split along its axis to allow attachment without access to the driveshaft end. When the driveshaft experiences torsion it is transferred to the housing endplates. The inboard endplate contains a permanent magnet which is mounted against a Hall-effect sensor on the sensor plate. Since the sensor plate is attached to the outboard end plate it moves with it. The resulting angular deflection between the magnet and the sensor produces a signal which is proportional to the driveshaft torque.This signal is processed by the circuitry of the MCU PCB mounted axially between the endplates in the upper housing half. It is amplified by a section of an MCP6024 quad op-amp, the gain and operating point of which can be changed under program control via an MCP 42010 dual digital potentiometer. The amplifier output is converted to a digital output by the A-D converter of an 18F252 MCU. The digital value is then used as a vector into a lookup table in the MCU EEPROM data memory which is pre-loaded with values determined during calibration. Sensor variations with temperature are compensated for by reading the output of a TC1047 temperature sensor mounted on the sensor PCB in close proximity to the Hall-effect sensor. The temperature sensor output is also converted to a digital signal by the MCU and used to correct temperature induced errors. This circuitry operates from two lithium batteries mounted in the lower housing half to maintain assembly balance. To conserve power, these batteries are switched on by a centrifugal switch only when the shaft rotates. When testing or calibrating, external power is provided via connector sockets on the interface PCB mounted on the outboard end plate. This PCB also includes connector sockets for In-Circuit Serial Programming of calibration values.



Code:

; PROGRAMMABLE RESISTOR TEST PROCEDURE



; —————————————————————————-



; This procedure programs the MCP42100 Digital Potentiometer.



;—————————————————————————–



;



TEMP EQU 10H ; Temporary holding register.



COUNT EQU 11H ; Shift Count register.



;



ORG 0200H ;



;



BEGIN MOVLW B’11111111’ ; Set RB0-RB7 as inputs.



MOVWF TRISB ;



MOVLW B’00000000’ ; Set RC0-RC7 as outputs.



MOVWF TRISC ; D0 = /CS; D1 = Data; D2 = Clock



BCF INTCON2,7 ; Enable the internal pullups.



SER_OUT MOVLW 1 ;



MOVWF PORTC ;Set /CS = 1.



TESTBYT MOVLW 11H ;



MOVWF TEMP ; Set command byte to write pot 0.



MOVLW 8 ;



MOVWF COUNT ;



BCF PORTC,0 ; Set /CS = 0.



TESTBIT CLRWDT ;



RLCF TEMP ; Shift out the eight command bits.



BTFSC STATUS,CARRY ;



BSF PORTC,1 ; Set Data 1 or 0 as appropriate.



BTFSS STATUS,CARRY ;



BCF PORTC,1 ;



BSF PORTC,2 ; Toggle clock high, then low.



NOP ;



BCF PORTC,2 ;



DECFSZ COUNT ;



GOTO TESTBIT ; Continue for remaining bits.



MOVFF PORTB,TEMP ; Read the data input switch.



MOVLW 8 ;



MOVWF COUNT ;



TESTBT RLCF TEMP ; Shift out the eight data bits.



BTFSC STATUS,CARRY ;



BSF PORTC,1 ; Set Data 1 or 0 as appropriate.



BTFSS STATUS,CARRY ;



BCF PORTC,1 ;



BSF PORTC,2 ; Toggle clock high, then low.



NOP ;



BCF PORTC,2 ;



DECFSZ COUNT ;



GOTO TESTBT ; Continue for remaining bits.



BSF PORTC,0 ;



GOTO TESTBYT ; Return.



END

Horsepower Monitor


Sorry, comments are closed!