sábado, 10 de agosto de 2019

Robot Development
As was mentioned components are
DC motors
H bridge
Arduino Uno
BT module hc-06
Cables

The components used are as follows
The distance sensor measured in cm distance to objects in his forehead, this distance is sent through the Bluetooth module to the cell containing the program with fuzzy logic, you see the program run the calculations these are returned to arduino via Bluetooth, arduino receives the values ​​(engine speed) and sends the motors controlling its speed and action.
For the code in arduino first step inputs the electronic components was defined, and methods for motor control, a method to go ahead and another to turn right both with an input parameter of velocity is created, one you see this pricede done to create the code that you get the distance sensor and send it via the BT module, once sent likewise receives speed data are passed to these methods and the robot works.


The logic code difuza works this way, we have an entry that is the distance the robot with objects this entry works in triangular functions, output veloccidad in definita code as "timepo" which varies as a value from 0 to 255 as calculated with distance, the rules are simple when the distance is close to the speed will be short, when the distance is half the velodicad will mean and when the distance is far speed will be prolonged.


We started with Android Studio
In order to achieve communication with the Bluetooth component class in which the device information associated with our phone was represented I was used, as we observe the classes dispositivosBT work with APIs and created for the BT connection, which through methods of the system as onResume are where we extract the list of connected devices, onItemClic in this event will make the connection of a device by clicking on its name, and we have a method that allows us to check the status of dispoditivo that we want to connect

In the second class, will handle the system interface our robot, here the results that occur in the execution system such as the distance from the robot and the distance is sent to the engines represent the main operation lies in the method main onCreate in which the first step is to load our file loggia difuza one you see echo this proceed to retrieve the values ​​of the distance sensor from the BT module arduino, with the value obtained evaluate the rules and get the value of speed again I will be back to arduino to control the motors.



This project seeks to implement fuzzy logic in a robot so that it can detect objects and perform maneuvers to avoid it, the development process consisto in 3 parts:
Creating a robot with distance sensors, bluetooth module, DC motors, h bridge an Arduino Uno.
Development of fuzzy control system of values ​​robot reaction
Development of an Android application to run processes from cell