Chitika

Sunday, March 22, 2015

Brushed DC Motor Speed & Direction Control Using H-Bridge Circuit & PWM

An H-Bridge is a circuit that you can use to control the direction and speed of a Brushed DC Motor.The H-Bridge that is being discussed in this blog post can work with input voltage between 6-15V  for 2A current load. 30W power is enough for small to medium size motors.Though it is not the most efficient H-bridge but it is good for a simple motor control circuits.

Sunday, March 15, 2015

What is an FSM?

A state machine, which is more precisely defined as a finite state machine,
consists of a set of states and a transition function that maps to the next state.
Finite state machines have many variations. The two most common finite
state machines are the Mealy machine and the Moore machine. A Mealy
machine performs an action for each transition. A Moore machine performs
a specific action for each state in the state transition diagram. The state
machine design pattern template in LabVIEW implements any algorithm

Use state machines in applications where distinguishable states exist. Each
state can lead to one or multiple states or end the process flow. A state
machine relies on user input or in-state calculation to determine which state
to go to next. Many applications require an initialization state, followed by
a default state, where many different actions can be performed. The actions
performed can depend on previous and current inputs and states. A
shutdown state is commonly used to perform clean up actions.

described by a Moore machine.
An FSM is a digital sequential circuit that can follow a number of predefined states under the
control of one or more inputs.Note that some FSMs have a clock input and are called synchronous FSMs, i.e. those that do not belong to a type of FSM called asynchronous FSMs.A synchronous FSM can move between states only if a clock pulse occurs.Block diagram of an FSM based application is shown in the Figure 1 below :
Figure 1 : Block diagram of an FSM-based application.
Each state of the FSM needs to be identifiable. This is achieved by using a number of
internal (to the FSM block) flip-flops. An FSM with four states would require two flip-flops,
since two flip-flops can store 22 ¼ 4 state numbers.Each state has a unique state number, and states are usually assigned numbers as s0 (state 0), s1, s2, and s3 (for the four-state example). The rule here is
Number of states ¼ 2Number of flip flops;
for which
Number of flip flops ¼ log10
ðNumber of statesÞ
log10
ð2Þ :
So anFSMwith 13 states would require 24 flip-flops (i.e. 16 states, of which 13 are used in the
FSM); that is:
Number of flip flops ¼ log10
ð13Þ
log10
ð2Þ
¼ 3:7:
This must be rounded up to the nearest integer, i.e. 4.

As well as containing flip-flops to define the individual states of theFSMuniquely, there is
also combinational logic that defines the outside-world outputs. In addition, the outsideworld

inputs connect to combinational logic to supply the flip-flops inputs.

Thursday, March 5, 2015

Labview Program to Plot numerical data written to and Read from a Text File

This is a simple Labview Program to write numerical data,that may come from any sensor or instrument interfaced with PC,to a text file and then read that data to plot that data on a waveform chart.In this code,to simulate the generation of numerical data a random number generator function has been used which writes data to text file and upon reading that written data plots that data on a waveform chart.Labview 2012 has been used for development of this Labview code.There are two tabs on the front panel one writing data to text file and the other one is for reading data from text file.
The screenshots of the Front Panel are shown in Figure 1 & Figure 2 below:
Figure 1

Sunday, March 1, 2015

Proteus VSM Simulation for Reading Active High Push Button Input for PIC18F4520

This is a simple Proteus VSM Simulation for reading Active High Push Button Inputs for PIC18F4520 8-bit Microcontrller.Screengabs of this simulation Circuit drawn in Proteus VSM both when simulation is not running and when simulation is running are shown in Figures 1 & 2 respectively.The C code for this simulation has been written in CCS for PICC Compiler.The download link for this complete Project including C Code is given below.
Figure 1