Studuino Block Programming Environment Guide

Similar documents
Studuino Programming Environment Manual

Studuino Programming Environment Manual

Line Tracer. Assembly Instructions

ArtecRobo Bluetooth Controller User Guide. Published 2015/04/01 Revised 2017/01/16

Sensor Melody Light Robot

Experimental Procedure

LEGO BB-8 Release: LEGO BB-8. Learn how to automate a LEGO BB-8for motion, light, and sound using Crazy Circuits. Written By: Joshua

Part A: Monitoring the Rotational Sensors of the Motor

How-To #3: Make and Use a Motor Controller Shield

TG VR Gimbal User Manual V Accsoon. All Rights Reserved.

Getting Started Guide

HP Photosmart c3180 Main Circuit Board Replacement

How do you roll? Fig. 1 - Capstone screen showing graph areas and menus

Experiment 4.A. Speed and Position Control. ECEN 2270 Electronics Design Laboratory 1

SCRATCH BUILDER R Q R O B O T C O D I N G G U I D E

Installing the Focus Motor

EV3 Programming Workshop for FLL Coaches

OPERATING INSTRUCTIONS:

Personalize your pen with a color ring

Modern Robotics Inc. Sensor Documentation

Upgrade Instructions Printer Terminal Holder

Electronics Workshop. Jessie Liu

Sense Autonomous 2_11. All rights reserved.

EE 210 Lab Assignment #2: Intro to PSPICE

TA0139 USER MANUAL ARDUINO 2 WHEEL DRIVE WIRELESS BLUETOOTH ROBOT KIT

REMOVE COVERS. 1. Remove three screws from the Side Panel (L). 2. Slide the Side Panel (L) backward, and raise it to remove from the printer.

Don t Steal My BBC micro:bit Alarm!

Robot Navigation Worksheet 1: Obstacle Navigation

micro:bit Lesson 1. Using the Built-in Sensors

SP-7 AHRS. Firmware upgrade instructions. Installation and calibration

X-CAM A10-3H 3 Axis Gimbal for GOPRO. User Manual ( V2.00 )

University of Jordan Faculty of Engineering and Technology Mechatronics Engineering Department

Nov. 07, 2013 p. 5 - changed the B axis unit value to from Changed by Randy per Frank s request.

Instruction Manual. Model RBA18

Contents. - i - Ver.:2

TABLE OF CONTENTS. Page 2 35

Mini Racer Competition.

mspder User Guide Contents Equipment necessary before...i 1. mdrawbot Description of mdraw functions Software installation,...

ZYX User Manual V Revision

Sphero Lightning Lab Cheat Sheet

G-30 Gimbal. User Manual

LME Software Block Quick Reference 1. Common Palette

Stress Analysis of Cross Groove Type Constant Velocity Joint

SPIRIT. Phase 5 Analog Board Computer and Electronics Engineering

EQ-ROBO Programming : Ladybird Robot

Click Install View Touch. Installation starts. Click Next. Click Finish.

Robot Design Workshop: VEX Hardware & Robot Building Basics

Position and Displacement Analysis

This page outlines some of the alternate pieces that can be used for building.

BEST Control System. Dave Wilkerson. September 12, 2015

3-Axis Stabilized Handheld Gimbal for Smartphone. Instructions. Guilin Feiyu Technology Incorporated Company. User Manual EN V1.0

IRF90 - Rotating Focuser

Contents Contents. Chapter 1. Program Installation. Chapter 2. For the start of CMS. Chapter 3. Monitoring. Chapter 4. E-Map Mode

VEX ARM Cortex -based Microcontroller and VEXnet Joystick User Guide

AX1500. Dual Channel Digital Motor Controller. Quick Start Manual. v1.9b, June 1, 2007

RobovieMaker2 User Guide

Rotary Motion Servo Plant: SRV02. Rotary Experiment #00: QuaRC Integration. Using SRV02 with QuaRC. Student Manual

Controller Pro Instruction Manual

Replacing the SATA PCI Controller Card

Discover Robotics & Programming CURRICULUM SAMPLE

The original image. Let s get started! The final result.

ICS 61 Game Systems and Design Introduction to Scratch

Introduction to Motion

SCRATCH MODULE 3: NUMBER CONVERSIONS

INSPIRE 1 Quick Start Guide V1.0

Removal and Installation 8

Setup Instructions DOF Reality M2

Thank you for choosing the Kogan Dual Camera Car DVR with GPS!

Register your product and get support at CEM2000. Quick Start Guide

Copyright White Box Robotics Inc. and Frontline Robotics Inc

Step 1: Open the CAD model

Tizen 2.3 TBT User Guide

SPID Elektronik. Driver MD-02 MD-02

INTRODUCTION CT87E FEATURES AND CONTROLS

Installation and Operation Manual

Instruction Manual for Teaching Device

What Is a Program? Pre-Quiz

Panasonic. DVD/DVC Camera Seminar VDR-D100/200/300 and PV-GS29/39

MMA845xQ Sensor Toolbox User s Guide

Slope Stability Problem Session

Importing the Vernier Sensor Block into LEGO MINDSTORMS 2

Software Manual. Revision 1.3

Flex Series User Guide

mcar User Guide Contents Equipment necessary before...i 1. mdrawbot Description of mdraw functions Software installation...

DS-3000 Series Data Station Operation manual for Vibration Analysis

Replacement Instructions

Software User s Manual

SOLIDWORKS: Lesson 1 - Basics and Modeling. Introduction to Robotics

Boxer HD-2X Motorized Pan Tilt Head (P-BXR-HD-2X)

iphone 1st Generation Front Bezel Replacement

Quantifying Motion in Three Dimensions with ProAnalyst

Schwintek Bed Tilt OEM INSTALLATION MANUAL

Instruction Manuall. Flowcam Series. Professional dual-arm Camera Stabilizer System 5-15 lbs

Z-Truck (Vertical Moving) Z-truck Flag. Y-Truck (Horizontal Moving) FIGURE 1: VIEW OF THE Z-TRUCK. Flexshaft Assembly

ROBOT LINE TRACKING MOUSE KIT C-9801

SATCOM-On-The-Move User Manual

HOUR 12. Adding a Chart

KNOW THE OPTIONS for your next hunt!

Using ADAMS/Insight with ADAMS/Car

RF HAMDESIGN. Driver MD-01 MD-01

Transcription:

Studuino Block Programming Environment Guide [DC Motors and Servomotors] This is a tutorial for the Studuino Block programming environment. As the Studuino programming environment develops, these instructions may be edited or revised.

Index 5. DC Motors... 1 5.1. Controlling a DC Motor... 1 5.1.1. Connecting a DC Motor to the Studuino Board... 1 5.1.2. Port Settings... 2 5.1.3. Programming... 3 5.2. Controlling a Car... 6 5.2.1. Programming... 6 5.3. Controlling a Car Using an Accelerometer... 13 5.3.1. Connecting an Accelerometer to the Studuino Board... 14 5.3.2. Port Settings... 14 5.3.3. Checking the Accelerometer... 15 5.3.4. Programming... 16 6. Making the Servomotor Move... 25 6.1. Calibrating Servomotor Angles... 25 6.1.1. Adjusting the Servomotor Driveshaft Angle... 25 6.1.2. Connecting a Servomotor to the Studuino Board... 26 6.1.3. Port Settings... 26 6.1.4. Programming... 28 6.2. Making a Robotic Arm that Uses Three Servomotors... 30 6.2.1. Building the Robot... 30 6.2.2. Port Settings... 32 6.2.3. Programming... 32

5. DC Motors 5.1. Controlling a DC Motor In this section, you ll learn how to configure and control a DC Motor by making a basic program. 5.1.1. Connecting a DC Motor to the Studuino Board Assemble the car as shown below. (1)Attach the wheels to the DC Motor as shown below. Make symmetrical left and right wheels. (2)Attach the DC Motors to the bottom of the circuit board (3) Make the back wheels with Artec Blocks. (4) Connect the motor and the battery box to the Studuino board. M1: Right DC Motor M2: Left DC Motor POWER: Battery box 1

(5) Place the battery box onto the circuit board mount. 5.1.2. Port Settings Before programming, you ll need to set the ports in the Block Programming Environment to match the parts connected to your Studuino. Select Edit from the menu and choose Port Settings to open the Port Settings dialog box. Make sure the M1 and M2 boxes in the DC Motor area are checked. Make sure these boxes are checked 2

5.1.3. Programming Now we're going to create a program that controls the DC Motor connected to M1, changing the settings in Test mode to see how the motor responds. 1 From the Motion palette, choose, and then connect them together. 2 Drag from the Control palette and fit it between and. 3 Attach the blocks to. 3

Now the program is finished. It will rotate the DC Motor connected to M1. Set the rotation speed of the DC Motor to 100 Start DC Motor rotation Wait 1 second Stop DC Motor rotation 4 Check how the DC Motor rotates. Connect your Studuino board to the PC via USB. Choose Test ON from the Run menu. 5 Click after entering Test mode. Click Program will run in Test mode The DC Motor connected to M1 will rotate for one second and then stop. 6 Set the value in the block to 50, then click. The DC Motor will rotate more slowly. 4

7 Change the value of back to 100 and set to counterclockwise. Click. The DC Motor will rotate backwards. 8 Change to coast, then click. back to clockwise. Set The DC Motor will rotate backwards and coast to a stop. 100 is the maximum rotation speed for a DC Motor. Inputting a value greater than 100 will not make the motor rotate at a higher speed. The DC Motor will not run if the speed is set below a certain threshold. The speed setting represents the amount of electrical current sent to the DC Motor. Getting your DC Motor to run requires a minimal amount of electrical current. 5

5.2. Controlling a Car Now we're going to create a program that uses two DC Motors to make a car go forward, backward, and spin. 5.2.1. Programming First, we'll create a program that makes the car go forward. 1 From the Control palette, choose the function "forward" and click OK.. Select "new..." by clicking. Name 2 Type a name 1 Click then select new Function name dialog box will appear 3 Click 2 From the Motion palette, choose the,, and blocks, then attach each to the block in the Script field. 6

3 From Control palette, drag and fit it between and. 4 Change M1 to M2 in the,, and blocks. 5 Attach to. 7

Now the program is finished. Set the speed of DC Motors M1 and M2 DC Motors M1 and M2 will start rotating Wait 1 second DC Motors M1 and M2 will stop 6 Now check how the car moves. Connect the Studuino board to the PC via USB. Choose Test ON from the Run menu. 7 After entering Test, click. Click The program will run in Test mode The car will go forward for one second then pause. 8 Click to stop Test mode. Click Next, we'll create a program that makes the car go backward. 8

9 Right click and select duplicate. 1 Right click 2 Select Duplicate The blocks will be duplicated 10 10 Click on the duplicated and click OK. and select new... Name the function backward 1 Click then select new The Function Name box for the duplicated group will appear 2 Enter a name 3 Click 9

11 In the group named backward, set the rotation to counterclockwise in and. 12 Click in and select backward. Now the program is finished. When the program executes steps 6 and 7, the car goes backward for one second and then stops. Next we'll create a program that makes the car spin clockwise. 10

13 Create a new function called rotationright by following steps 8 and 9. Duplicate the forward function and name the new function rotationright 14 Set clicking on in the in the first row to counterclockwise. Select rotationright by block. Now the program is finished. Follow steps 6 and 7. Your car will spin clockwise for one second and then stop. 11

Next, we ll create a program that makes the car spin counterclockwise. 15 Create a rotationleft function by following steps 8 and 9. Duplicate the forward function and name the new function rotationleft 16 Set by clicking on in the in the second row to counterclockwise. Select rotationleft block. Now the program is finished. Follow steps 6 and 7. See if the car spins counterclockwise for one second and then stops. 12

5.3. Controlling a Car Using an Accelerometer Now we're going to create a program that uses an accelerometer to control the car. Base your program on the one in the previous section. An accelerometer works by detecting acceleration in the X, Y and Z axes. It calculates how speed varies over fixed periods of time. Z X Y As the accelerometer is moved in different angles, each value changes as shown below. A fixed accelerometer has a direction in which the accelerometer shows other than zero because it detects *gravitational acceleration. Objects are pulled toward the ground by Earth's gravity. This force can be used to measure angles (tilts) relative to the ground. Gravitational acceleration is the force exerted on an object by gravity. 13

5.3.1. Connecting an Accelerometer to the Studuino Board Connect the accelerometer to sensor/led/buzzer connectors A4 and A5 on the Studuino board. A4-A5 The four wires of the Accelerometer connect to both A4 and A5. Accelerometer 5.3.2. Port Settings Before beginning to program, set the port information in the Block programming environment so it matches the board. Select Edit from the menu, then select Port Settings from the pull down menu to open the setting dialog box. In the Port Settings dialog box, check A4 and A5 and choose Accelerometer. Check the A4 and A5 boxes and select Accelerometer 14

5.3.3. Checking the Accelerometer Find the Accelerometer value. Connect your Studuino board to PC via USB cable. Choose Test ON from the Run menu. In Test mode, the Sensor Board appears and shows [A4/A5] Accelerometer. The values of the Accelerometer measure slope on a range of 0-100, with 50 being perfectly level to the ground. As the slope becomes positive the value moves towards 100, and as it becomes more negative it moves towards 0. Tilt the Accelerometer and notice how the values change. The values change according to the tilt Exit Test mode by selecting Test OFF from the Run menu. 15

5.3.4. Programming For this chapter, we'll use the program from 5.2.1. that makes the car go forward, backward, and spin. 1 Set the value in to 0.1. 16

2 Set and to Coast. 3 In the forward function group, disconnect and, then drag back to the Block palette. 1 Disconnect 2 Drag back to Block palette 17

4 Attach to. 5 Follow steps 3 and 4 to delete from the other function groups. 18

6 From the Motion palette, drag two and attach them to. Set the second to M2, as shown. 7 From the Control palette, drag and attach as shown. 8 From the Operators palette, drag and attach as shown. 19

9 From the Sensing palette, drag and attach to the left side of. Set the right side to 40. 10 From the Control palette, drag and fit into the opening of, then select the forward function. 11 Right-click and select duplicate. Right click and select Duplicate Blocks will be duplicated 20

12 Attach the duplicated blocks to the originals. 13 Right click and choose <. 1 Right click 2 Select> 14 Set the right side of to 60 and set to the backward function. 21

15 Right click and select duplicate. Right click and select Duplicate The blocks will be duplicated 16 Connect the duplicated Blocks to the originals. 17 Set duplicated blocks to Y. Set one block to rotationleft and the other to rotationright, as shown. 22

18 Drag and enclose the group of blocks below. Now the program is finished. It will use the accelerometer to control the car. 23

Set the speed of DC Motors M1 and M2 to 100 When the accelerometer is tilted forward, execute the forward function When the accelerometer is tilted backward, execute the backward function When the accelerometer is tilted to the left, execute the rotationleft function When the accelerometer is tilted to the right, execute the rotationright function 17 See how the car moves when the accelerometer is tilted. Connect the Studuino board to the PC via USB. Turn on the battery box switch, then choose Test ON from the Run menu. 18 After entering Test mode, click. As the tilt of the accelerometer changes, the executed function changes accordingly The car moves according to the tilt of the accelerometer. 19 After checking the car in Test mode, choose Transfer from the Run menu. 24

6. Making the Servomotor Move This section explains how to create a basic Servomotor program, how Servomotors work, and how to use the List and Operator blocks. 6.1. Calibrating Servomotor Angles Every Servomotor is different. Even if you set every angle to be the same, there still may be slight differences (called slippage) in the angles of your motor. This gap can be corrected by calibrating your Servomotor. 6.1.1. Adjusting the Servomotor Driveshaft Angle Check that the Servomotor driveshaft is attached correctly using the methods shown below before attaching the Servomotor. Moving the driveshaft too far left or right from its default position in relation to the body may cause the Block portion of the of the driveshaft to slip out of place. Cables Drive Normal Body Default Abnormal In order to not damage the gears inside, use a reasonable amount of strength when turning the driveshaft. To prevent damage to the gears, only the Block moves when turned. If you turn the driveshaft when it is in an abnormal position, you will hear a click as it returns to the default position. Avoid applying too much pressure when turning. This causes deterioration and severe damage to the Servomotor. Minor angle degree adjustments can be made later with the software. 25

6.1.2. Connecting a Servomotor to the Studuino Board Connect the Servomotor to D9 on the Studuino unit. DC Motor D9 Make sure the sensor connecting cables are inserted correctly. The gray cable should be at the top. 6.1.3. Port Settings Before beginning to program, set the port information in the Block programming environment so it matches the board. Select Edit from the menu, then select Port Settings from the pull down menu to open the setting dialog box. Make sure only D9 is checked in the Servomotor area, as shown below. Only check D9 1 Choose Edit in the Menu bar, then select Motor Calibration... Be sure to check that the USB cable is connected to the board. Click Click When Motor Calibration is selected, a window will open, all connected Servomotor 26

angles will be set to 90, and the software will automatically go into Test mode as shown below. Make sure the power is switched on the battery box is connected to the board. Driveshaft is at 90 degrees and the body is level 2 When the driveshaft is off slightly from a 90 degree angle, the degree value can be fine tuned in the Servomotor Calibration window. Be sure to input values that result in 90 degree angles. Driveshaft and body need modifying Click Values must be re-entered if you change Servomotor connectors. When the Servomotor angle calibration is completed, put a sticker number that is the same number as the Servomotor connector in order to easily identify it. 27

6.1.4. Programming 1 From the Motion palette, choose and attach it to. 2 Change 90 to 0 in. Connect the Studuino board to the PC via USB. Turn on the battery box switch, then choose Test ON from the Run menu. 3 After entering Test, click. Make sure the Servomotor moves to 0 degrees. 4 Change 0 to 180 in, then click. Make sure the Servomotor moves to 180 degrees. 28

5 Fit into 6 Enter 180 in the block and click to see if the motor moves to make 0 degree angle. The block can hold multiple Servomotor blocks, making the Servomotors move to the specified angle at the same time. Other processes cannot be used while the Servomotors are in motion. 29

6.2. Making a Robotic Arm that Uses Three Servomotors Now we're going to build a robotic arm that uses three Servomotors to grasp an object using the push-button switches on the board to control the arm. This program requires the use of Variable Blocks, Operator Blocks, and Button Blocks. 6.2.1. Assembling the Robot Assemble the robotic arm as shown below. Part 1 D9 Complete Part 2 D10 Assemble the same shape as Part 1 Complete Part 3 D11 Complete 30

Assembling (1)Assemble Parts 1 to 3 as shown in the picture. Part 2 Part 3 Part1 (2)Attach the battery box to the circuit board surface by connecting it to the POWER connector as shown in the picture below. POWER (3)To attach the arm, connect each Servomotor to the connector. D9 D10 D11 Make sure the sensor connecting cables are inserted correctly. The gray cable should be at the top. 31

6.2.2. Port Settings Before beginning to program, set the port information in the Block programming environment so it matches the board. Select Edit from the menu then select Port Settings from the pull down menu to open the setting dialog box. Make sure the D9, D10, and D11 boxes are checked in the Servomotor area. Check D9, D10, and D11 6.2.3. Programming See how one Servomotor moves. 1 In the Variables palette, click on Make a variable. Enter flag1 as the variable name. 1 Name it flag1 The Variable name setting dialog box will appear 3 Click 32

2 Drag from the Control palette and attach it to. 3 Now we ll create a process that changes the value of flag1 when button A0 is pressed. Drag from the Control palette to the Script field. 4 From the Operators palette, drag and attach as shown. 33

5 Drag from the Sensing palette and fit it into the left side of. Next, set the right side to 0. 6 From the Motion palette, choose and move it to the opening of. 7 Drag from the Operators palette and attach it as shown. 34

8 From the Variables palette, drag and attach to the right side of. Next, set the left side to 1. Now the process is complete. It changes the value of flag1 when button A0 is pressed. If the value of flag1 was 1 when button A0 is pressed, the value is changed to 0, if it was 0 then it becomes 1. 35

9 Now create a process that changes the angle of the Servomotor according to the value of flag1. Drag the block from the Control palette. 10 Drag from the Control palette to the Script field. 36

11 From the Variables palette, drag and attach to the left side of. Next, set the right side to 1. 12 From the Motion palette, choose and move it to the opening of. Enter the values 115 and 90 into the attached blocks, as shown. Now the process is complete. It changes the angle of the Servomotor according to the value of flag 1. 37

13 Connect the group of blocks you ve just made to the others, as shown. 14 Drag from the Control palette and use it to enclose the group of blocks. In the previous step, you created a process that changes the angle of the Servomotor when the push-button switch is pressed. This program uses a loop function. All the processes are executed right after the command is given, then the program immediately moves to the next step. This causes the processes to continue repeating while the button is pressed. Each loop changes the value of flag 1, resulting in a new Servomotor angle. 38

15 Drag from the Control palette and fit it into the position shown below. 16 Change the time in to 0.2 seconds. seconds. This will cause the state of the push-button switch to be checked every 0.2 39

17 Connect the big group to, as shown. Now the program is finished. It changes the angle of the Servomotor connected to D9 from 115 to 90 degrees when push-button switch A0 is pressed. 18 Choose Transfer from the Run menu to see how your program works. 40

19 Repeat the above steps to create programs for the other two Servomotors. Slide down the finished program and duplicate the block by Right-clicking the block. will appearblocks will be duplicated Right click and select Duplicate 41

20 Separate the duplicated blocks. Drag and drop to the Control palette. 21 In the Variables palette, click on Make a variable. Enter flag2 as the variable name. 1 Click 2 Name it flag2 The Variable name setting dialog box 3 Click 22 Replace the name flag1 in the duplicated block with flag2. 1Click 2Select 42

23 Drag to the right side of. Since the block that was already there will pop out, it's best to delete it by right-clicking on it. Alternatively, you can drag the block to the palette area to delete it. The block pops out 24 Duplicate the block to make two duplicated blocks again and attach them to the original block. 43

25 Duplicate the two duplicated blocks again and attach them to the originals. 1 Right click and select Duplicate Attach to original blocks 2 Right click and select Duplicate Attach to original blocks 26 Set the third Servomotor. Create variable flag3. 1 Click 2 Name it flag3 The Variable name setting dialog box will appear 3 Click 44

27 Follow the same steps as Servomotor two, but name the variable flag3 and choose D11 for the Servomotor. 28 Change the variables of the flag3 Servomotor blocks to 50 and 150 degrees. 45

29 Attach the blocks in the positions shown below. 46

30 Drag two blocks and attach them to the positions indicated below. Select flag2 and flag3. Now the program is finished. It changes the angle of the Servomotors connected to D9, D10, and D11 when push-button switches A0, A1, or A2 are pressed. Choose Transfer from the Run menu. When the transfer has finished, pressing A0, A1, or A2 will make the arms move. 47