Micro-Controller Based Function Generator and PC Oscilloscope
Micro-Controller Based Function Generator and PC Oscilloscope
Mentored by :
Dr. Dheeraj Joshi
ABSTRACT
Function generators and Oscilloscopes are indispensable part of Electrical Engineering and are
used in almost all the labs be it Instrumentation, LIC or Control. However, the frustrating part
about the oscilloscope and function generators are they are bulky and way too expensive. It is
almost impossible for a hobby electronists to own a one. In this project we propose a function
generator and a PC Oscilloscope with MATLAB deploying the internal ADC of ATmega328P
micro-controller and external R-2R DAC. For the Oscilloscope part of the project, we use a
Arduino Development Board to capture the signal values on one of the analog channels and pass
them to MATLAB running a script via USB. The MATLAB script plots the data for a desired
number of samples. The Oscilloscope thus proposed is capable of measuring signals up to 5kHz
and 5 volts on a single channel. The Arduino Development Board uses a R-2R DAC to produce
various functions like sine, square, triangle and saw-tooth. Frequencies up to 7kHz and peak-topeak amplitude of 5 volts can be produced which are more than sufficient for tinkering with
electronic circuits. The Oscilloscope and function generator proposed are efficient, compact and
inexpensive for their use in electronic circuits. The use of a Micro-controller allows the user to
make any number of changes with code to get the desired result. MATLAB being a complete
mathematical package allows many further possibilities such as Fast-Fourier Transform, 3D Plot
, Signal Processing and thresh-hold marking.
CERTIFICATE
This is to certify that the report entitled, Steper Motors, Drivers And Their Application In
3D Printer submitted by Jatin Batra (2k12/EE/064) in partial fulfillment of the
requirements for the award of the Bachelor of Technology in Electrical Engineering and
submitted to the department of Electrical Engineering of Delhi Technological University,
Delhi is authentic record of my own work carried out under my supervision and guidance.
To the best of my knowledge, the matter embodied in the report has not been submitted to
any other University/institute for the award of any degree or diploma.
EE Department
DTU,
Signature
Delhi
ACKNOWLEDGEMENT
I take this opportunity to express my profound gratitude and deep regards
to my guide Dr. Dheeraj Joshi, for his exemplary guidance, monitoring and
constant encouragement throughout the course of this report. The blessing,
help and guidance given by him time to time shall carry me a long way in
the journey of life on which I am about to embark. Last but not the least I
would like to thank my parents and the broad reprap open source
community to bear me.
Jatin Batra
2K12/EE/064
Dept. Of Electrical Engineering
DTU, Delhi
LIST OF FIGURES
1. Fig1: Insights of a Stepper Motor
2. Fig2: Permanent Magnet Stepper Motor
3. Fig3: Working of a permanent magnet stepper motor
4. Fig4:Methods to increase the resolution of a permanent magnet stepper
5. Fig5: Variable reluctance stepper
6. Fig6: Working of a variable reluctance stepper
7. Fig7:Methods to increase the resolution of a variable reluctance stepper
8. Fig8:Hybrid Stepper
9. Fig9:Hybrid Rotor
10. Fig10:Working of a hybrid stepper
11. Fig11:Unipolar stepper
12. Fig12:Bipolar Stepper
13. Fig13:Wave Drive
14. Fig14:Full Drive
15. Fig15:Microstepping
16. Fig16: RAMPS
17. Fig17: Sanguinololu Board
18. Fig18: Bipolar Stepper
19. Fig19: End Stops
CONTENTS
CERTIFICATE...............................................................................
........................................i
ACKNOWLEDGEMENT
...ii
LIST OF FIGURES..iii
CHAPTERS
1. INTRODUCTION..
2. Stepper Motors
2.1Working Principle
2.2Types OF stepper motor
2.3Two-phase stepper motors
2.4Modes Of Stepping
3. 3D Printing.
3.1What is 3D Printing?
3.2Electronics in 3D Printing
3.3Stepper-Motors
3.4End-Stops
4. SIMULATION
4.1Proteus ISIS
4.2Code
Introduction
3D printers especially Home-built 3D Printers are booming. In 2006 there were no
such printers and 8 years later there are tens of thousands. There are currently
hundreds of thousands of people wanting to start their own build waiting for the
right moment to get started. The project that single-handily propelled home-built
3D printers out of nowhere is RepRap. Its an open-source project meaning that all
the information and design plans youll need are available free for all. Building a
3D printer on your own is a huge undertaking.
And one of the toughest part of 3D Printing is electronics in the 3D printing .The
motivation of
involved in electronics of 3D Printers mainly the stepper motor drivers which can
be as expensive as $200. This calls the need for creating a inexpensive DIY stepper
driver-easy to debug and compatible with almost every open-source firm-wares to
be used in 3D Printing.
Stepper Motors
A stepper motor (or step motor) is a brushless DC electric motor that divides a
full rotation into a number of equal steps. The motor's position can then be
commanded to move and hold at one of these steps without any feedback sensor
(an open-loop controller), as long as the motor is carefully sized to the application.
Working Principle
DC brush motors rotate continuously when voltage is applied to their terminals.
Stepper motors, on the other hand, effectively have multiple "toothed"
electromagnets arranged around a central gear-shaped piece of iron. The
electromagnets are energized by an external control circuit, such as a
microcontroller. To make the motor shaft turn, first, one electromagnet is given
power, which magnetically attracts the gear's teeth. When the gear's teeth are
aligned to the first electromagnet, they are slightly offset from the next
electromagnet. So when the next electromagnet is turned on and the first is turned
off, the gear rotates slightly to align with the next one, and from there the process
is repeated. Each of those rotations is called a "step", with an integer number of
steps making a full rotation. In that way, the motor can be turned by a precise
angle.
.
Fig5: Variable Reluctance stepper Motor
The teeth of the rotor are designed so that when they are aligned with one stator
they get misaligned with the next stator. Now when the next stator is energized, the
rotor moves to align its teeth with the next stator. This way energizing stators in a
fixed sequence completes the rotation of the step motor.
Hybrid Stepper
A hybrid stepper is a combination of both permanent magnet and the variable
reluctance. It has a magnetic teethed rotor which better guides magnetic flux to
preferred location in the air gap.
Modes Of Stepping
A stepper motor is a polyphase AC synchronous motor and it is ideally driven by
sinusoidal current. Various drive techniques have been developed to better
approximate a sinusoidal drive waveform: these are half stepping and
microstepping.
Different drive modes showing coil current on a 4-phase unipolar stepper motor
Wave drive or Full step drive (one phase on)
In this drive method only a single phase is activated at a time. It has the same
number of steps as the full step drive, but the motor will have significantly less
than rated torque. It is rarely used. The animated figure shown above is a wave
drive motor. In the animation, rotor has 25 teeth and it takes 4 steps to rotate by
one teeth position. So there will be 25*4 = 100 steps per full rotation and each step
will be 360/100 = 3.6 degrees.
take 8 steps to rotate by 1 teeth position. So there will be 25*8 = 200 steps per full
rotation and each step will be 360/200 = 1.8 degrees. Its angle per step is half of
the full step.
Microstepping
What is commonly referred to as microstepping is often "sine cosine
microstepping" in which the winding current approximates a sinusoidal AC
waveform. Sine cosine microstepping is the most common form, but other
waveforms can be used.Regardless of the waveform used, as the microsteps
become smaller, motor operation becomes smoother, thereby greatly reducing
resonance in any parts the motor may be connected to, as well as the motor itself.
Resolution will be limited by the mechanical striation backlash, and other sources
of error between the motor and the end device. Gear reducers may be used to
increase resolution of positioning. Step size repeatability is an important step
motor feature and a fundamental reason for their use in positioning.
Fig15: Micro-stepping
3D Printing
What Is 3D Printing?
Additive manufacturing or 3D printing is a process of making three dimensional
solid objects from a digital model. 3D printing is achieved using additive
processes, where an object is created by laying down successive layers of material.
3D printing is considered distinct from traditional machining techniques
(subtractive processes) which mostly rely on the removal of material by drilling,
cutting etc.
Electronics In 3D Printer
The electronics board controls the printing process. Several electronics options
exist for RepRap printers (they are all open-source.) Currently the most popular
are:
RAMPS, a DIY shield board for Arduino MEGA
Sanguinololu,
an
all-in-one
DIY
board
with
microprocessor on board
The RepRap electronics board has several functions:
Process G-code instructions.
Control the four stepper motor controllers (there are five
stepper motors on a RepRap Prusa Mendel but both Z-axis
motors are connected to the same stepper motor
controller.)
Control the temperature of the hot-end and monitor the
hot-end thermistor.
Monitor the end-stops (end-stops are used for homing the
three axes, see later section.)
Control the temperature of the heated bed and monitor the
heated bed thermistor (the heated bed is optional.)
Fig 16 : RAMPS
The Sanguinololu board is a more recent addition. It doesnt
offer the
extra
To achieve this three end stops need to be installed, one for each
axis. A end stop needs to be installed at the position where the
axis shouldnt move beyond:
For the X-axis this should be the position where the nozzle
reaches the left-hand side of the print plate.
For the Y-axis this should be on the back-side of the axis
so that the print plate is moved to the back far enough that
the nozzle ends up on the forward of the print plate.
For the Z-axis this should be the position where the nozzle
barely touches the print plate. When printing the software
will make sure the Z-axis is lifted a little before printing
the first layer.
There are two kinds of end stops: optical or mechanical
switch. The mechanical switches are preferred since they
are much cheaper, easier to install and work just as well as
optical end stops.
SIMULATION
Proteus ISIS
Code
/*
Stepper Motor Control - one revolution
by Jatin Batra
*/
#include <Stepper.h>
const int stepsPerRevolution = 200; // change this to fit the number of steps
per revolution
// for your motor
void setup() {
// set the speed at 60 rpm:
myStepper1.setSpeed(60);
myStepper2.setSpeed(60);
void loop() {
// step one revolution in one direction:
Serial.println("clockwise");
myStepper1.step(stepsPerRevolution);
myStepper2.step(stepsPerRevolution);
delay(500);
myStepper1.step(-stepsPerRevolution);
myStepper2.step(-stepsPerRevolution);
delay(500);
}
CONCLUSION
THE BASIC CONCLUSON IS THAT THE 3D PRINTERS WILL CHANGE THE
WORLD. THE MOST IMPORTANT PART OF THE 3D PRINTERS AR
ELECTRONICS , THE MOTORS AND THEIR DRIVERS.A CUMBERSOME
UNDERSTANDABLE
BY
PROCESSOR/MICRO-
REFERENCES
1.
2.
3.
4.
5.
http://www.engineersgarage.com/articles/stepper-motors?page=1
http://en.wikipedia.org/wiki/Stepper_motor
http://reprapbook.appspot.com/#d0e530
http://reprapbook.appspot.com/#d0e436
http://arduino.cc/en/Tutorial/StepperBipolar