Professional Documents
Culture Documents
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 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".
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, 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 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 by dividing a 10Mhz clock and setting up
a PWM2, in a block separate from the counter to enhance customizable and reduce the
need for external components.
Research Method
The design was described in VHDL3 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.
1 A macrocell array is a prefabricated array of higher-level logic functions such as flip-flops, ALU functions, registers etc.
2 PWM = Pulse Width Modulation
3 VHSIC hardware description language. VHSIC: very-high-speed integrated circuit
Operation
The block diagram of the system is shown below:
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 mode crystal oscillator with
selectable frequency multiplication. It features an advanced gain controlled
fundamental mode crystal oscillator stage with a built-in load capacitance of 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). 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 is a type of ammeter: an instrument for detecting and measuring electric
current. It is an 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.
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, 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|.|
-- +-+-+-+-+-+-+-+ +-+-+ +-+-+-+ +-+-+-+-+-+-+ +-+-+
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;
BEGIN
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;
PROCESS (CLK)
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;
END IF;
CLKOUT <= STATE;
END PROCESS;
END DIV;
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( GATE: IN STD_LOGIC; -- ENABLE GATE
MOTOR: IN STD_LOGIC; -- COUNTER
CLOCK
RESET : IN STD_LOGIC; -- ASYNC
RESET
SSD: OUT INTEGER RANGE 0 TO 65535 -- OUTPUT
);
END TMETER;
BEGIN
IF N=65535 THEN
N := 0;
END IF;
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.
Resources summary
Macrocells Function Block
Pterms Used Registers Used Pins Used
Used Inputs Used
91/108 (85%) 222/540 (42%) 31/108 (29%) 19/69 (28%) 175/216 (82%)
Pin resources
Global resources
Signal mapped onto global clock net
CLOCK
(GCK1)
Power Data
Macrocells in high performance mode
91
(MCHP)
Macrocells in low power mode (MCLP) 0
Total macrocells used (MC) 91
Inputs
Function Macrocel Pin Pin Pin
Signal Name
Block l Number Type Use
I/O/GC
CLOCK FB1 MC12 9 GCK
K1
MOTORIN FB5 MC17 44 I/O I
RST FB2 MC3 72 I/O I
Function Blocks
Pins
Function Macrocells Function Block Product Terms
Used/Tota
Block Used/Total Inputs Used/Total Used/Total
l
FB1 12 / 18 27 / 36 24 / 90 1 / 12
FB2 16 / 18 32 / 36 42 / 90 4 / 12
FB3 16 / 18 32 / 36 47 / 90 4 / 12
FB4 16 / 18 32 / 36 43 / 90 4 / 11
FB5 15 / 18 32 / 36 39 / 90 3 / 11
FB6 16 / 18 20 / 36 27 / 90 2 / 11
Compiler Options
Following is a list of all global compiler options used by the fitter run.
--------------------------------------------------------------
/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 /
--------------------------------------------------------------
Websites:
• NJIT UG course:
architecture.njit.edu/academics/undergraduate/artanddesign/dd-brochure.pdf
• ModelSim basics:
www.tkt.cs.tut.fi/tools/public/tutorials/mentor/modelsim/getting_started/gms.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-regulatory-
devices/speedometer.htm
Illustration Index
Illustration 1: Automobile Tachometer......................................................................................................3
Illustration 2: Galvanometer......................................................................................................................7
Illustration 3: Entity Diagram....................................................................................................................8
Illustration 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