Data Logging (Part 2) - EV3Lessons

Transcription

ADVANCED EV3PROGRAMMING LESSONData Logging (Part 2)By Sanjay and Arvind Seshan

Lesson Objectivesì Learn what data logging isì Learn the different ways of doing data logging on the EV3ì Learn how to use the Data Logging Blockì Prerequisites: Must own Edu version of EV3 Software 2016 EV3Lessons.com, Last edit 7/19/20162

What is Data Logging?ì The EV3 software provides a simple way to continuously recordsensor readings to a file and to plot the values later. This iscalled Data Logging.ì Why use Data Logging:ì Great for science experiments. In Part 1, we will show how youcan record values like temperature for a science project.ì Great for understanding robot programming blocks. In Part 2, wewill show how to use data logging to measure the differencebetween turns.ì Great for understanding sensor behavior. In Part 3, we will showhow to use data logging to understand the details of sensors suchas the gyro sensor. 2016 EV3Lessons.com, Last edit 7/19/20163

How do you Data Log on an EV3?There are 4 ways to data log using the EV3 MINDSTORMS:Live Data Logging: Real time data collected directlyin the EV3 software2. Remote Data Logging: Use the the brick to collectdata, and transfer the data to the computer foranalysis3. Brick Data Logging: Run the experiment directlyfrom the brick1.Lesson 1:TemperatureSensorExperimentLesson 2:DifferencesBetween Turns4.Autonomous. Collect data with the Data Loggingblock. The data is stored on the brick. 2016 EV3Lessons.com, Last edit 7/19/20164

Autonomous Data LoggingFile nameAutonomous DataLogging requires theData Logging BlockPortAdd more sensorsPick the sensor andwhat you want tomeasureData Logging block isin the blue tab 2016 EV3Lessons.com, Last edit 7/19/20165

How do you use the Data Logging Block?ì To use this block, simply drag a Data Logging Block in front of the codeyou want to log and turn it “on”. To stop logging, add another DataLogging Block set to “off”.ì Pick all the other parameters – the ports, the sensors you want to log,what you want to record (rotations/degrees, etc.)ì Download and run programOn 2016 EV3Lessons.com, Last edit 7/19/2016Off6

How to View your DataIf you want to get the file 1from your brick to thecomputer:1) Click on the BrickInformation Icon2) Press the Open BrowserMemory Icon.3) Find the correct .rdffile.32If you want to view thedata file from either thebrick or the computer:Tools à Datalog FileManager à Select BRICKor COMPUTER and pickthe correct file 2016 EV3Lessons.com, Last edit 7/19/20167

Challenge 1: Comparing Turnsì Make four different programs that do a pivot turn and comparethe data from the rotation sensor 2016 EV3Lessons.com, Last edit 7/19/20168

Steps to RememberSTEP 1: In the Data Logging My Block,select the sensor you are reading, theports they are in.STEP 2: Select the duration and rateSTEP 3: Remember to stop data loggingat the end of your codeSTEP 4: Remember to change the nameof the file each time otherwise they willall be called MyData.STEP 5: Import your data file andcompare the graphs. Which type ofpivot turn is the most reliable? 2016 EV3Lessons.com, Last edit 7/19/20169

Challenge 1 SolutionBelow, we ran all 4 together, but you will find it easier to run each method separately(because you can avoid adding motor resets)In Method 4, MotorC is dragged along.Motor B lineMethod 4Method 3Motor C line 2016 EV3Lessons.com, Last edit 7/19/2016Method 1Method 2Methods 1 and 2 arevery similar.Method 3 appears tobe the most reliable.You may not noticemuch difference inreal life, but the datalog shows us thetrue reading.10

Creditsì This tutorial was written by Sanjay Seshan and Arvind Seshanì More lessons at www.ev3lessons.comThis work is licensed under a Creative Commons AttributionNonCommercial-ShareAlike 4.0 International License. 2016 EV3Lessons.com, Last edit 7/19/201611

Live Data Logging: Real time data collected directly in the EV3 software 2. Remote Data Logging: Use the the brick to collect data, and transfer the data to the computer for analysis 3. Brick Data Logging: Run the experiment directly from the brick 4. Autonomous. Collect data with the Data Logging block. The data is stored on the brick.