background image

 

 

AiStarter User Guide

 

User  Guide 

Issue

V1 

Date

2018-12-26 

 

ShenZhen Yuejiang Technology Co., Ltd. 

Summary of Contents for AiStarter

Page 1: ...AiStarter User Guide User Guide Issue V1 Date 2018 12 26 ShenZhen Yuejiang Technology Co Ltd ...

Page 2: ...idental consequential or indirect damages resulting from the use of our products and documents Before using our product please thoroughly read and understand the contents of this document and related technical documents that are published online to ensure that the robotic arm is used on the premise of fully understanding the robotic arm and related knowledge Please use this document with technical...

Page 3: ...18 12 26 Add demo and update API 2018 04 27 The first release Symbol Conventions The symbols that may be founded in this document are defined as follows Symbol Description DANGER Indicates a hazard with a high level of risk which if not avoided could result in death or serious injury WARNING Indicates a hazard with a medium level or low level of risk which if not avoided could result in minor or m...

Page 4: ...r Sensor 9 4 Installation 10 4 1 Mixly Installation 10 4 2 Arduino IDE 10 5 User Operation 11 5 1 Mixly Introduction 11 5 2 Arduino IDE Introduction 11 5 3 Blockly Description 12 5 3 1 Setting Direction and Speed 12 5 3 2 Setting Direction Speed Time 13 5 3 3 Setting Motor Speed 13 5 3 4 Starting AiStarter Sonar 13 5 3 5 Detecting Barrier 14 5 3 6 Getting The Detection Distance of Sonar 14 5 3 7 D...

Page 5: ...5 6 5 1 Description 25 6 5 2 Procedure 26 6 5 3 Code Description 26 7 API Function 29 7 1 Initialization 29 7 2 Setting Direction and Speed 29 7 3 Setting Direction Speed Time 29 7 4 Setting Motor Speed 30 7 5 Setting Motor Parameter 30 7 6 Getting Motor Pose 30 7 7 Initializing Ultrasonic Sensor 31 7 8 Getting the Detection Distance of Ultrasonic Sensor 31 7 9 Detecting obstacle 31 7 10 Getting I...

Page 6: ...e package at the time of signing for acceptance of the goods Within 7 days upon purchase of the goods inclusive calculated from the date of receipt of the goods if the goods are found to be missing or damaged due to transportation or a non artificial performance failure occurs to the goods or accessories please immediately contact the local after sales service department for supplement or replacem...

Page 7: ... temperature etc Appearance and function abnormality caused by man made collision and dropping The abnormal function caused by wet environment soak or burn Damage caused by improper use installation and operation that are not in accordance with the official instructions Damage caused by circuit redesign improper installation of the battery overcharge improper installation and connection and improp...

Page 8: ... with Arduino which is very easy to get started Function features Intelligent obstacle avoidance Automatic tracking Identify scenes based on color and perform different tasks Graphical programming user can program by building blocks to control AiStarter 2 2 Parts List Table 2 1 Parts List Part Number Chassis 1 Shell 1 Control Board 1 Ultrasonic Sensor 3 Infrared Sensor 1 Color Sensor 2 DC Gear Mot...

Page 9: ...ers Table 2 2 Technical Parameters Parameters Description Operating Voltage 7 4V Control Board DuDuino Mega compatible with Arduino Mega 2560 MPU ATmega2560 Battery 18650 Li ion rechargeable battery Ultrasonic Measurement Range 3mm 500mm VTBOT Size 195mm 172mm 79mm VRBOT Weight 810g Maximum Load 500g Tire Diameter 67mm Operating Environment 0 C 40 C Control Software Arduino IDE or Mixly Communicat...

Page 10: ...er User Guide Copyright Yuejiang Technology Co Ltd 5 Parameters Description Geomagnetic sensor 1 Light sensor 1 Motor Parameters Reduction ratio 48 1 Voltage 7V No load current 150mA Stall current 700mA Maximum rotate speed 100r m Encoder resolution ratio 585pulse r ...

Page 11: ...er which is shown in Figure 3 1 presets two servo signal interfaces for user expansion Figure 3 1 AiStarter control board description 3 1 2 AT Mega2560 Processor AiStarter processor is atmega2560 which compatible with arduino2560 you can develop by arduinoIDE Meanwhile we provide Mixly graphical programming environment 3 1 3 Button The end of AiStarter controller integrates four independence butto...

Page 12: ...ndicates that the AiStarter battery voltage is normal Steady Red Indicates that the AiStarter battery has a low voltage D Blue User defined User can set function in Mixly or Arduino IDE environment 3 1 5 USB AiStarter intergrates USB download function you can download program to AiStarter by USB and make AiStarter run by program Meanwhile USB charging function are supported by Aistarter you can ch...

Page 13: ...ser Guide Copyright Yuejiang Technology Co Ltd 8 USB drive again in Arduino X drivers path X is the Arduino version please replace it according to the actual situation Figure 3 2 USB drive 3 1 6 Interface Description Figure 3 3 AiStarter main control board interface description ...

Page 14: ...or on the left side of AiStarter 11 Xbee interface 12 Reserved servo interface 13 Bluetooth interface which is UART interface 14 Reserved servo interface 15 Reserved serial interface which is UART interface 16 Wifi interface which is UART interface 17 USB interface which is standard Micro USB interface 18 Power interface connected to battery on the AiStarter chassis 3 2 Infrared Sensor An infrared...

Page 15: ...omplicated installation The download path is http mixly org explore software mixly arduino NOTE At present AiStarter only support Mixly 0 995 the other versions are not supported 4 2 Arduino IDE AiStarter supports Arduino C programming language Arduino is a convenient and flexible open source electronic platform which includes Arduino develop tools Arduino IDE and core library The Arduino IDE pack...

Page 16: ...r compiling AiStarter will work according to the program For the Blockly details please see Blockly Description For the API function details please seeAPI Function Figure 5 1 The page of Mixly NOTICE If you can not get the corresponding serial port of AiStarter when you open Mixly please ensure the Arduino USB drive has been installed If you still can not get serial port information after installi...

Page 17: ...n Tools Processor path select the corresponding serial port in Tools Port path User can select example on the File Examples AiStarter page click to upload example to AiStarter which will make AiStarter work according to the example You can also refer to API Function to upload program to AiStarter by calling API function which will make AiStarter work according to the program 5 3 Blockly Descriptio...

Page 18: ...Time Table 5 2 Set direction speed time Blockly Description This module is used to set direction speed time Parameter Direction Ahead Back Turn left Turn right Speed Set running speed value range 0r m 100r m Motion Time Set running time Return None 5 3 3 Setting Motor Speed Table 5 3 Set motor speed Blockly Description This module is used to set the motor speed Paramater Motor Select the motor the...

Page 19: ...iption This module is used to detect whether a barrier is exist in front of AiStarter before calling this module please start the corresponding sonar Paramater Obstacle position Right front Front Left front Return Return 1 There is a barrier Return 0 There is no barrier 5 3 6 Getting The Detection Distance of Sonar Table 5 6 Get the detection distance of sonar Blockly Description This module is us...

Page 20: ...her tracking line is black or white Paramater Select infrared tracking sensor ports IR1 IR2 IR3 IR4 IR5 IR6 Tracking line color select color black or white Return Return 1 There is a line Return 0 There is no line 5 3 8 Getting Infrared Sensor Data Table 5 8 Get infrared tracking sensor data Blockly Description This module is used to get infrared sensor data Paramater Infrared sensor ports IR1 IR2...

Page 21: ...ion This module is used to set white balance Paramater Select the left color sensor or the right color sensor Return None 5 3 11 Setting Color Sensor Status Table 5 11 Set color sensor status Blockly Description This module is used to set color sensor enable state Paramater Color sensor Selet the left color sensor or the right color sensor Status Select open or close Return None 5 3 12 Getting RGB...

Page 22: ...y Description This module is used to detect color Paramater Color sensor Select the left color sensor or the right color sensor Color Red Green Blue Return Return 1 There is a color Return 0 There is no color 5 3 14 Getting Switch Status Table 5 14 Get switch status Blockly Description This module is used to get switch status Paramater Switch Switch1 Switch2 Switch3 Deturn Retuen 1 Press Return 0 ...

Page 23: ... used to detect switch state Paramater Switch Switch1 Switch2 Switch3 Switch state Select switch state press or release Deturn Return 1 Status detected Retuen 0 No status detected 5 3 16 Getting Photosensitive Value Table 5 16 Get photosensitive value Blockly Description This module is used to get photosensitive value Paramater None Return Return photosensitive value Value range 0 4096 ...

Page 24: ...er buzzer beeps one time Step 3 Press down the key start stop once agian AI Starter stops tracking line after the buzzer beeps one time 6 1 3 Code Description 1 Get the current infrared sensor value Program 6 1 Get infrared sensor value void getCurrentIRState int irstate irstate 0 for int i 0 i IR_NUM i irstate AIStarter_SmartBotGetIRModuleValue i i 2 Get AI Starter pose Program 6 2 Get AI Starter...

Page 25: ...ffCnt else readPos lastPos calculate the current position curPos 1 coeff lastPos coeff readPos lastPos curPos return curPos 3 Set AI Starter speed Program 6 3 Set AI Starter speed void setCarSpeed const float curPos const int baseSpeed 50 rpm const float kp 1 const float ki 0 06 const float kd 0 0 const float errorsumLimit 50 float error curPos static float lastError static float errorsum float er...

Page 26: ...SmartBotSetMotor MOTORL speedLeftWheel AIStarter_SmartBotSetMotor MOTORR speedRightWheel Serial println go ahead 6 2 Obstacle Avoiding Demo 6 2 1 Description This demo realizes that AI_Starter avoids obstacle automatically 6 2 2 Procedure Step 1 The motors stop running after turning on AI Starter Step 2 Press down the key start stop AI Starter starts avoiding obstacle Step 3 AI Starter moves back ...

Page 27: ... AIStarter_SmartBotGetSonar SONAR3 3 Set turning mode according to the distance between obstacle and AI Starter Program 6 6 Set turning mode if dis 0 2 DIS motorStatus AHEAD else if dis 0 DIS dis 0 2 DIS motorStatus motorStatus else if dis 0 0 dis 0 DIS motorStatus BACKRIGHT break if dis 1 2 DIS motorStatus AHEAD else if dis 1 DIS dis 1 2 DIS motorStatus motorStatus else if dis 1 0 dis 1 DIS motor...

Page 28: ...BACKSPEED AIStarter_SmartBotSetMotor MOTORL BACKSPEED delay BACKTIME AIStarter_SmartBotSetMotor MOTORR DIFSPEED AIStarter_SmartBotSetMotor MOTORL FRONTSPEED delay SWERVETIME break case BACKLEFT AIStarter_SmartBotSetMotor MOTORR BACKSPEED AIStarter_SmartBotSetMotor MOTORL BACKSPEED delay BACKTIME AIStarter_SmartBotSetMotor MOTORR FRONTSPEED AIStarter_SmartBotSetMotor MOTORL DIFSPEED delay SWERVETIM...

Page 29: ...Demo 6 4 1 Description This demo realizes the function that combines color recognition with line tracking 6 4 2 Procedure Step 1 Press down the key start stop AI Starter starts tracking line after buzzer beeps one time Step 2 In tracking line process when detecting black line AI Starter stops moving and begins to detect color Step 3 When the recognized color is red AI Starter stops moving for 3s a...

Page 30: ...SmartBotGetColorSenor COLORSENOR1 BCOLOR 30 colorState RLINE 3 AI Starter executes different action according to different color status Program 6 12 Execute action switch colorState case OTHERLINE colorRec false lineState LINEPATROL break case RLINE delay 3000 colorRec false lineState LINEPATROL break case GLINE delay 3000 colorRec false lineState LINEPATROL break default break 6 5 Cooperation Dem...

Page 31: ... and the buzzer beeps three times Step 4 When the recognized color is green AI Starter stops moving for 1 minute and the buzzer beeps one time Step 5 AI Starter keeps tracking line Step 6 Press down the key start stop once agian AI Starter stops tracking line after the buzzer beeps one time Magician Step 1 Open Magician file in the Magician Coorperation file folder to upload Magician firmware to A...

Page 32: ...r executes different action according to different color status Program 6 15 Execute action switch colorState case OTHERLINE colorRec false lineState LINEPATROL break case RLINE delay 3000 colorRec false lineState LINEPATROL break case GLINE delay 3000 colorRec false lineState LINEPATROL break default break Magician 1 Set cube position Program 6 16 Set cube position float AreaPoint 4 3 137 05 206 ...

Page 33: ...JUMP_XYZ AreaPoint i 0 AreaPoint i 1 AreaPoint i 2 0 Dobot_SetEndEffectorSuctionCupEx true Dobot_SetPTPCmdEx MOVL_XYZ AreaPoint i 0 AreaPoint i 1 AreaPoint i 2 70 0 Dobot_SetPTPCmdEx JUMP_XYZ trayPoint i 0 trayPoint i 1 trayPoint i 2 0 Dobot_SetEndEffectorSuctionCupEx false Dobot_SetPTPCmdEx MOVL_XYZ trayPoint i 0 trayPoint i 1 trayPoint i 2 30 0 Dobot_SetPTPCmdEx MOVJ_XYZ InitPositionX InitPositi...

Page 34: ...ction and Speed Table 7 2 Set direction and speed Function int AIStarter_SmartBotSetMovment int dir int speed Description Set direction and speed Paramater dir Set direction enum FRONT BACK RIGHT LEFT speed Set Duty Ratio Value range 0 255 Return None 7 3 Setting Direction Speed Time Table 7 3 Set direction speed time Function int AIStarter_SmartBotSetMovmentTime int dir int speed float time Descr...

Page 35: ...t speed Description Set motor speed Paramater port Select motor enum MOTORR MOTORL speed Set speed Value range 0 200rpm Return None 7 5 Setting Motor Parameter Function int AIStarter_SmartBotSetMotorPI float KP float KI Description Set motor parameter Paramater KP Proportion factor Value range 0 5 2 5 KI Integral factor Value range 0 05 0 5 Return None 7 6 Getting Motor Pose Function float AIStart...

Page 36: ... Select ultrasonic sensor enum SONAR1 SONAR2 SONAR3 Return None 7 8 Getting the Detection Distance of Ultrasonic Sensor Table 7 6 Get the detection distance of ultrasonic sensor Function float AIStarter_SmartBotGetSonar int port Description Get the detection distance of ultrasonic sensor Paramater port Select ultrasonic sensor enum SONAR1 SONAR2 SONAR3 Return Return detection distance Unit cm 7 9 ...

Page 37: ... 8 Get infrared sensor data Function int AIStarter_SmartBotGetIRModuleValue int port Description Get infrared sensor data Paramater port Select infrared sensor ports enum IR1 IR2 IR3 IR4 IR5 IR6 Return Return 1 Black line detected Return 0 No black line detected 7 11 Getting Geomagnetic Angle Table 7 9 Get geomagnetic angle Function float AIStarter_SmartBotGetCompass Description Get geomagnetic an...

Page 38: ... left most key once again to finish calibration Paramater None Return None 7 13 Setting White Balance Table 7 11 Set white balance Function int AIStarter_SmartBotSetColorWB int port Description Set white balance Paramater port Color sensor enum COLORSENOR1 COLORSENOR2 Return None 7 14 Setting Color Sensor Status Table 7 12 Set color sensor status Function int AIStarter_SmartBotSetColorSenor int po...

Page 39: ...color Paramater port Color sensor enum COLORSENOR1 COLORSENOR2 color Detect color enum RCOLOR GCOLOR BCOLOR Return Return 1 Color detected Return 0 No color detected 7 16 Getting RGB Value Table 7 14 Get RGB value Function int AIStarter_SmartBotGetColorSenor int port int color Description Get RGB value Paramater port Color sensor enum COLORSENOR1 COLORSENOR2 color Get color enum RCOLOR GCOLOR BCOL...

Page 40: ...artBotGetKeyValue int key Description Get switch status Paramater key Select switch enum SW1 SW2 SW3 Return Return 1 Press down Return 0 Release 7 19 Setting LED Status Function int MobilePlatform_SmartBotSetKeyInit Description Initiallize switch Paramater None Return None Function int AIStarter _SmartBotSetLED int port int state Description Set LED Paramater port Select LED enum LED1 LED2 state S...

Page 41: ...able 7 16 Get photosensitive value Function int AIStarter_SmartBotGetLightAnalog Description Get photosensitive value Paramater None Return Return photosensitive value 7 21 Setting Ultrasonic Threshold Function int AIStarter_SmartBotSetSonarThreshold int dis Description Set ultrasonic threshold Paramater dis Set threshold Unit cm Return None Return None ...

Reviews: