Detail Produk Arduino Robot Duinopeak
Detail Produk Arduino Robot Duinopeak
Introduction
The Arduino Robot is the first official Arduino on wheels. The robot has two processors, one on each of its two
boards. The Motor Board controls the motors, and the Control Board reads sensors and decides how to operate. Each
of the boards is a full Arduino board programmable using the Arduino IDE.
Both Motor and Control boards are microcontroller boards based on the ATmega32u4 (datasheet). The Robot has
many of its pins mapped to on-board sensors and actuators.
Programming the robot is similar to the process with the Arduino Leonardo. Both processors have built-in USB
communication, eliminating the need for a secondary processor. This allows the Robot to appear to a connected
computer as a virtual (CDC) serial / COM port.
As always with Arduino, every element of the platform – hardware, software and documentation – is freely available
and open-source. This means you can learn exactly how it’s made and use its design as the starting point for your own
robots. The Arduino Robot is the result of the collective effort from an international team looking at how science can
be made fun to learn. Arduino is now on wheels, come ride with us!
Power
The Arduino Robot can be powered via the USB connection or with 4 AA batteries. The power source is selected
automatically.
For safety purposes, the motors are disabled when the robot is powered from the USB connection.
The robot has an on-board battery charger that requires 9V external power coming from an AC-to-DC adapter (wall-
wart). The adapter can be connected by plugging a 2.1mm center-positive plug into the Motor Board’s power jack.
The charger will not operate if powered by USB.
The Control Board is powered by the power supply on the Motor Board.
Memory
The ATmega32u4 has 32 KB (with 4 KB used for the bootloader). It also has 2.5 KB of SRAM and 1 KB of
EEPROM (which can be read and written with the EEPROM library).
The Control Board has an extra 512 Kbit EEPROM that can be accessed via I2C.
There is an external SD card reader attached to the GTFT screen that can be accessed by the Control Board’s
processor for additional storage.
All the connectors are labelled on the boards and mapped to named ports through the Robot library allowing access to
standard Arduino functions. Each pin can provide or receive a maximum of 40mA at 5V.
Control Board TK0 to TK7: these pins are multiplexed to a single analog pin on theControl Board’s microprocessor.
They can be used as analog inputs for sensors like distance sensors, analog ultrasound sensors, or mechanical
switches to detect collisions. Control Board TKD0 to TKD5: these are digital I/O pins directly connected to the
processor, addressed using Robot.digitalRead() and Robot.digitalWrite) functions. Pins TKD0 to TKD3 can also be
used as analog inputs with Robot.analogRead() Note: if you have one of the first generation robots, you will see that
the TKD* pins are named TDK* on the Robot’s silkscreen. TKD* is the proper name for them and is how we address
them on the software.
Motor Board TK1 to TK4: these pins are named in software as B_TK1 to B_TK4, they can be digital or analog input
pins, and support Robot.digitalRead(), Robot.digitalWrite) and Robot.analogRead().
Serial Communication: The boards communicate with each other using the processors’ serial port. A 10-pin connector
connects both boards carries the serial communication, as well as power and additional information like the battery’s
current charge. Control Board SPI: SPI is used to control the GTFT and SD card. If you want to flash the processor
using an external programmer, you need to disconnect the screen first. Control Board LEDs: the Control Board has
three on-board LEDs. One indicates the board is powered (PWR). The other two indicate communication over the
USB port (LED1/RX and TX). LED1 is also accessible via software. Both boards have I2C connectors available: 3 on
the Control Board and 1 on the Motor Board.
Duinopeak optimized the official ArduinoRobot
Since the official release ArduinoRobot, By the vast number of Arduino lovers of popularity and attention, although
the official price is expensive, there are still a lot of fans to buy to learn and use.But many users found the official
library many shortcomings, such as: tracking is not smooth, compass can’t calibration, LCD screen can’t display text
and so on.Duinopeak based on the service of open source hardware and DIY robot enthusiasts , has carried on the
partial optimization to official Arduino libraries, make our DuinopeakRobot in compatible with the official library
situation, more outstanding performance!That is to say, we have some different from Arduino official.Another
Duinopeak developed new applications, based on which the later will continue to update, stay tuned.
optimize tracking function library
1,Download the tracking optimization library file under the “Resources” directory in this page,and the extract it,get a
lineFollow.cpp file.
2,Copy this lineFollow.cpp file ,to replace the Arduino official source file of lineFollow.cpp.The directory of the
Arduino official source file is ……\ libraries \ Robot_Motor \ src \lineFollow. cpp.
3,After replace the Arduino official lineFollow.cpp,it is time to verify the motor driver library.Open the Arduino
IDE,select Robot_Motor \ examples \ Robot_Motor_Core program,As shown below:
ArduinoRobot Robot Motor Core image1.PNG
4,Use a USB cable to connect the PC and the underlying Motor control board interface, select the board type for the
Arduino Robot Motor, COM port on your computer matching, download the program to the main control board, so,
we will change the ArduinoRobot underlying Motor drive.
5,Now you can open the tracking program , use USB cable to connect the PC and the second layer Control main
board interface, select the board type for the Arduino Robot Control, COM port, on your own computer matching
,selection Robot_Control \ examples \ explore \ R02_Line_Follow program.As shown below:
ArduinoRobot exploreLineFollow image1.PNG
6, After open the program, don’t hurry to download the program, because this Arduino official program have bugs, so
we need to modify, of course you also can be directly compiled, download program to ArduinoRobot main Control
board, see what will happen.We will find that there are two lines of text not display on the LCD panel !It is the two
lines of text.As shown below:
Robot.text(“Line Following\n\n place the robot on\n the track and \n see it run”, 5, 5);
Robot.text(“Press the middle\n button to start…”, 5, 61);
ArduinoRobot LineFollowText1.jpg
Why the LCD not diaplay the two lines of text?Because there without a set font color statement.so we need to add
Robot.Stroke(0,0,0) before two lines of text.As shown below:
ArduinoRobot exploreLineFollow image2.PNG
7,Recompile and download program to the second main control board of ArduinoRobot,now we can see the LCD
screen can show the two lines text.The following are two normal display process diagram:
ArduinoRobot LineFollowlogo1.jpgArduinoRobot LineFollowText2.jpg
8, According to the text tip, put ArduinoRobot on black white cardboard, presses the the middle button, ArduinoRobot
will automatic calibration, and then automatically tracking black line!
optimize compass function library
Official ArduinoRobot compass in the master control board uses is HMC6352 chip, this is an old version of the digital
compass, it has only two axis of the earth’s magnetic field component, poor performance of calibration;Arduino
official offer a compass library,but no correspond fuction library of compass calibration,it is difficult to use official
compass to achieve accrurate compass orientation under the condition of the magnetic interference field. Aiming at
this shortcoming,Duinopeak put forward the solution.We upgrade the compass chip,which is modified to the
prevailing HMC5883 three-axis digital compass.Its advantages are: high precision error (1-2 degrees), there will be
no magnetic saturation phenomenon, there will be no accumulative error.
We rewrite the HMCC5883 compass library,and make the interface of the fuction exactly same as the official; As long
as we replace the official version with our HMC5883 digital compass library.Our own HHMC5883 libray have
automatic calibration function,when the compass first start to used ,DuinopeakRobot will automaticlly turn the robot
to calibration.
The “Robot_Control \ examples \ explore \ R01_Logo” program, let users to editor the implement action through the
up ,down ,right and left keys . For right or left turn,it will call the compass fuction,but Arduino official program do
not have the compass calibrated,which will lead to ArduinoRobot implementing the turn command is not correct.So
we have to modify the program.
The original official Logo program is as show below:
We add a line program, “Robot.com passRead ();” Will be used for compass calibration at the time of
initialization,After adding the program as shown in the figure below:
After start the ArduinoRobot,we can see that it first turn right, turn left a few laps for compass calibration, finally, it
stopped;And then we according to the LCD text prompt, enter you are going to implement instruction, finally press
the center button, implement your commands.
Change the ArduinoRobot speed when use the compass to achieve specified angle
Above Logo program, when turn 90 angle ,we find a small problem:Corner speed is not enough, means not enough
torque,which sometimes cause didn’t turn to a specified Angle so has been stuck in a certain Angle.This is a small
problem,we just need to change the PWM value when use the compass to achieve the specified angle.
1,In your Arduino comiler installation directory ….. \ libraries under \ Robot_Control \ src\Motors.cpp ,open
Motors.cpp file with clipboard,the find the “void RobotControl: : pointTo (int Angle) {}” function, as shown in the
figure below, we can see that the speed = 80, that means when use the compass to achieve the specified angle,it will
set the mortor pwm value to 80.
ArduinoRobot RobotControl Motors modify1.PNG
2,To increase the torque and rotational speed of motor, we just increase the PWM value, so we increased the speed
value to 120, as shown in the figure below.Save the file, save our changes.
ArduinoRobot RobotControl Motors modify2.PNG
3, in order to validate our modification, Recompile the Logo program,and download the program to the second layer
Control main board.Then turn the power switch to OFF position,and then put the USB cable and ArduinoRobot
disconnected;Take ArduinoRobot to a more open desktop,then turn the power switch to ON position ot start
ArduinoRobot.
4,After start the ArduinoRobot,we can see that it first turn right, turn left a few laps for compass calibration, finally, it
stopped;And then we according to the LCD text prompt, enter you are going to implement instruction, finally press
the center button, implement your commands.And we can see 90 angle speed is faster than before.