Quiz 2 Topics Flashcards
Cooperative Multitasking
the threads/tasks decide which tasks to do and for how long (this means potentially one task could run forever and prevent others from ever running)
Preemptive Multitasking
the OS decides which tasks to do and for how long. Run by the scheduler, based on time and priority
Scheduler Issues (timing of tasks and switching between them)
must consider the time it takes to switch between tasks.
if time to run tasks is small - waste time switching too often
if time to run tasks is large - slow response
Threads
a function that runs inside of a program/process that shares memory with that process
every process has at least one thread but it can have multiple threads of different priorities
Real Time OS
special operating system designed to give reliable timing.
minimizes task switching time
Semaphore vs Queue
semaphore - thread safe, signals between tasks
queue - thread safe, passes data between tasks
using vTaskDelay (or similar) vs dummy loops to burn time
vTaskDelay type functions allow the OS to use the ‘dead time’ to do something else, where as dummy loops just waste it.
D/A converter
how to calculate its resolution
summing op amp
resolution =voltage range/[ (2^number of bits)-1]
A/D converter - Single Slope
uses an integrator (to integrate reference voltage function), compares the measured value to the integrator output - records the time when those values are equal
very accurate, not as fast
used in multimeters
A/D converter - Flash
uses big voltage dividers, compares measured value with each node in the voltage divider
very fast, limited resolution
A/D converter - Successive Approximations
uses output from D/A converter (makes a guess) and compares to measured value. keeps “guessing” until it gets close enough to the input.
Digital Input
discrete values, typically uses a voltage level of 0 to 5V
Digital Input
discrete values
source - output a voltage, processor supplies power
sink - ground when switch is closed, requires external power
Analog Input
unipolar and bipolar
continuous range of values
unipolar = 0 to +V bipolar = -V to +V
use an opamp to amplify a small signal
use a voltage divider to decrease a large signal
Analog Output
continuous range of values
also output using pulse width modulation
amplify using a power transistor
PWM
uses transistor in full on or full off state to minimize the energy dissipated by the transistor
relies on dynamics of the system to smooth out switch effect
duty cycle % is proportional to effective output voltage
Digital Encoders - absolute using binary
generates a unique code for each shaft position. When powered up, they do not require a reset cycle even if the shaft was rotated while the power was switched-off
Digital Encoders - incremental
what is a quadrature
sends an A and B pulse output that has to be counted by an external controller. provides incremental counts relative to a “start” or “home” position.
quadrature - two tracks (A and B) that are 90 deg out of phase. this is important for bidirectional position sensing
Doppler Radar
shoots a beam of radio waves at a moving object to measure speed. this places no load on the measured object, just measures the change in frequency that occurs when the object is hit with the radio waves.
ex: used in police scanners
Tachometer
measure angular velocity
attach an electric generator to the end of the rotating shaft, the output of which is a voltage that is a function of the shaft’s angular velocity
Magnetic Pickup
measures angular velocity
small magnet wrapped with a coil of insulated wire and placed in a metal case. when the end of the magnet is placed near a magnetic material (ex: rotating gear) the magnetic field changes and there is a pulse voltage induced in the coil. when the material is removed, there is a pulse of opposite sign. the pulse frequency is proportional to angular velocity.
Stroboscopic Tachometer
measures shaft speed
produces flashing light at a user controlled frequency that is shined on a rotating shaft or pulley that has a mark on one position. the user adjusts the flash frequency until the mark appears stationary.
read out directly in rpm
Piezoelectric Accelorometer
measures change in acceleration
consists of a housing mass, a preloading spring sleeve, and a piezoelectric sensing element that can generate charge. when subject to acceleration, the force on the sensing element is altered and it generates charge which is sensed with an amplifier.
Strain Gage Accelerometers
measures change in acceleration
uses strain gages as the sensing elements. they have low natural frequency limits (way less than that of piezoelectric type), but they are way less expensive.