Lab 4 Rev. 1 Open Lab Due COB Friday April 6, 2018

Similar documents
Training Schedule. Robotic System Design using Arduino Platform

System Board 6219 MAXREFDES89#: MAX14871 Full-Bridge DC Motor Driver MBED Shield

EE-110 Introduction to Engineering & Laboratory Experience Saeid Rahimi, Ph.D. Labs Introduction to Arduino

EE 110 Introduction to Engineering & Laboratory Experience Saeid Rahimi, Ph.D. Lab 0: Course Introduction

Practical Assignment 1: Arduino interface with Simulink

Figure 1: Motor model

Linear Motion Servo Plants: IP01 or IP02. Linear Experiment #0: Integration with WinCon. IP01 and IP02. Student Handout

EXPERIMENT 9 Problem Solving: First-order Transient Circuits

Part 1: DC Concepts and Measurement

Module: Arduino as Signal Generator

ZX Distance and Gesture Sensor Hookup Guide

EE 210 Lab Exercise #3 Introduction to PSPICE

2.017 DESIGN OF ELECTROMECHANICAL ROBOTIC SYSTEMS Fall 2009 Lab 4: Motor Control. October 5, 2009 Dr. Harrison H. Chin

Introduction to LT Spice IV with Examples

DC Motor and Servo motor Control with ARM and Arduino. Created by:

INA169 Breakout Board Hookup Guide

SIMULATIONS OF LCC RESONANT CIRCUIT POWER ELECTRONICS COLORADO STATE UNIVERSITY. Modified in Spring 2006

Root Locus Design. by Martin Hagan revised by Trevor Eckert 1 OBJECTIVE

EE 210: CIRCUITS AND DEVICES

E x p e r i m e n t 2 S i m u l a t i o n a n d R e a l - t i m e I m p l e m e n t a t i o n o f a S w i t c h - m o d e D C C o n v e r t e r

Name: Resistors and Basic Resistive Circuits. Objective: To gain experience with data acquisition proto-boards physical resistors. Table of Contents:

For this exercise, you will need a partner, an Arduino kit (in the plastic tub), and a laptop with the Arduino programming environment.

Lab 7 Rev. 2 Open Lab Due COB Friday April 27, 2018

AC Overload Tester for Magnet Wire

Experiment Number 2. Revised: Summer 2013 PLECS RC, RL, and RLC Simulations

Chapter 1: DC circuit basics

MAE106 Laboratory Exercises Lab # 1 - Laboratory tools

ECE 2274 Lab 1 (Intro)

MICROCONTROLLERS BASIC INPUTS and OUTPUTS (I/O)

SIMULATIONS WITH THE BUCK-BOOST TOPOLOGY EE562: POWER ELECTRONICS I COLORADO STATE UNIVERSITY. Modified February 2006

Open Loop Frequency Response

EM Arduino 4-20mA Shield Documentation. Version 1.5.0

RC Filters and Basic Timer Functionality

Embedded Control. Week 1 (6/29/11)

Operational Amplifiers 2 Active Filters ReadMeFirst

VCC. Digital 16 Frequency Divider Digital-to-Analog Converter Butterworth Active Filter Sample-and-Hold Amplifier (part 2) Last Update: 03/19/14

Chapter 1: DC circuit basics

Lab 2: Introduction to Real Time Workshop

ESE 350 Microcontroller Laboratory Lab 5: Sensor-Actuator Lab

Laboratory Assignment 1 Sampling Phenomena

ET 304A Laboratory Tutorial-Circuitmaker For Transient and Frequency Analysis

Each individual is to report on the design, simulations, construction, and testing according to the reporting guidelines attached.

EE 461 Experiment #1 Digital Control of DC Servomotor

Basic DC Power Supply

Laboratory experiments and reports

DESCRIPTION DOCUMENT FOR WIFI SINGLE DIMMER ONE AMPERE BOARD HARDWARE REVISION 0.3

Lab 2: Blinkie Lab. Objectives. Materials. Theory

EE-110 Introduction to Engineering & Laboratory Experience Saeid Rahimi, Ph.D. Lab Timer: Blinking LED Lights and Pulse Generator

Lab 3 Rev. 1 Open Lab Due COB Wed. Mar. 28, 2018

MICROCONTROLLERS BASIC INPUTS and OUTPUTS (I/O)

Sweep / Function Generator User Guide

Curve Tracer Laboratory Assistant Using the Analog Discovery Module as A Curve Tracer

Application Note. Communication between arduino and IMU Software capturing the data

Instrumentation and Microcontrollers Using Automatic Code Generation

Electronics Design Laboratory Lecture #10. ECEN 2270 Electronics Design Laboratory

USB-B1 User Manual V1.1

ALX-SSB 5 Band Filter Assembly Manual 19 November 2018

Coding with Arduino to operate the prosthetic arm

// Parts of a Multimeter

HAW-Arduino. Sensors and Arduino F. Schubert HAW - Arduino 1

LAB #10: Analog Interfacing

EE25266 ASIC/FPGA Chip Design. Designing a FIR Filter, FPGA in the Loop, Ethernet

LABORATORY 4. Palomar College ENGR210 Spring 2017 ASSIGNED: 3/21/17

Lab 3: BJT LED Driver

Fig. 1. NI Elvis System

SIMULATION OF A SERIES RESONANT CIRCUIT ECE562: Power Electronics I COLORADO STATE UNIVERSITY. Modified in Fall 2011

Community College of Allegheny County Unit 4 Page #1. Timers and PWM Motor Control

Ocean Controls KT-5221 Modbus IO Module

Lab Week 4. Analog Discovery introduction MATLAB Circuit building and Oscilloscope Measurements Ethics

DESCRIPTION DOCUMENT FOR WIFI / BT HEAVY DUTY RELAY BOARD HARDWARE REVISION 0.1

PART. Maxim Integrated Products 1

Laboratory set-up for Real-Time study of Electric Drives with Integrated Interfaces for Test and Measurement

Experiment 9 : Pulse Width Modulation

Lab 12: Timing sequencer (Version 1.3)

Lab 2.4 Arduinos, Resistors, and Circuits

Experiment Number 2. Revised: Fall 2018 PLECS RC, RL, and RLC Simulations

Brushed DC Motor Microcontroller PWM Speed Control with Optical Encoder and H-Bridge

MAX11300PMB1 Peripheral Module and Munich (USB2PMB1) Adapter Board Quick Start Guide

Experiment Guide: RC/RLC Filters and LabVIEW

introduction to Digital Electronics Install the Arduino IDE on your laptop if you haven t already!

EE 2274 DIODE OR GATE & CLIPPING CIRCUIT

Lab Experiments. Boost converter (Experiment 2) Control circuit (Experiment 1) Power diode. + V g. C Power MOSFET. Load.

Practical 2P12 Semiconductor Devices

Lab #1 Lab Introduction

ArbStudio Training Guide

Figure E2-1 The complete circuit showing the oscilloscope and Bode plotter.

BME/ISE 3511 Laboratory One - Laboratory Equipment for Measurement. Introduction to biomedical electronic laboratory instrumentation and measurements.

1Getting Started SIK BINDER //3

GE 320: Introduction to Control Systems

EE-3010 Lab # 5 Simulation of Operational Amplifier Circuits

EXAMPLE. Use this jack for the red test lead when measuring. current from 0 to 200mA. Figure P-1

Welcome to Arduino Day 2016

Experiment 8 Frequency Response

Iowa State University Electrical and Computer Engineering. E E 452. Electric Machines and Power Electronic Drives

Test Procedure for the NCP1654PFCGEVB Evaluation Board

Exploring DSP Performance

LT Spice Getting Started Very Quickly. First Get the Latest Software!

Electronic Circuits Laboratory EE462G Lab #4. DC Power Supply Circuits Using Diodes

SIMULATION WITH THE BOOST TOPOLOGY ECE562: Power Electronics I COLORADO STATE UNIVERSITY. Modified in Fall 2011

Lab 4: Analysis of the Stereo Amplifier

Transcription:

EE314 Systems Spring Semester 2018 College of Engineering Prof. C.R. Tolle South Dakota School of Mines & Technology Lab 4 Rev. 1 Open Lab Due COB Friday April 6, 2018 In this lab we will setup Matlab s Simulink to work with an Arduino Mega 2560. System Setup: We will also program, compile, and deploy a piece of embedded test code on to our Arduino Mega 2560. Some general background information pertaining to the lab is given in the table below: 1 Matlab 2017b was used in the production of this lab handout. 2 When appropriate, utilize Matlab s publishing features to produce your lab report as much as is reasonable. 3 Useful Matlab commands or Simulink blocks: Simulink, constant block, gain block, Arduino PWM block, Arduino Analog in Block, Scope Block, Transfer Function Block, PWM Generator (DC-DC) Block, Matlab and Simulink Arduino Support Packages. First obtain an Arduino Mega 2560. They are available from a number of sources on the internet. One such vendor is Sparkfun, a link to an Arduino Mega 2560 at their site is given below: Hyper-link to Sparkfun s Arduino Mega 2560 Simulink supports other Arduino boards as well however for this class it is suggested that you use the Mega 2560 since it has more memory and resources then most other Arduino boards. The student should be made aware that using high level programing tools like Simulink allows for quicker development times at a cost of more inefficient code bases. These inefficiencies include both larger code bases, use of additional chip resources, and added code complexity to many applications that directly effect their speed of operation. However for the right applications, the simplicity of implementation provided by such tools far outweigh any code inefficiencies. Once you have obtained your Arduino you need to install Matlab s Arduino and Simulink s Arduino support packages. This is described in the next several pages of this lab. First we need to add a few packages to Matlab and Simulink. We can do this by selecting Add-Ons Get Add-Ons function within Matlab s tool bar: 1

Next search for arduino add-ons: Select the Matlab Support Packages for Arduino Hardware (double click on this package): Follow the instructions to install the package Not all of the screens are included below but the install proceeds mostly as follows: 2

3

As a side note, there are a lot of other Adruino Based Matlab support tools available: 4

Next select the Simulink Support Packages for Arduino Hardware (double click on this package): Follow the instructions to install the package Not all of the screens are included below but the install proceeds mostly as follows: 5

As with the Matlab tools, there are a lot of other Adruino Based Simulink support tools available: Now that the Matlab and Simulink tools are installed we are ready to create a new Simulink project. Start up Simulink via the command line or Matlab toolbar. Navigate to the Simulink Support Package for Arduino 6

Hardware on the New Tab and select External Mode: This will create a new untitled.slx file that is setup to execute on your Arduino Mega. Save the file as ee314 lab4: Review the documentation provided on the new Simulink model page. Note that the Simulation Mode is set to External in this new file. External implies that portions of the Simulink model will be executed on the Arduino hardware and portions will be executed on your computer system, i.e. inputing data and changing set points as well as displaying scope data is accomplished on the main computer system while other portions of the code are executed on the embedded processor. In this lab, we will be using this simple basic starting model to test our hardware setup and functionality for programming our Arduino via Simulink. We will also explore a few important measurement and data acquisition concepts while we have the chance. Let s familiarize you with what pre-made driver blocks exist for your Arduino. To see these, open the Simulink Library Browser and navigate to 7

the Simulink Support Package for Arduino Hardware. First look at the Common library block set: Lab Procedure The functional blocks shown here provide the basic hardware support models for your embedded system. In this lab we will only focus on the A to D (analog in) and PWM (poor man s analog out when used with a low pass filter) blocks provided in our newly created Simulink model. We need to make a few useful changes to the model created for us, they are listed below: 1 Update the Dimmer Block sample time 2 Update the Analog In s sample time (if you get a communication error then slow this down to 0.001, you might also need to up the com port baud rate within windows device manager and within Simulink model parameters to 115200 from default 9600.) 3 Add some scaling blocks to our sub system block so that the dimmer value is scaled from 0-100% and that 8

the Analog reads in volts 4 Reconfigure the scope s output display 5 Change the project title to EE314 Lab4 Now before we discuss the hardware implementation side of this demo, let first create a expectation for our demo. Our in our model demo, we will be exploring both the poor-man s D/A via a low pass filter and a PWM. In this case we will use a single pole R-C lowpass filter with a break frequency of 1 rad s. Create a Simulink model for this 9

device. The ideal poor-man s D/A model is shown below: Evaluation & Report What we want to do is compare this idealized model with some real hardware. Below are some questions to consider and fully discuss within your lab report: 1 Run the idealized PWM-lowpass filter model, does it work as expected? 2 What might be the limitations of this type of D/A? 3 What kind of Loads could it service? 4 What are the limits of the PWM unit? 5 What happens if we over drive the power requirements from the PWM? Short out our current limiting 3KΩ resistor, what happens? 6 What are the effects of using an oscilloscope to look at our signals for this system? 1x probe (add a 1MΩ resistor in parallel with the capacitor)? 10x probe(add a 10M Ω resistor in parallel with the capacitor)? 7 What have you learned within this hardware lab? 8 What issues or problems did you encounter completing the lab? In order to explore these ideas, we need to add some hardware to our Arduino board. Using a simple bread board, jumper wires, diode, capacitor, and resistors implement the following circuit using the Arduino s PWM pin 13, Analog pin A0, and Ground pins: 3KΩ 10MΩ + PWM13.1µF A D A 0 GND Test circuit that simulates the use of a 10x oscilloscope probe on our A/D input: 3KΩ 10MΩ + PWM13.1µF A D A 0 10MΩ GND 10

Test circuit with no current limiting resistor for our PWM output driving our diode: 10MΩ + PWM13.1µF A D A 0 GND Please complete your formal lab report by due date provided at the top of this lab assignment. 11