Table of Contents Tachometer.................................................................................................................................................3 Introduction.............................................................................................................................3 Need for a Tachometer............................................................................................................3 Abstract......................................................................................................................................................5 Research Focus........................................................................................................................5 Issue(s) Addressed...................................................................................................................5 Research Method.....................................................................................................................5 Conclusions and Recommendations........................................................................................5 Operation..........................................................................................................................................6 RPM transducer.......................................................................................................................6 Clock Generator......................................................................................................................6 Digital To Analog Converter...................................................................................................7 Pointer.....................................................................................................................................7 RTL Schematic...........................................................................................................................................8 CLOCKDIV............................................................................................................................8 TMETER.................................................................................................................................8 VHDL Code...............................................................................................................................................9 System..............................................................................................................................................9 CLKDIV...................................................................................................................................................11 TMETER..................................................................................................................................................12 VHDL Simulation....................................................................................................................................14 System Overview..................................................................................................................15 System Detail -1....................................................................................................................16 System Detail -2....................................................................................................................17 Reset Action..........................................................................................................................18 CLKDIV................................................................................................................................19 TMETER...............................................................................................................................20 Implementation Report............................................................................................................................21 CPLD Fitter Report...............................................................................................................21 Resources summary...............................................................................................................21 Pin resources.........................................................................................................................21 Global resources....................................................................................................................21 Power Data............................................................................................................................21 Inputs........................................................................................................................................................22 Function Blocks.......................................................................................................................................22 Compiler Options.....................................................................................................................................22 Pin List.....................................................................................................................................................23 Implementation Diagram.........................................................................................................................25 Conclusions..............................................................................................................................................26 Bibliography.............................................................................................................................................27
Tachometer Introduction
A tachometer (also called a revolution-counter, "Tach", rev-counter, or RPM gauge) is an instrument that measures the rotation speed of a shaft or disk, as in a motor or other machine. The device usually displays displays the revolutions per minute (RPM) on a calibrated analogue dial, but digital displays are increasingly common. The term comes from Greek Ταχος,, "speed", and metron, "to measure".
Illustration 1: Automobile Tachometer
Need for a Tachometer
Tachometers or rev counters on automobiles, aircraft, and other vehicles show the rate of rotation of the engine's crankshaft, and typically have markings indicating a safe range of rotation speeds. This can assist the driver in selecting appropriate appropriate throttle and gear settings for the driving conditions. Prolonged use at high speeds may cause inadequate lubrication, overheating overheating (exceeding capability of the cooling system), exceeding speed capability of sub-parts of the engine (for example spring retracted valves) thus causing excessive wear or permanent damage or failure of engines. On analogue tachometers, speeds above maximum safe operating speed are typically indicated by an area of the gauge marked in red, giving rise to the expression of "redlining" an engine — revving the engine up to the maximum safe limit. In vehicles such as tractors and trucks, the tachometer often has other markings, usually a green arc showing the speed range in which the engine produces maximum
torque, which is of prime interest to operators of such vehicles. Tractors fitted with a power take off (PTO) system have tachometers showing the engine speed needed to rotate the PTO at the standardized speed required by most PTO-driven implements. In many countries, tractors are required to have a speedometer for use on a road. To save fitting a second dial, the vehicle's tachometer is often marked with a second scale in units of speed. This scale is only accurate in a certain gear, gear, but since many tractors only have one gear that is practical for use on-road, this is i s sufficient. Tractors with multiple 'road gears' often have have tachometers with more than one speed scale. Aircraft tachometers have have a green arc showing the engine's designed cruising speed range. A tachometer is vital is preventing engine over-speed. over-speed. Overspeed Overspeed is a condition in which an engine is allowed or forced to turn beyond beyond its design limit. The consequences of running an engine too fast vary by engine type and model and depend upon several factors, chief amongst them the duration of the overspeed overspeed and by the speed attained. With some engines even a momentary overspeed can result in greatly reduced engine life or even catastrophic catastrophic failure. The speed of an an engine is ordinarily measured in revolutions revolutions per minute (RPM). Typical maximal RPMs of performance engines are provided in the following table:
Automobile
Maximum Engine Speed
Audi R8 V8
8000 rpm
Audi Q7 6.0 V12 diesel
4750 rpm
Bugatti Veyron turbocharged W16
6500 rpm
Honda S2000 I4
8200 rpm
Lexus LFA V10
9000 rpm
Volkswagen Golf GTI 2.0TSI I4
6500 rpm
Nissan GTR turbocharged turbocharge d V6
7000 rpm
Ferrari Enzo V12
8000 rpm
Table 1: Typical Engine Speed Ratings
As an example of what a tachometer can be used for, think of driving a car up a hill. By watching the tachometer, you will know if you should shift gears. This gives a visual cue to help you drive your car in the most efficient manner. Thus a tachometer is a vital instrument which allows a vehicle operator to select the correct gear for maximum efficiency and performance, performance, and allows him or her to operate the engine within safe parameters.
Abstract Research Focus
The objective of this project is to design, implement, simulate simulate and synthesize the logic required for the operations of a Tachometer. The prime focus of the design was to match the accuracy and reliability of analog tachometers, while at the same time reducing cost of the instrument by minimizing mechanical parts. The output is to be obtained by driving a mechanical pointer, since it is more convenient to read during driving. Issue(s) Addressed
Two constraints were kept in mind during the design of the circuit. First, the design was to have the maximum possible clock speed, in order for the precision of the device not to be sacrifices. The second, to minimize cost, the design was to be fitted inside a CPLD with 108 macrocells1. During simulation, propagation delays in the internal latches were reducing the speed of operation. This issue was resolved by splitting the design internally into multiple blocks. The timing generation was derived internally internally by dividing a 10Mhz clock and setting up 2 a PWM , in a block separate from the counter to enhance customizable and reduce the need for external components. Research Method
The design was described in VHDL 3 and compiled and simulated in ModelSim III XE. It was then implemented in Xilinx ISE Project Navigator and was targeted on an Automotive XC95108. Synthesis and Fitting of the logic was then carried out. The Automotive part was chosen for its higher reliability. Conclusions and Recommendations
The design was successfully successfully synthesized on a XC95108 XC95108 CPLD with a maximum possible clock of 83.33 Mhz. We found that by targeting a newer device like the CoolRunner2, the clock speed may be increased to 140+ Mhz, using the same design.
1 A macrocell macrocell array is a prefabricated prefabricated array of higher-level logic logic functions such as flip-flops, flip-flops, ALU functions, registers registers etc. 2 PWM = Pulse Width Modulation 3 VHSIC hardware description description language. language. VHSIC: VHSIC: very-high-speed very-high-speed integrated integrated circuit
Operation The block diagram of the system is shown below:
The main components of the system are: 1. RPM RPM Tran Transd sduc ucer er 2. Cloc Clock k Ge Gene nera rato torr 3. Digital Digital to Anal Analog og conv convert ertor or 4. Poin Pointe terr Disp Displa lay y
RPM transducer
A contactless ferromagnetic sensor can be used to measure the spinning speed of the engine without causing frictional losses. The RPM Transducer PR 9376 is ideally suited for such measurement. Due to high resolution, fast internal electronic and the sharp edged output pulses the PR 9376 is suitable for measurement of extremely high as well as very low rotational speeds with high resolution. Clock Generator
The CDCS502 is a spread spectrum capable, fundamental fundamental mode crystal oscillator with selectable frequency multiplication. multiplication. It features an advanced gain controlled fundamental mode crystal oscillator stage with a built-in load capacitance of 10pF. 10pF. This oscillator stage accepts crystals from 8MHz to 32MHz with an ESR of up to 180 Ω . The stage can be used with crystals with power dissipation of 50 µ W and up. The input signal is processed by a PLL, whose output frequency is either equal to the input frequency or multiplied by the factor of 4, depending on the mode selected.
Digital To Analog Converter
The AD5543/AD5553 are precision 16-/14-bit, low power, current output, small form factor digital-to-analog converters (DACs). (DACs). They are designed to operate from a single 5 V supply with a ±10 V multiplying reference. The applied external reference, VREF, determines the full-scale output current. An internal feedback resistor (RFB) facilitates the R-2R and temperature tracking for voltage conversion when combined with an external op amp. These can accurately convert the digital output to drive the pointer.
Illustration 2: Galvanometer
Pointer
A galvanometer may be used for displaying the reading to the vehicle operator. A galvanometer galvanometer is a type of ammeter: an instrument for detecting and measuring electric current. It is an a n analog electromechanical transducer4 that produces a rotary deflection of some type of pointer in response to electric current flowing through its coil. The term has expanded to include uses of the same mechanism in recording, positioning, and servomechanism equipment. A analog meter is preferred because it is easier for a vehicle operator to read while driving the machine.
4
transducer is a device that converts one type of energy to another. another.
RTL Schematic
Illustration 3: Entity Diagram
The system consists of two main sub-circuits. 1. CLOCKDIV 2. TMETER CLOCKDIV
It divides the master CLOCK signal such that a pulse of 80% duty cycle and adequate duration is setup up. By modifying this block the device can be made to measure faster or slower spin speeds. TMETER
This consists of a 16 bit counter, counter, gating and auto-reset logic. This counts the rotations per gate pulse and outputs the result on the RESULT [0:15] bus. That in turn drives a DAC and hence the pointer.
VHDL Code System ---------------------
*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~ _____ _ _ |_ _| _ _ __ _ | |_ _ __ _ _ _ _ __ _ ___ | | _ ___ _ __ | | / _ ` | / _ _ | ' _ \ / _ \ | ' _ ` _ \ / _ \ _ _ / _ \ ' _ _| | | ( _ | | ( _ _ | | | | ( _ ) | | | | | | __ / | | _ _ / | | _ | \ _ _ , _ | \ _ _ _ |_ | | _ | \ _ _ _ /| _ | | _ | | _ | \ _ _ _ |\ _ _ \ _ _ _ | _ | *~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~ +-+-+-+-+-+-+-+ +-+-+ +-+-+-+ +-+-+-+-+-+-+ +-+-+ |S|h|a|u|n|a|k| |D|e| |a|n|d| |N|i|k|h|i|l| |A|.| +-+-+-+-+-+-+-+ +-+-+ +-+-+-+ +-+-+-+-+-+-+ +-+-+ VHDL Code to ganetare timing, control logig and measure RPM of an rotating part. eg: Engine. The Ports are as follows: INPUT: CLOCK, MOTORIN, RST OUTPUT: RESULT 15 OCT 2010, V1.1 *~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.ALL; USE IEEE.STD_LOGIC_ARITH.ALL; USE IEEE.STD_LOGIC_UNSIGNED.ALL; ENTITY SYSTEM IS PORT( CLOCK: IN STD_LOGIC; MOTORIN: IN STD_LOGIC; RST: IN STD_LOGIC; RESULT: OUT INTEGER RANGE 0 TO 65535 ); END SYSTEM; ARCHITECTURE SYS OF SYSTEM IS C O M P O N EN T T M E T E R I S PO R T ( G A T E : I N ST D _ L O G I C ; MOTOR: IN STD_LOGIC; RESET : IN STD_LOGIC;
- - MASTE R
SSD: OUT INTEGER RANGE 0 TO 65535 ); END COMPONENT; COMPONENT CLKDIV IS PORT( CLK: IN STD_LOGIC; CLKOUT: OUT STD_LOGIC ); END COMPONENT; SIGNAL CLKTRN: STD_LOGIC; BEGIN CLOCKDIV: CLKDIV PORT MAP (CLK=>CLOCK, CLKOUT=>CLKTRN); TACHMETER: TMETER PORT MAP (GATE=>CLKTRN, MOTOR=>MOTORIN, RESET => RST, SSD=>RESULT); END SYS;
CLKDIV --------
*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~ Entity to set up PWM pulses and divide master clock. Ports of the entity are as follows: IN: CLK OUT: CLKOUT 15 OCT 2010, V1.1 *~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.ALL; USE IEEE.STD_LOGIC_ARITH.ALL; USE IEEE.STD_LOGIC_UNSIGNED.ALL; ENTITY CLKDIV IS PORT( CLK: IN STD_LOGIC; CLKOUT: OUT STD_LOGIC ); END CLKDIV; ARCHITECTURE DIV OF CLKDIV IS BEGIN PROCESS (CLK) VARIABLE COUNT: INTEGER RANGE 0 TO 12501 :=0; VARIABLE STATE: STD_LOGIC := '1'; BEGIN IF(CLK'EVENT and CLK='1') THEN
-- SET UP COUNTER
IF(COUNT=12500)THEN COUNT:=0; STATE:= '1'; ELSE COUNT := COUNT+1; END IF; IF(COUNT=10000)THEN STATE:= NOT STATE; END IF; END IF; CLKOUT <= STATE; END PROCESS; END DIV;
-- SET UP PWM
TMETER ----------
*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~ Entity to count gated pulses and auto reset. Ports of the entity are as follows: IN: GATE, MOTOR, RESET OUT: SSD 15 OCT 2010, V1.1 *~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.ALL; USE IEEE.STD_LOGIC_ARITH.ALL; USE IEEE.STD_LOGIC_UNSIGNED.ALL; ENTITY TMETER IS PORT( GA GATE: IN STD_LOGIC; MOTOR: IN STD_LOGIC; CLOCK RESET : IN STD_LOGIC; RESET SSD: OUT INTEGER RANGE 0 TO 65535 ); END TMETER;
-- ENABLE GATE -- COUNTER -- ASYNC -- OUTPUT
ARCHITECTURE TACH OF TMETER IS BEGIN PROCESS (MOTOR, GATE, RESET) VARIABLE N:INTEGER RANGE 0 TO 65535
:= 0;
BEGIN IF GATE='1' AND GATE'EVENT THEN RESET SYSTEM ON GATE ROLL N := 0; END IF;
-- AUTO
IF N=65535 THEN N := 0; END IF; IF MOTOR='1' AND GATE='1' THEN TICKS N := N+1; END IF;
-- COUNT MOTOR
IF GATE='0' THEN COUNT TO OUTPUT LINES SSD <= N; END IF;
-- LATCH
IF RESET='1' THEN RESET LOGIC N:=0; SSD <=N; END IF;
-- ASYNC
END PROCESS; END TACH;
VHDL Simulation VHDL code attached above was compiled and simulated in ModelSim XE III (Started Edition). Simulation was with a 100 picoseconds clock. The results were then split into various different timescales to allow observations on all features of the circuit. The circuit was implemented in ISE Project Navigator 12.2 The results of the simulation and Implementation reports are attached ahead.
Illustration 4: Simulation in ModelSim
System Overview
System Detail -1
System Detail -2
Reset Action
CLKDIV
TMETER
Implementation Report The design was implemented in ISE Project Navigator on an Automotive XC95108 device. The result of the implementation are as follows: CPLD Fitter Report SYSTEM Successful M.63c XC95108-7-PC84 10-17-2010, 11:55PM
Resources summary
Macrocells Used 91/108 (85%)
Pterms Used Registers Used 222/540 (42%)
31/108 (29%)
Pins Used 19/69 (28%)
Function Block Inputs Used 175/216 (82%)
Pin resources Signal Type Input Output Bidirectional GCK GTS GSR
Required 2 16 0 1 0 0
Global resources Signal mapped onto global clock net (GCK1)
CLOCK
Power Data
Macrocells in high performance mode (MCHP) Macro acroce cell llss in in low low pow ower er mode mode (MCL (MCLP) P) Total macrocells used (MC)
91 0 91
Mapped 2 16 0 1 0 0
Inputs Signal Name CLOCK MOTORIN RST
Function Macrocel Pin Pin Pin Block l Number Type Use I/O/GC FB1 MC12 9 GCK K1 FB5 MC17 44 I/O I FB2 MC3 72 I/O I
Function Blocks Function Block
Macrocells Used/Total
Function Block Inputs Used/Total Used/Total
FB1 FB2 FB3 FB4 FB5 FB6
12 / 18 16 / 18 16 / 18 16 / 18 15 / 18 16 / 18
27 / 36 32 / 36 32 / 36 32 / 36 32 / 36 20 / 36
Pins Product Terms Used/Tota Used/Total l 24 / 90 1 / 12 42 / 90 4 / 12 47 / 90 4 / 12 43 / 90 4 / 11 39 / 90 3 / 11 27 / 90 2 / 11
Compiler Options Following is a list of all global compiler options used by the fitter run. Device(s) Specified Optimization Method Multi-Level Logic Optimization Ignore Timing Specifications Default Register Power Up Value Keep User Location Constraints What-You-See-Is-What-You-Get What-You-See-Is-What-You-G et Exhaustive Fitting Keep Unused Inputs Slew Rate Power Mode Ground on Unused IOs Global Clock Optimization Global Set/Reset Optimization Global Ouput Enable Optimization FASTConnect/UIM optimzation Local Feedback Pin Feedback Input Limit Pterm Limit
: : : : : : : : : : : : : : : : : : : :
xc95108-7-PC84 DENSITY ON OFF LOW ON OFF OFF OFF FAST STD OFF ON ON ON ON ON ON 36 25
Pin List Device : XC95108-7-PC84
-------------------------------------------------------------/11 10 9 8 7 6 5 4 3 2 1 84 83 82 81 80 79 78 77 76 75 \ | 12 74 | | 13 73 | | 14 72 | | 15 71 | | 16 70 | | 17 69 | | 18 68 | | 19 67 | | 20 66 | | 21 XC95108-7-PC84 65 | | 22 64 | | 23 63 | | 24 62 | | 25 61 | | 26 60 | | 27 59 | | 28 58 | | 29 57 | | 30 56 | | 31 55 | | 32 54 | \ 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 / --------------------------------------------------------------
Pin No. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Signal Name RESULT<0> TIE TIE TIE TIE TIE TIE GND CLOCK TIE TIE TIE TIE RESULT<3> TIE GND TIE RESULT<4> TIE TIE RESULT<5> VCC TIE TIE
Pin Signal No. Name 43 TIE 44 MOTORIN 45 RESULT<15> 46 TIE 47 TIE 48 TIE 49 GND 50 TIE 51 TIE 52 RESULT<1> 53 TIE 54 TIE 55 TIE 56 TIE 57 RESULT<2> 58 TIE 59 TDO 60 GND 61 TIE 62 RESULT<7> 63 TIE 64 VCC 65 TIE 66 RESULT<8>
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
RESULT<6> TIE GND TDI TMS TCK TIE RESULT<13> TIE TIE TIE TIE TIE VCC RESULT<14> TIE TIE GND
Legend :
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
TIE TIE RESULT<9> TIE RESULT<10> RST VCC TIE TIE TIE TIE VCC RESULT<11> TIE TIE RESULT<12> TIE TIE
NC = Not Connected, unbonded pin PGND = Unused I/O configured as additional Ground pin TIE = Unused I/O floating -- must tie to VCC, GND or other signal VCC = Dedicated Power Pin GND = Dedicated Ground Pin TDI = Test Data In, JTAG pin TDO = Test Data Out, JTAG pin TCK = Test Clock, JTAG pin TMS = Test Mode Select, JTAG pin PROHIBITED = User reserved pin
Implementation Diagram
Conclusions The counting engine for the Tachometer was successfully implemented in VHDL and simulated using ModelSim III XE (starter edition). The code behaves behaves as required for the purpose of counting and displaying, and has been tested to remove any bugs. The design was realized on a Xilinx XC95108 in ISE Project Navigator <12.2>. Through the project we have enlisted the following CAD tools: •
ModelSim III XE: Simulation and VHDL compiler
•
Ghostscript: Printing of simulation results to PDF.
•
GIMP: Image and graph editing.
•
ISE Project navigator: Implementation Implementation on CPLD
The project can hence be synthesized for transfer on a CPLD/FPGA solution, or processed for manufacture.
Bibliography Books: •
VHDL Primer – Third Edition – J. Bhasker
•
Digital Design, 3E – M. Morris Mano,
•
Circuit Design with VHDL - Volnei A. Pedroni
Websites: •
•
•
•
NJIT UG course: architecture.njit.edu/academ architecture.njit. edu/academics/undergrad ics/undergraduate/artand uate/artanddesign/dd-br design/dd-brochure.pdf ochure.pdf ModelSim basics: www.tkt.cs.tut.fi/t www. tkt.cs.tut.fi/tools/public/tu ools/public/tutorials/men torials/mentor/modelsim/g tor/modelsim/getting_started/gm etting_started/gms.ht s.ht ml ModelSim Environment Setup: www.ece.msstate.edu/~reese/EE8993/setup.html EDNC VHDL 101: www.ednc.com/bbs/data/file/pds/6734cd03_IntroModelSim60GUI.pdf
•
VHDL primer: www.seas.upenn.edu/~ese201/vhdl/vhdl_primer.html
•
VHDL resources: esd.cs.ucr.edu/labs/tutorial/VHDL_Page.html
•
Tachometer: auto.howstuffworks.com/car-driving-safety/safety-regulatorydevices/speedometer.htm
Illustration Index Illustration Illustration Illustration Illustration
1: Automobile Tachometer......................................................................................................3 2: Galvanometer......................................................................................................................7 3: Entity Diagram....................................................................................................................8 4: Simulation in ModelSim...................................................................................................14
Alphabetical Index duty cycle ..................................................................................................................................................8 Function Block.........................................................................................................................................22 galvanometer .............................................................................................................................................7 instrument...................................................................................................................................................4 ISE Project Navigator..............................................................................................................................14 macrocells..................................................................................................................................................5 ModelSim XE III.....................................................................................................................................14 R-2R...........................................................................................................................................................7 redlining.....................................................................................................................................................3 RPM Transducer........................................................................................................................................6 tachometer..................................................................................................................................................3 TIE...........................................................................................................................................................24 XC95108..................................................................................................................................................21