ramping up speed - ev3 lessonsev3lessons.com/en/programminglessons/advanced/rampup.pdfwhy ramp up...

Post on 11-Jul-2020

16 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

ADVANCEDEV3PROGRAMMINGLESSON

RampingUpSpeedBySanjayandArvindSeshan

ì Learnwhatrampupmeans

ì Learnhowandwhentouserampup

ì LearnhowtousetheTimerBlock

ì Prerequisites:DataWires,MyBlockswithInputs&Outputs

©2016EV3Lessons.com,Lastedit7/18/2016

LessonObjectives

©2016EV3Lessons.com,Lastedit7/18/2016

WhyRampUp

• Rampingupspeedisveryhelpfulwhenrunningfast-pacedprograms

• Usually,iftherobotstartsupwithhighspeed,thentherewouldbeasmalljoltinthebeginning.Thejoltmaychangethepositionoftherobot.

• Withtherampup,itwouldstartupslowlyandincreasespeedovertime (seevideoontheright)

ì Thetimerblockisusedtocounttime

ì ItisfoundintheYellow(sensortab)intheEV3Software.

ì Multipletimersareavailable(upto8timers)

ì Youcanusetheblocktoresetaspecifictimerbackto0seconds

ì Youcanusetheblocktooutputthetimesincereset…

ì IfyouareanFLLteam,youcanusetimerstotracktimeorfortherampupcodeinthislesson

©2016EV3Lessons.com,Lastedit7/18/2016

NewTool:TimerBlock

Timer#

Elapsedtimeforthattimer

1.Resettimer

2.Inaloop,readthenumberofsecondspassedandmultiplythepowerby20.

3.Stillintheloop,taketheresultofthemultiplicationandconnectittothemoveblock.

4.RepeattheLoopfor5seconds

©2016EV3Lessons.com,Lastedit7/18/2016

RampUpin4EasySteps

©2016EV3Lessons.com,Lastedit7/18/2016

BaseRampUp

CodebyMesaRoblesRobotworks.ModifiedbyDroidsRobotics

©2016EV3Lessons.com,Lastedit7/18/2016

RampUpChallenge

Step1:Canyounowmakearampupprogramthattakes2inputs(totaldurationoframpupandhowmuchyouwantthemotortorampuppersecond)?CreateaMyBlock.

Step2:Rampupyourrobot,thenmoveuntilablackline.

A. Highlightalltheblocks(withoutstopblock)thengotoMyBlockBuilder

B. Add2inputs:oneforhowquicklyyouwanttorampupandoneforandseconds

RefertotheMyBlockswithInputs&OutputslessonifyouneedhelpsettinguptheMyBlock

©2016EV3Lessons.com,Lastedit7/18/2016

MakingtheMyBlock

B

A

©2016EV3Lessons.com,Lastedit7/18/2016

WiretheMyBlock

CodebyMesaRoblesRobotworks.ModifiedbyDroidsRobotics

howquicklyyouwanttorampup

Secondstorampup

Wirethe “Howquicklyyouwanttorampup” input totheMathBlockandtheSecondsinput totheMoveSteeringblock

©2016EV3Lessons.com,Lastedit7/18/2016

ChallengeSolution

CodebyMesaRoblesRobotworks.ModifiedbyDroidsRobotics

1. Whatisrampingup?Ans.Rampingupisstartingslowandgettinggraduallyfaster.

2. Whyshouldyoubother?Ans.Rampingupcanreducesuddenjerkinrobotmovement.

©2016EV3Lessons.com,Lastedit7/18/2016

DiscussionGuide

ì Thinkaboutwhatelseyoumightbeabletouseatimerblockfor.

©2016EV3Lessons.com,Lastedit7/18/2016

NextSteps

ì ThiscodeforthistutorialwascreatedbyMesaRoblesRobotworks (mesarobotworks@gmail.com)

ì SanjayandArvindSeshan addedcontenttocomplementtheoriginallesson(team@droidsrobotics.org)

ì Morelessonsatwww.ev3lessons.com

©2016EV3Lessons.com,Lastedit7/18/2016

Credits

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

top related