Here is the code for an open loop speed controller:
#include <PWM.h>
#define ENABLE 5
#define DIR1 3
#define DIR2 4
void setup() {
pinMode(ENABLE, OUTPUT);
pinMode(DIR1, OUTPUT);
pinMode(DIR2, OUTPUT);
PWM.begin();
PWM.setPeriod(500); // Period in microseconds
}
void loop() {
// Run motor forward at half speed
digitalWrite(DIR1, HIGH);
digitalWrite(DIR2, LOW);
PWM.setDuty(ENABLE, 50); // Duty cycle in percent
delay(2000); // Run for 2 seconds
PLC Ladder Diagram basics, with two solved examples
For more information go to
http://shrutizpresentations.blogspot.in/2014/04/plc-ladder-diagram-basics.html
PLC Ladder Diagram basics, with two solved examples
For more information go to
http://shrutizpresentations.blogspot.in/2014/04/plc-ladder-diagram-basics.html
this presentation gives a clear idea of how the servo motor and servo drive working explained in detail and attached video have a clear idea of how servo motor works......enjoy, i hope you will like this.... :)
Introduction to Mechatronics, Sensors and Transducerstaruian
Introduction: Definition, Multidisciplinary Scenario, Evolution of Mechatronics, Design of Mechatronics system, Objectives, advantages and disadvantages of Mechatronics
Transducers and sensors: Definition and classification of transducers, Difference between transducer and sensor, Definition and classification of sensors, Principle of working and applications of light sensors, proximity switches and Hall Effect sensors.
Module 5 hydraulics and pneumatics Actuation systemstaruian
Pneumatic and hydraulic actuation systems: Pneumatic and hydraulic systems actuating systems.
Classifications of Valves: Pressure relief valves, Pressure regulating / reducing valves
Cylinders and rotary actuators.
DCV & FCV: Principle & construction details.
Types of sliding spool valve & solenoid operated.
Symbols of hydraulic elements, components of hydraulic system, functions of various units of hydraulic system.
Design of simple hydraulic circuits for various applications
PLC ARCHITECTURE AND HARDWARE COMPONENTSAkshay Dhole
Explains about the basics of PLC ARCHITECTURE AND HARDWARE COMPONENTS.
A Programmable Logic Controller (PLC) is a specialized computing system used for control of industrial machines and processes.
A PLC is a computer designed to work in an industrial environment
This presentation gives the information about introduction to control systems
Subject: Control Engineering as per VTU Syllabus of Aeronautical Engineering.
Notes Compiled By: Hareesha N Gowda, Assistant Professor, DSCE, Bengaluru-78.
Disclaimer:
The contents used in this presentation are taken from the text books mentioned in the references. I do not hold any copyrights for the contents. It has been prepared to use in the class lectures, not for commercial purpose.
PLC is an industrial computer designed for multiple inputs and output arrangements. It is capable of storing the instructions to implement control functions such as sequencing, timing, counting, arithmetic, data manipulation and communication.
this presentation gives a clear idea of how the servo motor and servo drive working explained in detail and attached video have a clear idea of how servo motor works......enjoy, i hope you will like this.... :)
Introduction to Mechatronics, Sensors and Transducerstaruian
Introduction: Definition, Multidisciplinary Scenario, Evolution of Mechatronics, Design of Mechatronics system, Objectives, advantages and disadvantages of Mechatronics
Transducers and sensors: Definition and classification of transducers, Difference between transducer and sensor, Definition and classification of sensors, Principle of working and applications of light sensors, proximity switches and Hall Effect sensors.
Module 5 hydraulics and pneumatics Actuation systemstaruian
Pneumatic and hydraulic actuation systems: Pneumatic and hydraulic systems actuating systems.
Classifications of Valves: Pressure relief valves, Pressure regulating / reducing valves
Cylinders and rotary actuators.
DCV & FCV: Principle & construction details.
Types of sliding spool valve & solenoid operated.
Symbols of hydraulic elements, components of hydraulic system, functions of various units of hydraulic system.
Design of simple hydraulic circuits for various applications
PLC ARCHITECTURE AND HARDWARE COMPONENTSAkshay Dhole
Explains about the basics of PLC ARCHITECTURE AND HARDWARE COMPONENTS.
A Programmable Logic Controller (PLC) is a specialized computing system used for control of industrial machines and processes.
A PLC is a computer designed to work in an industrial environment
This presentation gives the information about introduction to control systems
Subject: Control Engineering as per VTU Syllabus of Aeronautical Engineering.
Notes Compiled By: Hareesha N Gowda, Assistant Professor, DSCE, Bengaluru-78.
Disclaimer:
The contents used in this presentation are taken from the text books mentioned in the references. I do not hold any copyrights for the contents. It has been prepared to use in the class lectures, not for commercial purpose.
PLC is an industrial computer designed for multiple inputs and output arrangements. It is capable of storing the instructions to implement control functions such as sequencing, timing, counting, arithmetic, data manipulation and communication.
final Year Projects, Final Year Projects in Chennai, Software Projects, Embedded Projects, Microcontrollers Projects, DSP Projects, VLSI Projects, Matlab Projects, Java Projects, .NET Projects, IEEE Projects, IEEE 2009 Projects, IEEE 2009 Projects, Software, IEEE 2009 Projects, Embedded, Software IEEE 2009 Projects, Embedded IEEE 2009 Projects, Final Year Project Titles, Final Year Project Reports, Final Year Project Review, Robotics Projects, Mechanical Projects, Electrical Projects, Power Electronics Projects, Power System Projects, Model Projects, Java Projects, J2EE Projects, Engineering Projects, Student Projects, Engineering College Projects, MCA Projects, BE Projects, BTech Projects, ME Projects, MTech Projects, Wireless Networks Projects, Network Security Projects, Networking Projects, final year projects, ieee projects, student projects, college projects, ieee projects in chennai, java projects, software ieee projects, embedded ieee projects, "ieee2009projects", "final year projects", "ieee projects", "Engineering Projects", "Final Year Projects in Chennai", "Final year Projects at Chennai", Java Projects, ASP.NET Projects, VB.NET Projects, C# Projects, Visual C++ Projects, Matlab Projects, NS2 Projects, C Projects, Microcontroller Projects, ATMEL Projects, PIC Projects, ARM Projects, DSP Projects, VLSI Projects, FPGA Projects, CPLD Projects, Power Electronics Projects, Electrical Projects, Robotics Projects, Solor Projects, MEMS Projects, J2EE Projects, J2ME Projects, AJAX Projects, Structs Projects, EJB Projects, Real Time Projects, Live Projects, Student Projects, Engineering Projects, MCA Projects, MBA Projects, College Projects, BE Projects, BTech Projects, ME Projects, MTech Projects, M.Sc Projects, Final Year Java Projects, Final Year ASP.NET Projects, Final Year VB.NET Projects, Final Year C# Projects, Final Year Visual C++ Projects, Final Year Matlab Projects, Final Year NS2 Projects, Final Year C Projects, Final Year Microcontroller Projects, Final Year ATMEL Projects, Final Year PIC Projects, Final Year ARM Projects, Final Year DSP Projects, Final Year VLSI Projects, Final Year FPGA Projects, Final Year CPLD Projects, Final Year Power Electronics Projects, Final Year Electrical Projects, Final Year Robotics Projects, Final Year Solor Projects, Final Year MEMS Projects, Final Year J2EE Projects, Final Year J2ME Projects, Final Year AJAX Projects, Final Year Structs Projects, Final Year EJB Projects, Final Year Real Time Projects, Final Year Live Projects, Final Year Student Projects, Final Year Engineering Projects, Final Year MCA Projects, Final Year MBA Projects, Final Year College Projects, Final Year BE Projects, Final Year BTech Projects, Final Year ME Projects, Final Year MTech Projects, Final Year M.Sc Projects, IEEE Java Projects, ASP.NET Projects, VB.NET Projects, C# Projects, Visual C++ Projects, Matlab Projects, NS2 Projects, C Projects, Microcontroller Projects, ATMEL Projects, PIC Projects, ARM Projects, DSP Projects, VLSI Projects, FPGA Projects, CPLD Projects, Power Electronics Projects, Electrical Projects, Robotics Projects, Solor Projects, MEMS Projects, J2EE Projects, J2ME Projects, AJAX Projects, Structs Projects, EJB Projects, Real Time Projects, Live Projects, Student Projects, Engineering Projects, MCA Projects, MBA Projects, College Projects, BE Projects, BTech Projects, ME Projects, MTech Projects, M.Sc Projects, IEEE 2009 Java Projects, IEEE 2009 ASP.NET Projects, IEEE 2009 VB.NET Projects, IEEE 2009 C# Projects, IEEE 2009 Visual C++ Projects, IEEE 2009 Matlab Projects, IEEE 2009 NS2 Projects, IEEE 2009 C Projects, IEEE 2009 Microcontroller Projects, IEEE 2009 ATMEL Projects, IEEE 2009 PIC Projects, IEEE 2009 ARM Projects, IEEE 2009 DSP Projects, IEEE 2009 VLSI Projects, IEEE 2009 FPGA Projects, IEEE 2009 CPLD Projects, IEEE 2009 Power Electronics Projects, IEEE 2009 Electrical Projects, IEEE 2009 Robotics Projects, IEEE 2009 Solor Projects, IEEE 2009 MEMS Projects, IEEE 2009 J2EE P
early 1871 Belgian inventor Zénobe Gramme invented a generator powerful enough to produce power on a commercial scale for industry.[1]
In 1878, a hydroelectric power station was designed and built by William, Lord Armstrong at Cragside, England. It used water from lakes on his estate to power Siemens dynamos. The electricity supplied power to lights, heating, produced hot water, ran an elevator as well as labor-saving devices and farm buildings.[2]
In January 1882 the world's first public coal-fired power station, the Edison Electric Light Station, was built in London, a project of Thomas Edison organized by Edward Johnson. A Babcock & Wilcox boiler powered a 93 kW (125 horsepower) steam engine that drove a 27-tonne (27-long-ton) generator. This supplied electricity to premises in the area that could be reached through the culverts of the viaduct without digging up the road, which was the monopoly of the gas companies. The customers included the City Temple and the Old Bailey. Another important customer was the Telegraph Office of the General Post Office, but this could not be reached through the culverts. Johnson arranged for the supply cable to be run overhead, via Holborn Tavern and Newgate.[3]
In September 1882 in New York, the Pearl Street Station was established by Edison to provide electric lighting in the lower Manhattan Island area. The station ran until destroyed by fire in 1890. The station used reciprocating steam engines to turn direct-current generators. Because of the DC distribution, the service area was small, limited by voltage drop in the feeders. In 1886 George Westinghouse began building an alternating current system that used a transformer to step up voltage for long-distance transmission and then stepped it back down for indoor lighting, a more efficient and less expensive system which is similar to modern systems. The war of the currents eventually resolved in favor of AC distribution and utilization, although some DC systems persisted to the end of the 20th century. DC systems with a service radius of a mile (kilometer) or so were necessarily smaller, less efficient of fuel consumption, and more labor-intensive to operate than much larger central AC generating stations.early 1871 Belgian inventor Zénobe Gramme invented a generator powerful enough to produce power on a commercial scale for industry.[1]
In 1878, a hydroelectric power station was designed and built by William, Lord Armstrong at Cragside, England. It used water from lakes on his estate to power Siemens dynamos. The electricity supplied power to lights, heating, produced hot water, ran an elevator as well as labor-saving devices and farm buildings.[2]
In January 1882 the world's first public coal-fired power station, the Edison Electric Light Station, was built in London, a project of Thomas Edison organized by Edward Johnson. A Babcock & Wilcox boiler powered a 93 kW (125 horsepower) steam engine that drove a 27-tonne (27-long-ton) generator. This supplk
Explore the innovative world of trenchless pipe repair with our comprehensive guide, "The Benefits and Techniques of Trenchless Pipe Repair." This document delves into the modern methods of repairing underground pipes without the need for extensive excavation, highlighting the numerous advantages and the latest techniques used in the industry.
Learn about the cost savings, reduced environmental impact, and minimal disruption associated with trenchless technology. Discover detailed explanations of popular techniques such as pipe bursting, cured-in-place pipe (CIPP) lining, and directional drilling. Understand how these methods can be applied to various types of infrastructure, from residential plumbing to large-scale municipal systems.
Ideal for homeowners, contractors, engineers, and anyone interested in modern plumbing solutions, this guide provides valuable insights into why trenchless pipe repair is becoming the preferred choice for pipe rehabilitation. Stay informed about the latest advancements and best practices in the field.
Student information management system project report ii.pdfKamal Acharya
Our project explains about the student management. This project mainly explains the various actions related to student details. This project shows some ease in adding, editing and deleting the student details. It also provides a less time consuming process for viewing, adding, editing and deleting the marks of the students.
Overview of the fundamental roles in Hydropower generation and the components involved in wider Electrical Engineering.
This paper presents the design and construction of hydroelectric dams from the hydrologist’s survey of the valley before construction, all aspects and involved disciplines, fluid dynamics, structural engineering, generation and mains frequency regulation to the very transmission of power through the network in the United Kingdom.
Author: Robbie Edward Sayers
Collaborators and co editors: Charlie Sims and Connor Healey.
(C) 2024 Robbie E. Sayers
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSEDuvanRamosGarzon1
AIRCRAFT GENERAL
The Single Aisle is the most advanced family aircraft in service today, with fly-by-wire flight controls.
The A318, A319, A320 and A321 are twin-engine subsonic medium range aircraft.
The family offers a choice of engines
Vaccine management system project report documentation..pdfKamal Acharya
The Division of Vaccine and Immunization is facing increasing difficulty monitoring vaccines and other commodities distribution once they have been distributed from the national stores. With the introduction of new vaccines, more challenges have been anticipated with this additions posing serious threat to the already over strained vaccine supply chain system in Kenya.
Welcome to WIPAC Monthly the magazine brought to you by the LinkedIn Group Water Industry Process Automation & Control.
In this month's edition, along with this month's industry news to celebrate the 13 years since the group was created we have articles including
A case study of the used of Advanced Process Control at the Wastewater Treatment works at Lleida in Spain
A look back on an article on smart wastewater networks in order to see how the industry has measured up in the interim around the adoption of Digital Transformation in the Water Industry.
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxR&R Consult
CFD analysis is incredibly effective at solving mysteries and improving the performance of complex systems!
Here's a great example: At a large natural gas-fired power plant, where they use waste heat to generate steam and energy, they were puzzled that their boiler wasn't producing as much steam as expected.
R&R and Tetra Engineering Group Inc. were asked to solve the issue with reduced steam production.
An inspection had shown that a significant amount of hot flue gas was bypassing the boiler tubes, where the heat was supposed to be transferred.
R&R Consult conducted a CFD analysis, which revealed that 6.3% of the flue gas was bypassing the boiler tubes without transferring heat. The analysis also showed that the flue gas was instead being directed along the sides of the boiler and between the modules that were supposed to capture the heat. This was the cause of the reduced performance.
Based on our results, Tetra Engineering installed covering plates to reduce the bypass flow. This improved the boiler's performance and increased electricity production.
It is always satisfying when we can help solve complex challenges like this. Do your systems also need a check-up or optimization? Give us a call!
Work done in cooperation with James Malloy and David Moelling from Tetra Engineering.
More examples of our work https://www.r-r-consult.dk/en/cases-en/
Quality defects in TMT Bars, Possible causes and Potential Solutions.PrashantGoswami42
Maintaining high-quality standards in the production of TMT bars is crucial for ensuring structural integrity in construction. Addressing common defects through careful monitoring, standardized processes, and advanced technology can significantly improve the quality of TMT bars. Continuous training and adherence to quality control measures will also play a pivotal role in minimizing these defects.
1. MECHATRONICS 2
Interfacing and PC based
Computer
AIN SHAMS UNIVERSITY
FACULTY OF ENGINEERING
MECHATRONICS ENGINEERING DEPARTMENT
1
Dr. Shady A. Maged
2. Interfacing in the Mechatronics System
ConfigurationMechanical
System
Controller
Actuators
Sensors
Signal
Processing
Power
Amplification
Interfacing
2
3. Interfacing a switch (input device) to a
digital circuit:
Using pull-up resistor Using pull-down resistor
When the switch is open the voltage of the gate
input is pulled up to the level of Vin. When the
switch is closed, the input voltage at the gate
goes to ground.
Pull-up and pull-down resistors are used in electronic logic circuits to ensure that
inputs to logic systems settle at expected logic levels if external devices are
disconnected or high-impedance is introduced. They may also be used at the
interface between two different types of logic devices, possibly operating at different
power supply voltages.
3
5. Mechanical switch
The function of a switch is simple. When we press a switch,
two contacts are joined together and connection is made. Still,
it is not that simple. The problem lies in the imperfection of
mechanical contacts. That is to say, before contact is made or
cut off, there is a short time period when vibration (oscillation)
can occur as a result of unevenness of mechanical contacts, or
as a result of the different speed in pressing a key (this
depends on person who presses the key). The term given to
this phenomenon is called SWITCH (CONTACT) DEBOUNCE.
Bouncing while transition from high to low
Bouncing while transition from low to high
Switch De-bouncing
5
6. Due to this problem, there won't be a clean transition from a state to another, but
instead there will be a series of high and low states spikes as shown in figure 1B.
The 'unknown' range can be recognized by some a digital circuit as 1 or 0, but in a
completely random manner.
This series of spikes can be interpreted by a microcontroller (or any digital circuit)
as if the button was pressed many times. It may even have happened to you
before when you connected a switch to a counter of any kind, and notice that one
press on the button is sometimes counted as more than one push.
Fig. 1A: A simple switch configuration
without a de-bouncing circuit
Fig. 1B: Behavior of a switch without a
de-bouncing circuit
De-bouncing
6
7. There are 2 common solutions to this problem. Analog solution and digital
micro-controller based solution. Both are commonly used, and sometimes,
both are used at the same time to provide a very stable design.
The analog de-bouncing circuit
Fig. 2A: A switch with a de-
bouncing circuit
Fig. 2B: A switch with a de-
bouncing circuit
• The analog solution relies principally on a capacitor, which plays the role of
resisting the voltage changes on the output.
De-bouncing
7
8. The software based de-bouncing
the idea here is not to prevent voltage spikes to occur, but rather to record them
and analyze them in real-time using simple software routines.
The timing T1, T2 and T3 corresponds to the low (logic =0) pulses being sent to the
microcontroller from the switch. T1 and T2 are the length of the reading we want to
get rid off, or more scientifically, that we want to filter. T3 is a valid reading that we
want to take in account. It is clear that the difference between those three periods
is their length, and that is how the micro-controller will be able to differentiate
between valid and un-valid pulses.
8
9. There are many ways to implement digital de-bouncing or filtering using a
microcontroller, one simple method is to make a counter count up as long as
the signal is Low, and reset this counter when the signal is high. If the counter
reach a certain fixed value, which should be 1 or 2 times bigger than T1 or T2
(noise pulses), this means that the current pulse is a valid pulse (corresponds
to T3 in our example).
Another way to de-bounce using software is to wait for a certain time interval until
the switch oscillations disappear. i.e. after the MICROCONTROLLER realizes the
first state transition it waits for a certain period say (100 ms) then it takes the
action that corresponds to this transition.
9
10. Example:
Required: Write a code that turns
the LED on when T2 is pressed,
and turns it off when T1 is
pressed. You have to come over
switch de-bounce in your software
This circuit has 2 inputs and 1 output
Input T1 Output LED Input T2 Output LED
RA3 RB7 RA2 RB7
0 Unchanged 0 Unchanged
1 OFF (0) 1 ON (1)
10
11. RA3 and RA2 are
inputs, RB7 is output
T2
pressed?
T2
pressed?
YES
LED is ON
NO
NO
Call Delay
YES
START
LED is OFF
T1
pressed?
T1
pressed?
CallDelay
YESNO
NO
Flow Chart
11
12. Transistor
A transistor is a semiconductor device used to amplify and switch electronic
signals. Transistors are commonly used as electronic switches. You can imagine
the collector and emitter as two contact points of a switch. If the base is activated,
then both contact points are closed Together; otherwise they are opened.
Interfacing an inductive load to a
digital circuit through a transistor
When the voltage
across an inductive
load is reduced or
removed a sudden
spike voltage is
seen across the
load
• A resistor (e.g., 1k) to limit
the base current while
ensuring the transistor is in
full saturation
• 24 V DC capable of at least
1A of current
• power diode capable of
carrying at least 1A for
flyback protection (Free
Wheeling Diode) used
whenever inductive loads are
switched off by silicon
components
• ground
12
13. Darlington Pair
The above schematic represents a transistor called as a Darlington Pair which
usually comes in a single package. The advantage of this combination is that the
current gain is the product of two individual transistor gains and can exceed 10000.
They may often be found in power circuits for mechatronic systems.
13
14. Seven-Segment Display (multiplexing)
Circuit diagram for Common
Cathode 7-Segment Display
Circuit diagram for Common
Anode 7-Segment Display
•The segments in a 7-segment display are arranged to form a single digit from 0
to F
• Even though LCD displays are more comfortable to work with, 7-segment
displays are still standard in the industry.
• The 8 LEDs inside each display can be arranged with a common cathode or
common anode.
14
15. •The simplest way to drive a display is via a display driver. These are available for up
to 4 displays.
LT =Lamp Test, BI = Blanking Input, LE = Latch Enable
15
16. •Alternatively displays can be driven by a microcontroller and if more than one
display is required, the method of driving them is called "multiplexing.”
• If a single display is to be driven from a microcontroller, 7 lines will be needed plus
one for the decimal point. For each additional display, only one extra line is needed.
• To produce a 4, 5 or 6 digit display, all the 7-segment displays are connected in
parallel. The common line (the common-cathode line) is taken out separately and
this line is taken low for a short period of time to turn on the display.
• Each display is turned on at a rate above 100 times per second, and it will
appear that all the displays are turned on at the same time. As each display is
turned on, the appropriate information must be delivered to it so that it will give the
correct reading.
16
17. Example
Required: Write a code that displays the number 21 on the common cathode 7-
segment displays using transistors where the hardware connections are shown
above.
17
18. Optocoupler combines a LED
and photo-transistor in the same
case. The purpose of an
optocoupler is to separate two
parts of a circuit.
Why optocoupler?
Interference. One part of a circuit may be in a location where it picks up a
lot of interference (such as from electric motors, welding equipment,
petrol motors etc.) If the output of this circuit goes through an optocoupler to
another circuit, only the intended signals will pass through the
optocoupler. The interference signals will not have enough "strength" to
activate the LED in the optocoupler and thus they are eliminated. To protect a
section of the device. Typical examples are industrial units with lots of
interferences which affect signals in the wires. If these interferences affect the
function of control section, errors will occur and the unit will stop working.
Optocoupler
18
19. •Simultaneous separation and intensification of a signal. A signal as low as
3v is able to activate an optocoupler and the output of the optocoupler can be
connected to an input line of a microcontroller. The microcontroller requires an
input swing of 5v and in this case the 3v signal is amplified to 5v. It can also be
used to amplify the current of a signal.
• High Voltage Separation. Optocouplers have inherent high voltage
separation qualities. Since the LED is completely separate from the photo-
transistor, optocouplers can exhibit voltage isolation of 3kv or higher.
Optocouplers can be used as input or output device. They can have
additional functions such as Schmitt triggering (the output of a Schmitt trigger
is either 0 or 1 - it changes slow rising and falling waveforms into definite
low or high values). Optocouplers are packaged as a single unit or in groups of
two or more in one housing. They are also called PHOTO INTERRUPTERS
where a spoked wheel is inserted in a slot between the LED and phototransistor
and each time the light is interrupted, the transistor produces a pulse.Each
optocoupler needs two supplies in order to function. They can be used with one
supply, but the voltage isolation feature is lost.
19
20. Example:
This example is a counter, used for counting products on production line. Let the
sensor be a micro-switch. Each time the switch is closed, the LED is illuminated.
The LED transfers the signal to the photo-transistor and the operation of the photo-
transistor delivers a LOW to input RA4 of a microcontroller.
Required: write a program that counts the products, and indicates the current
count on any of the outputs of the microcontroller.
Input T1 Output LED
RA4/TCK0 PORTB
Each negative edge Increase by 1
20
21. The Relay
The relay is an electromechanical device, which transforms an electrical signal
into mechanical movement. It consists of a coil of insulated wire on a metal core,
and a metal armature with one or more contacts. When a supply voltage was
delivered to the coil, current would flow and a magnetic field would be produced
that moves the armature to close one set of contacts and/or open another set.
When power is removed from the relay, the magnetic flux in the coil collapses and
produces a fairly high voltage in the opposite direction.
21
22. Interfacing an AC load to a digital
circuit through a relay
Interfacing a DC load to a digital
circuit through a relay
Examples:
22
23. Example on Micro:
Required: Write a code that activates the Relay on when T2 is pressed, and
turns it off when T1 is pressed. You have to come over switch debounce in your
software.
23
27. Controlling the power delivered to the motor to control
the speed .
PWM (pulse width modulation) is the most common way to control the
power delivered to the motor, thus the speed of the motor. It's also the
most efficient method. This article does not intent to explain PWM, but
here is how in works, in very simplified way: The microcontroller generate
pulses of electricity for the motor (instead of constant DC voltage). The
frequency of those pulses remain constant, while the ON period of the
pulse is varied to increase or decrease the speed of the motor. the
Average voltage of the wave of pulses increases gradually as the duty
cycle increases (duty cycle is the ratio of the 'ON' period over the total
period of the pulse). As the average voltage increases, the speed of the
motor will increase gradually.
27
28. Controlling the power delivered to the motor to control
the speed .
Making a speed control program
using the PWM theory is very
simple, which is a code
targeted for any microcontroller
to run the motor at half speed
(50/100) and where the Enable
pin of the motor controller is
connected to specific pin of the
microcontroller:
28
30. H-Bridge
High Side
Left
High Side
Right
Lower
Left
Lower
Right Quadrant Description
On Off Off On Motor goes Clockwise
Off On On Off Motor goes Counter-clockwise
On On Off Off Motor "brakes" and decelerates
Off Off On On Motor "brakes" and decelerates
30
35. Brief Circuit explanation
This is an implementation of the L298 to drive motors and inductive
loads up to 4A continuously. Initially the L298 contains 2 separate
channels, each one capable of driving 2A loads. Connecting them
in parallel as in the schematic makes a single 4A driver.
The two wire connections W1 and W2 are to control the direction
of the motor according to that table:
35
36. Brief Circuit explanation
The 2 transistors Q1 and Q2 act as an OR gate enabling the L298 if
any of the two signals W1 or W2 are high. If both W1 and W2 are
low (logic 0), the driver is disabled and provides a high impedance
on its output, causing an eventually connected motor to move
freely with its inertia.
C1 and C2 are 10 nF decoupling capacitors.
D1 to D4 are flyback diodes. Their forward current should
correspond with the the expected load.
The two leads of the motor are directly connected to J1.
The circuit can be powered with 9 to 35V
36
38. The Analog-to-Digital Converter
There is a device commonly
in microcontrollers called
ADC (Analog to digital
converter). An ADC converts
a varying (analog) voltage
level into a corresponding
digital number.
ADC 0808 which has 8 –
analog inputs (8 - channels)
and gives an 8 – bits value
out as the result of
conversion
38
39. ADC0808 (8-channels 8-bit)
8-channels (8-analog input)
Example : 8 - sensors
8 – bit value out as a result
Of the conversion
3-MUX input select
address lines (Appendix A)
DATA BUS
+5V
GROUND
SUPPLY
500 kHz
39
41. CONTROL LINES
Output Enable line for reading
the ADC (TRI STATE OUTPUT LATCH)
End of Convert line that signals the
Host that the conversion is complete
normaly 1 when finish convert to 0.
Start / ALE line that are tied together
And connected as 1 to the host
45. Example on MICRO with built-in ADC
Construct the hardware connection and the flowchart (for a
Microcontroller) that reads analogue value from channel 2 and
displays it on PORTD (lower 8 bits) and PORTB (2 most significant
bits).
45
45
46. Example on MICRO with built-in ADC
Construct the hardware connection and the flowchart (for a
Microcontroller) that reads analogue value from channel 2 and
displays it on PORTD (lower 8 bits) and PORTB (2 most significant
bits).
46
46
RA2 is input, Port D, RB6
and RB7 are outputs
START
Analogue
value=Temp_res
Port D=Temp_res
Port B=Temp_res>>2
49. Example: Open loop Speed Controller
Write a program that control the speed and the direction of
the DC motor using H-bridge and PWM signal with a duty
cycle based on the analogue input comes from
potentiometer
49
50. SOFTWARE APPROACH
1. Initialize the I/O ports
2. Controlling the ADC and reading the digital value (I/p to the micro)
3. Check if the I/p is 0V therefore the motor is OFF
4. Check if the I/p is 5V therefore the motor is ON
5. knowing that the Duty Cycle= t_high/T *100(%)
and to obtain at 5V, D=100%,
6. Calculate t_high and t_low from the following equations
t_high = digital I/P from input port
t_low= 255 - t_high
7. Obtain delay equals to t_high
8. Clear the output and then obtain delay equals to t_low
9. set the output
10. Repeat steps 7,8 and 9.
50
51. Notice how the heat sink is firmly attached to the driver. this
protects the IC from eventually burning-up from stall
currents .
51
54. Objective:
you will learn here how to implement a digital
proportional gain controller, i.e. a servomotor
controller. The objective of this is to write a program
that generates a PWM signal with a duty cycle based
on the output of a proportional gain controller whose
input is a signal from a potentiometer or encoder
mounted on the shaft of the DC motor. This program
is similar in concept to the open loop speed
controller; however the duty cycle of the PWM signal
is now determined from the error of the input-
feedback calculation.
54
55. Problem Statement:
Write a program that controls the position of the DC motor. The
program should implement a proportional control algorithm. The
system diagram looks like
55
63. General software approach
The program should perform the following sequence of tasks:
Sample the position using ADC.
Calculate the amount and direction of control using a P, or a
PID equation
Output the PWM signal based on the control amount (related
to position error)
Recall from control, that the simplest closed-loop,
proportional feedback controller defines the output as:
Output = K. (Input-Feedback) = K.error
You will need to scale your error signal by some value, k, for
your PWM duty cycle to be high enough to achieve acceptable
system time response. You can easily multiply the error signal
by factors of 2
63
65. LogicTTLRS-232
High+2V … +5V-15V … -3V
Low0V … +0.8V+3V … +15V
MAX 232
The MAX232 is an integrated circuit that
converts signals from an RS-232 serial port to
signals suitable for use in TTL compatible
digital logic circuits.
65
84. Data acquisition is the process of measuring an electrical or
physical phenomenon such as voltage, current, temperature,
pressure, or sound. PC-based data acquisition uses a combination
of modular hardware, application software, and a computer to take
measurements. While each data acquisition (DAQ) system is defined
by its application requirements, every system shares a common goal
of acquiring, analyzing, and presenting information. Data
acquisition systems incorporate signals, sensors, actuators, signal
conditioning, DAQ devices, and application software.
Data Acquisition Cards
84
85. Example
NI USB-6008
The National Instruments USB-6008 provides basic data acquisition functionality
Analog Inputs: 8 SE/4 DI · 10 kS/s · 12 bits
Analog Outputs: 2 · 150 S/s · 12 bits
Digital I/O: 12 DIO
Counter/Timers: 1 · 32 bits · 5 MHz
Measurement Type: Voltage
85
86. NI USB-6251 BNC
The National Instruments USB-6251 BNC is a USB high-performance M
Series multifunction data acquisition
Analog Inputs: 8 SE/4 DI · 1.25 MS/s · 16 bits
Analog Outputs: 2 · 2.86 MS/s · 16 bits
Digital I/O: 24 DIO · 1 MHz
Counter/Timers: 2 · 32 bits · 80 MHz
Measurement Type: Quadrature encoder, Voltage
Example
86
88. Measurement System
Differential Mode (DI)
•Differential Mode
• Two channels used for each signal
• ACH 0 is paired with ACH 8, ACH 1 is paired with ACH 9, etc.
• Rejects common-mode voltage and common-mode noise
88
89. Differential Mode
89
Why would I ever want to use
differential mode?
Placing your measurement system in
differential mode will give you better
measurements, because it allows the
amplifier to reject common-mode voltage
and any common-mode noise that is
present in your signal. Common-mode
voltage is any voltage present at the
instrumentation amplifier inputs with
respect to the amplifier ground.
91. The big issue with digital conversion:
A continuous value is made discrete
1. In amplitude (Y axis issues)
• Resolution
• Saturation
2. In time (X axis issues)
• Aliasing
• Leakage
• Frequency resolution
Digital Data Acquisition
91
92. Analogue Digital conversion:
quantization:
A continuous value is compared with a series of fixed,
discrete intervals (states)
encoding:
The interval mean value is converted into a digital, usually
binary, chain of elements
Digital Data Acquisition
92
93. Binary representation:
• Data type length = N bit
• Binary encoding = O / 1
Having only two states possible per element allows
for very robust handling and trasmission systems
since the diffence between states can be high and
electronics is simple and cheap.
Digital Data Acquisition
93
94. DIGITAL RESOLUTION
Having N bit data length 2N different states
3 bit 23 =8 different states (1 byte = 8 bit)
8 bit 28 =256 states
10 bit 210 =1024 states
12 bit 212 =4096 states
14 bit 214 =16384 states
16 bit 216 =65536 states
Digital Data Acquisition
94
95. AD converter transfer function is not linear: output = 2N states
input = continuous value
input
output
Digital Data Acquisition
95
96. Resolution = minimum variation of the input quantity
that can be detected by the AD converter.
It is equal to the value of the least significant bit (the
smallest one)
LSB=“least significant bit”
1 LSB = FS / 2N
Digital Data Acquisition
96
97. Resolution depends on both the full scale input of
DAQ converter and bit length of data field
Es: FS=10 V N=3 bit LSB=1.25 V
FS=10 V N=8 bit LSB=39 mV
FS=10 V N=12 bit LSB=2.44mV
n
FSFS
resolution
2
minmax
Digital Data Acquisition
97
101. SAMPLING:
Conversion of a time continuous value into a chain of values
V
(ti , Vi) i=1,...... N
t
t
V
Digital Data Acquisition
101
102. Both V amplitude and it’s time coordinates are discrete
values depending on ADC capabilities and configuration
SAMPLING TIME tC = ti - ti-1
SAMPLING FREQUENCY fC = 1 / tC
t
V
ti-1 ti ti+1
Digital Data Acquisition
102
103. With sampling frequency can be used to
represent a signal without altering it?
t
V
t
V
both OK, but somehow different
Digital Data Acquisition
103
104. If sampling frequency is too low a problem with frequency
representation can occurr: we have “aliasing”
t
V
Sampling signal is no longer recognizable, and its
frequency seems lower than the original one.
Digital Data Acquisition
104
105. The issue of aliasing is related to the ratio between sampling
frequency fS and signal frequency fA
fS < 2 fA “aliasing” occurs
fS > 2 fA
fS = 2 fA
fS < 2 fA
Digital Data Acquisition
105
106. Nyquist-Shannon theorem:
if a continuous signal with a top limited
bandwidth contains only components with
frequency up to fAmax therefore a coherent
representation could be achieved by a
sampling frequency fS > 2 fAmax
Digital Data Acquisition
106
107. f S = 1 / tS
fA = 1 / TA
being fS > 2fA tS < TA / 2
We require at least two samples
for each half period...
Digital Data Acquisition
107
108. Nyquist Example
Aliased Signal
Adequately Sampled
for Frequency Only
(Same # of cycles)
Adequately Sampled
for Frequency and
Shape
100Hz Sine Wave
100Hz Sine Wave
Sampled at 100Hz
Sampled at 200Hz
Sampled at 1kHz100Hz Sine Wave
108
111. Digital-to-Analog Converters (DACs)
• A DAC accepts digital information and transforms it into an analog voltage.
• The digital information is in the form of a binary number (word) with some fixed number
of bits.
• A unipolar DAC converts a digital word into an analog voltage by scaling the analog
output to be zero when all bits are zero and some maximum value when all bits are
one.
• This can be mathematically represented by treating the binary number that the word
represents as a fractional number.
• In this context, the output of the DAC can be defined as a scaling of some reference
voltage:
• The minimum Vout is zero, and the maximum is determined by the size of the binary
word because, with all bits set to one, the decimal equivalent approaches VR as the
number of bits increases.
•
111