Tuesday, January 31, 2017

LT Spice

Types of files:
  1. library files - .lib (SPICE file)
    • .model file that are for intrinsic devices like diodes and transistors
    • .sub or .subckt file are for subcircuit components like opamps that are made up of diodes and transistors
  2. symbol file - .asy
Adding third party model to LT Spice:

Adding a PSpice model of any thrid party vendor to LTSpice:
Example: TLV2316 opamp
  • Open the spice model file of component TLV316.cir or TLV316.txt
  • Copy the SPICE model name TLV316 from .subckt TLV316 IN+ IN- VCC VEE OUT
  • Open LTSpice and Add component symbol: Component->opamp->Universal opamp 
  • Right click on the component and Add SPICE model name to SPICEModel
  • Open SPICE Direcetive and add command: 
.lib D:\ingodbsu\Documents\LTspiceXVII\lib\user_addition\TLV2316\TLV316.txt
  • Set the simulation command
  • Save it and you are done

Monday, January 30, 2017

CAN protocol basic information

CAN - Control Area Network protocol
Multi-master & multicast/ broadcast type system
2 wire interface (Differential signal) CANH CANL

Reliable communication protocol compared to Ethernet. Its better than Ethernet because, in Ethernet when multiple nodes are sending data over the network collision is detected and jamming signal is sent on the line. This causes loss of Bandwidth.
Whereas in CAN, there is a concept called arbitration and hence there is loss of Bandwidth. This makes it reliable and real-time, best suitable for industries where real-time is of utmost priority.

Multiple CAN standards like CiADS301 (CAN in Autoamtion Data Structure) are defined based on
  1. Framework of application
  2. Device profile 
  3. Application profile
CANOpen is a protocol built over CAN. It consist of software part and application
In terms of OSI model task can be divided as
  1. Physical layer: bit transmit and receive
  2. Data link layer: synchronization at start of packet
  3. Network layer: arbitration, addressing
  4. Transport layer: segmentation of large data into small packets
  5. Session layer: handles complete communication cycle. like in case of SDO request to response
  6. Presentation layer: Object dictionary (OD) data handling
  7. Application layer: Requirement specific
Physical layer: CAN Transceiver
Data, Network: CAN Controller
Transport, Session, Presentation & Application layer: Software running on Microcontroller

Why TCP/IP cant be used instead ?
  1. It takes lot of resources of CPU and memory to implement
  2. Cost of HW and SW will be more
  3. TCP/IP is not developed for this purpose. Each packet is 1500 bytes with overhead of 24bytes. Hence if actual data is 1 or 2 bytes then unnecessarily redundancy is introduced.
  4. Jamming signal on collision problem. Hence cant be used for real-time critical applications.
Criteria for deciding on any protocol to use
  1. Performance provided
  2. Price
  3. Resources need

OPAMP parameters and configuration

Types of OPAMP:

  1. Voltage feedback opamp
  2. Current feedback opamp

NOTE: Mostly we use voltage opamps

Configurations:

  1. Voltage Amplifier: Voltage input, Voltage output 
  2. Current Amplifier: Current input, Current output
  3. Trans-impedance Amplifier: Current input, Voltage output
  4. Trans-conductance Amplifier: Voltage input, Current output
Parameters:
  1. Supply voltage range: (Offseted or Rail-to-rail): 
    • Rail to rail are preferred for better range of output voltage
    • This helps in using full range of ADC to which opamp output is connected
    • Otherwise ADC needs to be more precise i.e. more bits of ADC
  2. Single / Dual supply operation supported/ NOT:
  3. Input common mode voltage range
  4. Input impedance
  5. Output Voltage range
  6. Large signal voltage gain
  7. Gain Bandwidth Product:
    • Concept of Gain bandwidth product remaining the same, applies only to voltage feedback opamps
    • For current feedback opamps, feedback resistor is fixed
  8. Slew rate
  9. Output current Sink and source
  10. Input Bias current:
    • Very low for FETs and CMOS input stages
    • Compensation resistor can be added to reduce the bias current
    • But, it has a trade-off. It increases the johnson noise which in turns increases the noise voltage in the circuit
  11. Input offset current
  12. Input offset voltage
  13. Input noise voltage (nV/sqrt(Hz)): 
    • For calculating noise voltage introduced in the circuit = Input noise voltage x (sqrt (bandwidth of opamp))
    • Noise in the circuit also increases with increase in resistors outside the circuit
  14. Common Mode Rejection Ratio (CMRR)
  15. Power Supply Rejection Ratio (PSRR)
  16. Total harmonic Distortion
For precision opamps, following parameters are very important:
  • Input bias current (Ib) = ((Ib+) + (Ib-))/2
  • Input offset current (Iio) = ((Ib+) - (Ib-))
  • Input offset voltage (Vio)
  • Input noise voltage (Vn) = sqrt(4KTB)
  • Effect of temperature on Input offset voltage
  • Trade of between, Input bias current compensation v/s Input noise voltage

Friday, January 27, 2017

Electromagnetic Interference and considerations

Sources of EMI:

  1. Conducted EMI
  2. Radiated EMI
Mediums of EMI:
  1. Wires - conducted EMI
  2. Air/ Space - Radiated EMI
EMI is usually due to 
  • Near by RF transmitter for High frequency noise
  • Switch Mode Power Supply (SMPS) for medium frequency switching noise
  • Low frequency noise like from high voltage AC lines operating at 50Hz or so...
EMI noise is received into the circuit mainly because of 
  • Long tracks
  • Hanging wires
Compoenents like OPAMP may have the parameter EMIRR
  • Electromagnetic Interference Rejection Ratio
  • Better the EMIRR better is the EMI noise immunity of the compoenent
  • There are ESD protection diode inside the OPAMP
FCC limits


Circuit board layout tips:
  1. Keep all connectors on one side
  2. Don't keep high speed circuitary between connectors
  3. Poor decoupling
  4. Short traces for 
  5. Separate the low frequency (Analog signals) and high frequency (Digital signals) grounds i.e. place inductor or ferrite beads to connect grounds of low and high frequency plane
Follow link is a very good example of EMC

Points to consider when designing a circuit board:
  1. Design of ground plane
    • Separation of analog and digital planes
    • But care should be  taken between separting ground planes, because when the nearby connector  (analog and digital) have separate ground planes, this will introduce small potential difference between then, which cause connector cables emitting radiation
    • Coaxial cable have one signal and one ground casing.
    • Hence differential signals i.e. no need of ground plane is the best option to avoid high frequency noise on the ground plane
    • So, selecting OPAMP with differential input is necessary when the input signal is very sensitive to noise from ground plane
    • As C = Ae/d; A = common area of planes, d = distance between planes; so more widely spread power and ground planes, and closer the planes is the best for increasing the inherent capacitance between power and ground
    • Read concept of "common impedance coupling"
  2. Location of high speed circuitry
    • Metal enclosure of product is always better than a plastic enclosure, as metal shorts out the potential difference between the various connectors.
    • Eventually metal casing reduces the radiation to other circuitry, and increase the chances of clearing EMC requirements

  3. Analog signal current return path
    • Dedicated analog return(ground) path for low frequency (analog) signal, and connecting it to ground plane at one point will solve the problem
    • Read topic "Identifying current path"
  4. Routing of clock traces
    • Long distance clock traces are likely to emit EMI to other circuit. So minimize as far as possible
    • Routing clock at the edge of board is a bad idea as it increases coupling of noise of other nearby circuits
  5. Decoupling capacitors
    • Decoupling capacitors should be close (local decoupling) to VDD of IC when the power and ground plane are separated by distance more than 1mm (Far placed)
    • Decoupling capacitors can be placed away from the ICs when the power and ground plane are placed close as 0.25mm
    • If power plane is farthest from the components, then decoupling capacitors should be placed close to VDD
    • If ground plane is farthest from the components, then decoupling capacitors should be placed close to GND
  6. Power Integrity
    • This means adequate decoupling
  7. Noise immunity
    • Radiating emission structures on board are usually of lengths greater than 1/10th of the wavelength of signal they carry
  8. Immunity to ESD and fast transients
    • Filter io and power lines

Thursday, January 5, 2017

Green colour's in your balcony. Want it.....? (Yes): Follow me

Important points for gardening in pots:

  1. Soil
  2. Compost
  3. Fertilizer
  4. Pest control
  5. Plant pot
Soil:
  • One should use potting soil for plants in pots
  • Normal garden soil is not good for plants that are to be planted in pots as air flow and draining is not that efficient. This can affect the plant growth considerably
  • Potting mix has just the perfect water holding capacity required for pot plants
  • Also add organic compost to potting mix for better nutrition value
Compost:
  • Compost adds excellent macro nutrition to soil and eventually to the plant. Its has ingredients  like carbon, iron etc. that are not prime requirements of plants but, they certainly do play a role
  • Compost made from cow dung is very high in nutrition. It is available locally at plant nursery.
  • Earth worm compost is the best if you can get it
Fertilizer:
  • N-P-K are the basic components for plant growth
    • Nitrogen (N) - Useful for plant leaf growth
    • Phosphorous (P) - Required for flower and fruit growth
    • Potassium (K) - Required for plant strength, general supporting ingredient for plant
  • When buying and fertilizer check the NPK value
  • Usually numbers are like NPK= 20-5-5
  • DAP (Di-ammonium phosphate) has nitrogen and phosphorous in large quantities that boost the plant leaf, flower and fruit growth. It is one of the famous fertilizers used.
  • But try using organic fertilizers are fast as possible
  • RHBP- Liquid Bio-Fertilizer is the famous that I found on amazon
  • DAP fertilizer are available with all local garden plant nursery also.
Pest control:
  • Mealy bug is the most that I observed on the plants that grow in city
  • Indications of mealy bug on plant are, the leaf of plant are not straight. Leaf that turn crooked are most of the times having mealy bug growth on/under the leaf.
  • Plants die if not attended in time. Bugs take away the vital nutrient of the plant nitrogen and phosphorous.
  • Hence don't over fertilize the plant as it attracts more mealy bug
  • Neem oil extract related pest controls, are the best pest control for mealy bug
  • Organic Dews Organic Neem Oil is also good for mealy bug problem
Plant pot:
  • Pot should have holes in the bottom to drain the extra water. Water logging shouldn't be the case in pots
  • Lay some small stones or pebbles in the bottom of pot
  • Some coconut husk above it
  • Mix the potting soil with compost in 50-50 proportion and fill the pot 3-4 inch
  • Make a hole in the middle and place the plant
  • Add some more mix 1-2 inch. In case of seeds only add 1 inch of mix above, so that seeds could germinate easily.
  • Fill the pot with mix only to point which is 1-2 inch below the top edge of the pot
  • Now add some water to the pot
  • Purna Mitti is good potting mix

PROFILE

My photo
India
Design Engineer ( IFM Engineering Private Limited )

Followers