Ling+Chen
Abstract:According to the study of Arduino platform so far, the several numbers of units related to Arduino platform within its SCM (single chip microcomputer) are assumed to be employed.to some context, some units are already known both to be used and further investigated in industrial areas.
Key words:Arduino;code;sensor
CLC number:TP368 Document identification code:A Article number:1671-2064(2017)09-0048-02
1 Motor Control
The most basic part is to control the direction of robots. A single motor is enabled for using to make robot stop and forward easily .However, in some situation, turning is required once meeting obstacle or needing other non-linear directions. In order to complete more differing motions, H-bridge is utilised as a central structure of connecting command of two motors together. Moreover,as shown in Figure 1,revering engine is a vital task for H-bridge.
The graph above shows three motion,off,forwardreversefor an engine.as all switch off, power outage.With no current through the motor, the motion would be off. In this case, all switch is off.However, the more advantageous way is to set the engine power zero, like the codes in the lab:
digitalWrite(ENA_PIN, LOW);
digitalWrite(ENB_PIN, LOW);
As illustrated in the middle, the graph with H-bridge turning off left switch and on the right one.Which represent 0and1 in digital logic language respectively .as coding:
The motor is then simulated to executed in a clockwise direction by the current.
To the contrary, for achieving backwards,10is applied inversely.
Generally,in the wake of basis functions,turing leftand ‘rightare secondarily considered in robots application.while a moter rotate clockwise, and another run anti-clockwise,the whole structure of robot will turning with right or left depend on the position of the motors.a similar codes lists:
In this case,there are two other methods to keep the robot left.one is to keep running moter B but turn off moter A is.an other one is to keep moter A anti-clockwise and turn off moter B. these method provide spinning motions.
When the function come into being, motions loop created:
According to the limited, narrow space of arena in the final challenge, the robot sometimes gets stuck in sizes or corners.To solve this problem, the code was developed as ‘stopbackwardsleft, which lead to more conveniently escape the obstacles and tracking the right route.
Sensing Distance
In order to avoid striking into the wall, the distance between obstacle and cars body should be known.So the sensor is placed in front of the robot car opposite to the forwards direction.
In practice employment, when ‘distancereach or below 10, it can conduct pre-set function with delays happen due to the pulse back time. However, some errors are unavoidable.calculating the distance of front obstacles sometimes would be bigger or smaller, which is caused because of motions being conducted during the pulse-echo time.It leads to a fine distinction between practical and theoretical robot reaction and routeing paths.
2 Conclusion
According to the study of Arduino platform so far, the several numbers of units related to Arduino platform within its SCM (single chip microcomputer) are assumed to be employed.to some context, some units are already known both to be used and further investigated in industrial areas.
Author:A engineering student studying in Department of engineering of UoL, have experience in mechanics,materials analysis and product design for 5 years.