Robot C Programming Tutorial By: Matthew Jourden .

2y ago
50 Views
5 Downloads
818.61 KB
9 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Philip Renner
Transcription

Robot C Programming TutorialBy: Matthew JourdenEngineering ProgramBrighton High SchoolRobot C Basic Screen OutlineFont Height Hotkey CTRL and /- to increase or decrease font heightMotor and Sensor Setup:Allows User to assign andFirmware:rename properties ofFix atingCode for easierreadingCompile Program:Checks the programfor bugsDownload code torobotProgramming AreaShortcutCoding Syntax:Drag and dropcoding intoyour programError and CompilingInfo Box

Robot C Programming TutorialBy: Matthew JourdenEngineering ProgramBrighton High SchoolFirmwareDefinition: programming language that is placed as read-only memory that is able to run certain program types( I.E FirmwareOS Apple products; Firmware Android Non-Apple Products)1. Turn the EV3 Brick ON2. Connect EV3 Lego Brick to the computer using the USB – Micro USB wire.3. Adjust the firmware from function block (Labview) to structured text (Robot C)a. Open Robot C for Lego Mindstorm 4.xb. Drop Down Menu Robot Platform Type Lego Mindstorms EV3c. Drop Down Menu Robot Download EV3 Linux KernelTutorial 1: Make It MoveA. Make It Move1. File New New File2. Screen LayoutCompile Program:Checks for errors in theprogram codeDownload to Robot: Sendscode to EV3 BrickMain body of the program.Braces represent the startand end of the programQuick Select Syntax Commands.Instead of typing commands;user can select optionsCompiler Information Bar: Shows userwhat has been compiled and if thereis any errors

Robot C Programming TutorialBy: Matthew JourdenEngineering ProgramBrighton High School3. Write the following Programa. May type all of the code or begin typing and drop down menus will appear to predict desired commandI.E4. Compile the program to make sure there are no errors or bugs in the program5. Connect the EV3 Brick to the PC using the USB cable Select the Download to Robot First time button ishit the software will ask you to save the source file and main file of the program. Navigate to the desiredfile location Pop menu will appear Click the Start button to start the programRobot C Program 1: Make it MoveWrite a Program that does the following. Move now faster than power setting of 251.2.3.4.5.6.7.8.9.10.Mark a start point with tapeGo forward as provided in the original program for 9 inchesTurn Right 90 degrees (Mark spot on the floor w/ tape)Pause 2.5 secondsGo forward 1.5 feetTurn Left 45 Degrees (Mark spot on the floor w/ tape)Pause for PI seconds (3.14 seconds)Go Forward 2 feetPause 2.68 secondsMove the robot in reverse back to the start point (Do not need to pause at the turns). Robot should come close to theoriginal marked position on the floor.Show program to Teacher.

Robot C Programming TutorialBy: Matthew JourdenEngineering ProgramBrighton High SchoolSensorsWhen using sensors or motors it is helpful to rename them to variable name that stands out and is easy to type.For Example: Default name for a Touch Sensor maybe S1. Changing the variable name to Touch instead of S1 can be helpfulwhen trying to debug the program.Click on the Motor Sensor Setup Icon at the top part of the screenAssign Names to thedifferent Sensor andMotor PortsAssign the type ofsensor/motor that will beused

Robot C Programming TutorialBy: Matthew JourdenEngineering ProgramBrighton High SchoolCoding: When coding with a sensor the syntax SensorValue [SensorName] will be used.Example of If Statement for Touch Sensor is touched to turn off motors:If (SensorValue [Touch] 1){motor [motorB] 0;motor [motorC] 0;}Sensors ValuesPort View on the EV3 Brick can be used to see what values are be returned for the sensor or the following code can be typed inthe program to display data on the brickExample is for Color Sensor (Code is in Bold; all other type are comments about the code)// Write the amount of reflected light to the screen// This is a value between 0 and 100, where 0 means no reflected// light and 100 means all light is being reflecteddisplayBigTextLine(4, "Reflected: %d", SensorValue[Colour]);Sleep (20); // Wait 20 ms to get 50 readings per secondTouch: 0 Not Pressed1 PressedUltrasonic: Units cm distanceColor: Solid Colors or Light Reflected Percentage

Robot C Programming TutorialBy: Matthew JourdenEngineering ProgramBrighton High SchoolTutorial 2: Touch Sensor1. Mount the Touch sensor to the front of your robot2. When using the Touch Sensor there is two values 0 not pressed and 1 pressed. Using an If or Whilestatements the programmer can make the robot do conduct different actions based on the inputted data.3. Create a NEW Program4. Sensor SetupDrop down menu allows user toi. Robot Motors and Sensors Sensors Tabselect the type of sensor that isdesired.Name Sensor.NOTE: Can use the nameor Index within the codeii. Apply Ok5. Write the following program7. Upload the program and test the touch sensor with a barrier

Robot C Programming TutorialBy: Matthew JourdenEngineering ProgramBrighton High SchoolRobot C Program 2: Touch SensorWrite a program that will do the following1. Touch sensor starts the robot going forward (Speed not greater than 25)2. Touch sensor pressed a second time will stop the robotShow Teacher upon completionTutorial 3: Ultrasonic Sensor1. Setup: Set the Ultrasonic sensor in the Motor and Sensor Setup to Sonic . Be sure you place the name in the same port.See below for example. Ultra Sensor is set in Port 2.2. Write the following program.NOTE: the ultrasonic sensor works with default units of cmWhile (true) loop is a way to runthe program continuously withouthaving a counter or end. Inessence it is a forever loop3. Upload and test the program

Robot C Programming TutorialBy: Matthew JourdenEngineering ProgramBrighton High SchoolTutorial 4: Color Sensor1. Setup: Set the color sensor in the Motor and Sensor Setup to Colour (Note the word Color cannot be used becauseof a conflict with the sensor name and comparison code). Be sure you place the name in the same port. See belowfor example. Color Sensor is set in Port 3.Type the following program.Program should do the followingWhen a color sensor light reflection is greater than 40 then the motors will stop. If light reflection is less than 40 than themotors will move. Note: Depending on the surface the comparison value may have to be adjusted.2. Modify the program accordingly to work on your surface.Edit/Modify the program for the surface that you are working on so the robot will not fall of the table.

Robot C Programming TutorialBy: Matthew JourdenEngineering ProgramBrighton High SchoolRobot C Program 3: CapstoneDesign an attachment to your robot that will pick up the predefined object. BE sure to set the type of motor in the Motor andSensors Setup menu. NOTE: Must use sensors for all movements; NO predefined distances/timing with the motors.1. Design a gripper that will grab and move a desired object2. Touch Sensor to Start the Robot3. Color Sensora. Stop at 1st black lineb. Pause for 1.4 secondsc. Turn Rightd. Stop at Edge of tablee. Pause for 1.4 secondsf. Back up 2 wheel rotationsg. Turn Lefth. Drive to the object4. Sense Object to be picked up (May use any type of sensor)5. Drive to the drop off area.6. Release object7. Reverse robot without touching or knocking the object over8. Stop9. Return to the Start positionShow teacher when completed

2. Connect EV3 Lego Brick to the computer using the USB – Micro USB wire. 3. Adjust the firmware from function block (Labview) to structured text (Robot C) a. Open Robot C for Lego Mindstorm 4.x b. Drop Down Menu Robot Platform Type Lego Mindstorms EV3 c. Drop Down Menu Robo

Related Documents:

robot - kuka kr iontec p. 8/9 range of electrospindles for industrial robots gamma di elettromandrini per robot industriali p. 6/7 robot - kuka kr quantec p. 12/13 robot - kuka kr quantec robot - kuka kr 360 fortec robot - kuka kr 500 fortec robot - kuka kr 600 fortec p. 16/17 rotary tables tavole rotanti p. 20/21

1. The robot waits five seconds before starting the program. 2. The robot barks like a dog. 3. The robot moves forward for 3 seconds at 80% power. 4. The robot stops and waits for you to press the touch sensor. 5. The robot moves backwards four tire rotations. 6. The robot moves forward and uses the touch sensor to hit an obstacle (youth can .

steered robot without explicit model of the robot dynamics. In this paper first, a detailed nonlinear dynamics model of the omni-directional robot is presented, in which both the motor dynamics and robot nonlinear motion dynamics are considered. Instead of combining the robot kinematics and dynamics together as in [6-8,14], the robot model is

In order to explore the effect of robot types and task types on people s perception of a robot, we executed a 3 (robot types: autonomous robot vs. telepresence robot vs. human) x 2 (task types: objective task vs. subjective task) mixed-participants experiment. Human condition in the robot types was the control variable in this experiment.

“robot” items) are dragged into the appropriate place. From Easy-C to the Robot The process by which we get our code to the robot is: 1) Turn off the robot and remove the VEXnet device 2) Plug the USB connector into the PC and the robot 3) Using Easy-C, write your program 4) Using Easy-C, get your “

To charge, the Power button on the side of the robot must be in the ON position (I). The robot will beep when charging begins. NOTE: When manually placing the robot on the base, make sure the Charging Contacts on the bottom of the robot are touching the ones on the base and the robot

robot.reverse() Reverse the robot’s current motor directions. For example: if going forward, go backward. If going left, go right. This is not the same as going backward! robot.stop() Stop both motors. table 4-2 The Robot Class Commands running Your Program: Make Your robot Move Before you execute your pr

Comparison of robot tact times Tact time SACARA robot YK500XG YK500TW Cartesian robot FXYx Shortened greatly. Cartesian robot FXYx Standard type SCARA robot YK500XG Orbit type SCARA robot YK500TW A C B A C B A C B A C B Movement range YAMAHA’s conventional model Cycle time YK50