Remote control of the robot. Ways to control the robot. WiFi control

Today you won't surprise anyone with radio-controlled homemade products. But you must admit, it’s somehow “the old fashioned way” to press the control keys... It’s much more interesting to control crafts with the help of brush movements, right? This article shows an example of how you can organize remote control using an Arduino board and several bend sensors. PHIRO Pro will act as a test subject

Step 1: What you will need

  • Bend sensors;
  • Arduino UNO;

  • Bluetooth module HC-05;

  • Glove;

  • Jumpers;

  • 9B battery;

  • Pocket Code app.

Step 2: Upload Firmata Standard to Arduino

It is necessary to load the firmata standard onto the Arduino board in order to connect it with Pocket Code. In this project we use Arduino UNO, but any Arduino board can be used.

  • We connect the Arduino board to the computer/laptop.
  • In Arduino ID, select COM Port. Tools -> Serial Port -> Corresponding COM Port
  • Next, select the board type. Tools -> Board -> Your Arduino Board
  • Then select the Firmata standard. Examples -> Firmata -> Standard Firmata
  • Click “Upload” and upload the code to the board.

Step 3: Connect the sensors to the board and attach them to the glove

Bend sensors are resistive devices that can be used to detect bending or tilting. Below is a diagram of connecting sensors on Arduino. I used bent staples to securely attach the sensors to the glove, but you can use plastic zip ties if you prefer.

Step 4: Connect the HC-05 Bluetooth module to the Arduino

We connect the pins of the bluetooth module and the Arduino board as follows:

  • HC05 Tx - Arduino Rx
  • HC05 Rx - Arduino Tx
  • Vcc - 5V
  • GND - GND

Step 5: Connect the Arduino to the Battery

We use a 9V battery to power the Arduino board with a Bluetooth module. This type of layout allows for easy mounting on a wrist/bracelet. The more compact the better.

Step 6: Pocket Code Program

Below are examples of using the program. First of all, make sure that PHIRO Pro is in Mode 3 (Bluetooth Mode). Press the Mode button on the PHIRO before the blue LED, located next to the display on the top, turns on.

For the program, there are generally 7 modes.

  • The index finger is straightened. The headlights glow red. The program shows STOP.
  • The index and middle fingers are straightened. The headlights glow green. The program shows STOP.
  • The index, middle and ring fingers are straightened. The headlights glow blue. The program shows STOP.
  • The palm is open. PHIRO moves forward. The headlights glow white. The program shows FORWARD.
  • The palm is clenched into a fist. PHIRO stops. Headlights are off. The program shows STOP.
  • The palm is clenched into a fist and tilted to the left (the phone is tilted to the left). PHIRO turns left. The left headlight glows yellow. The program shows LEFT.
  • The palm is clenched into a fist and tilted to the right (the phone is tilted to the right). PHIRO turns right. The right headlight glows yellow. The program shows RIGHT.

Step 7: Carry out final installation

To attach the phone to your hand, you can use an armband or do as I did.

I bought a cheap cover for my cell phone, cut holes and applied Velcro tape. The armband with the phone is ready.

That's all!) Thank you for your attention)

One of the most promising areas in the development of military equipment is the creation of remotely controlled robots designed to solve various tasks. Currently, unmanned aerial vehicles operating on this principle are already actively used. As for ground and surface robotics, these areas have not yet received the same development. The use of remotely controlled equipment in the military has so far had very limited use, which is due to technical difficulties and the need to “integrate” it into the existing structure of the armed forces. However, in the long term, the number of remotely controlled robots may reach a level where it will be necessary to look for new solutions that can facilitate the interaction of a large number of similar equipment.

The widespread use of combat robots may lead to the need to create special information transmission and control systems, similar to combined arms ones. As it became known, work has begun at the St. Petersburg Central Research Institute of Robotics and Technical Cybernetics (CNII RTK) to study the appearance and create a unified control system for combat robotic equipment. Interfax, citing a representative of the Central Research Institute of RTK, reports that the goal of the work is to create systems that allow you to control several robots at once, which will make it possible to carry out various operations with greater convenience. In addition, this approach will make it possible to unify the control panels of various robotic systems.


Naturally, the development of a unified control system will not entail the complete disappearance of “individual” remote controls. All new robots will continue to be equipped with their own remote control equipment. However, according to the idea of ​​the employees of the Central Research Institute of RTI, all new equipment should be able to interact with some common multi-channel control system. Due to this, it is expected that it will be possible to provide greater flexibility in the use of robots, individually and in groups. In other words, under certain circumstances, soldiers of any unit will be able to use several units of robotics, controlling them from a single remote control. Accordingly, the interaction of several operators will be greatly facilitated, because their number will be significantly reduced.

It is worth noting that already at the stage of initial development of the appearance of such a system, certain questions arise. For example, it will be very difficult for one operator to command several robots at once, which can significantly reduce the effectiveness of combat work. In this case, you will need some automatic algorithms that can take on most simple and “routine” tasks, such as moving to a specified point or observing the terrain and searching for targets that are contrasting in the optical or infrared range. We are not talking about artificial intelligence. For now, combat robots will only need appropriate software that can navigate using satellite systems or recognize moving objects. Upon reaching a given route point or upon detecting an object in the entrusted sector, the automation will have to send a signal to the operator, and he, in turn, will determine the next task for the electronics or take control into his own hands.

A similar structure of a “unit” of combat or multi-purpose robots can be used not only in military operations. Centrally controlled robots can carry reconnaissance equipment or weapons. At the same time, they receive a useful advantage: devices controlled from one remote control can be used, among other things, to set up ambushes, or to organize an attack on stationary objects from several sides. However, such capabilities allow the operator or operators of the robot “unit” to perform other tasks. For example, during rescue operations, several robots controlled by one operator can reconnaissance the situation more efficiently than one at a time. Also, several devices with special equipment, under certain circumstances, are capable of quickly and efficiently localizing and extinguishing a fire or performing another similar task.

However, a unified robot control system also has disadvantages. First of all, it is necessary to note the complexity of creating a kind of universal control panel. Despite a number of common features, in most cases, each model of a combat or multi-purpose robot requires a specially designed control system. Thus, ultra-light drones can be controlled by a complex based on a regular computer or laptop, while more serious and large devices are used in conjunction with appropriate equipment. For example, the American wheeled multi-purpose remote-controlled vehicle Crusher has a control panel, which is a kind of cockpit with a steering wheel, pedals and several monitors. Thus, a single control panel should be built according to a modular scheme, and each module in this case will be responsible for the features of a particular class of remotely controlled equipment, depending on the method of movement, weight and purpose.

It is worth recalling that the number of domestic robots that can be used for military or rescue needs is still small. The bulk of such developments are in unmanned aerial vehicles. It is noteworthy that several government and commercial organizations are simultaneously developing this technology. Of course, each of them equips its complex with controls of its own design. The creation of a unified standard management system will help bring order to this industry. In addition, unified control equipment will significantly simplify the training of operators of robotic systems. In other words, the future operator will be able to study the general principles of a unified control system and then additionally master those skills and abilities that are associated with the use of additional modules and a specific robot model. Thus, retraining the operator to use other equipment will be simplified and reduced several times.

And yet, the work of the St. Petersburg Central Research Institute of Robotics and Technical Cybernetics will not have much of a future in the very near future. The fact is that the bulk of the areas of combat and multi-purpose robotics in our country have not yet received proper development. So the domestic unified control system will most likely have to wait for the appearance of a large number of robots. It is worth saying that this trouble has one positive consequence. Since the mass creation of various robotics has not yet begun, the employees of the Central Research Institute of RTK will have time to complete their work on a unified control system and present the finished development before new models of robots appear. Thus, the development of the Central Research Institute of Robotics can become a standard that will be taken into account when developing new robots for the armed forces, law enforcement and rescue structures.

It is too early to talk about the details of the current project: all information about it is limited to only a few reports in the media. At the same time, the Central Research Institute of RTK could only recently receive the corresponding order. However, work in this direction, regardless of the time it began, must be carried out and completed. Despite its complexity, a single robot control panel will be useful for practical use.

Based on materials from sites:
http://interfax.ru/
http://newsru.com/
http://lenta.ru/
http://rtc.ru/

Send your good work in the knowledge base is simple. Use the form below

Students, graduate students, young scientists who use the knowledge base in their studies and work will be very grateful to you.

Posted on http://www.allbest.ru/

Development of a remote control system for an educational robot

Introduction

robotics user program microprocessor

Robotics is one of the most dynamically developing areas today. We see how robots are gradually conquering all spheres of life - manufacturing, medicine, agriculture, etc. In the near future, robots will become an integral part of everyday life. Therefore, specialists with skills in the field of robotics and mechatronics are needed. In turn, to train future specialists, educational robots are required, on which it will be possible to improve their knowledge.

It’s amazing how quickly technology is developing in our time; it seems that the pace of their development is already difficult to follow. Cell phones are one of the striking examples; today every person has them. Moreover, they have become an integral part of our society. There are phones with a minimal set of functions, and there are “advanced” ones with functions comparable to a personal computer.

Cell phones partially replace many devices such as a camera, computer, e-reader, etc. It’s worth thinking “why not control some simple devices using your phone?” It is not suggested to replace the entire device, but only some of the remote controls. This will simplify the control of various devices in a person’s daily life. For example, one phone with Bluetooth function can replace all remote controls for home appliances, which are so often lost.

This current problem will be solved thanks to a similar device developed in this project, the main idea and purpose of which is to create a remote control system for an educational robot via a Bluetooth communication channel.

Bluetooth is the most common communication channel at the moment. It is available on almost all phones and is very easy to use. Bluetooth or bluetooth is a manufacturing specification for wireless personal area networks. Bluetooth ensures the exchange of information between devices such as personal computers, mobile phones, printers, digital cameras, mice, keyboards, joysticks, headphones, headsets. Bluetooth allows these devices to communicate when they are within a radius of up to 200 meters from each other (range varies greatly depending on obstacles and interference), even in different rooms.

The word Bluetooth is translated from Danish as “Blue-toothed”. This nickname was worn by King Harald I, who ruled Denmark and part of Norway in the 10th century and united the warring Danish tribes into a single kingdom. The implication is that Bluetooth does the same with communication protocols, combining them into one universal standard.

In this work, a remote control system for an educational robot is being developed. The educational mobile robot is built on the basis of a radio-controlled car. And remote control is carried out via Bluetooth communication channel. The signal transmission device was a phone with the ability to transmit information via Bluetooth, and the receiver device was a Bluetooth module installed on a board in the machine.

Let's define what a robot is. Robot is an electromechanical, pneumatic, hydraulic device or a combination thereof, designed to carry out production and other operations usually performed by humans (sometimes animals). The use of robots makes it possible to facilitate or even replace human labor.

With the development of robotics, 3 types of robots have emerged:

With a strict action program;

Controlled by a human operator;

With artificial intelligence, acting purposefully without human intervention.

Meanwhile, a robot is not so much a hybrid of a machine and a living creature as an automatic mechanism that performs specific work that is unusual for other types of machines. For example, a crane is a machine for lifting loads to a height, a computer is an electronic computing machine. A computer-controlled crane can already be called a robot.

When we talk about robots, we often wonder how intelligent they are and whether, therefore, they can pose a danger or benefit to humans. An interesting topic, although we should talk here not about robots, but about the computers that control their actions. The robot itself is just a set of actuators. Commands for movement are given to the actuators by a computer, in this case a telephone.

To achieve the project goal, the following tasks were set and solved:

1) Development of a block diagram of a control device. A block diagram of the operation of an educational mobile robot with a remote control system is being developed.

2) Development of a microprocessor control device for DC motors. An electrical circuit diagram is being developed - selection of motors, microcontroller, communication interface. The electrical circuit diagram is calculated and a printed circuit board and assembly drawing are developed.

3) Development of an algorithm and program for the control device;

1 . Development of a block diagram of a control device

System block diagram

Using the software installed on the phone, signals are generated and transmitted to the receiver device, in this case it is a Bluetooth module.

The Bluetooth module, in turn, receives signals and, without processing, transmits them to the main control element - the microcontroller.

Receiving information, the microcontroller processes it and generates control signals for the control driver. And through the control driver, voltage is supplied to the DC motors for their operation.

2 . Development of a microprocessor control device for DC motors

In this section, the development of an electrical circuit diagram is carried out - the choice of motors, microcontroller, communication interface. The electrical circuit diagram is calculated and a printed circuit board and assembly drawing are developed.

Development of an electrical circuit diagram

Engine selection

As the control object in this work, we selected engines installed in a radio-controlled car purchased specifically for the job.

Selecting a microcontroller

The Atmega8 microcontroller from Atmel was chosen as the main element for receiving and processing signals (see Appendix B). The microcontroller has UART ports and 3 timers, which is necessary for this work.

Atmel digital signal processors are widely used because they have an affordable price and a sufficient set of peripherals.

Selecting a microcircuit and communication interface

To control the motors, there was a choice between L298N and L293D drivers. But the choice settled on the L298N driver. It operates over a wider voltage range, and therefore there is no risk of overheating the chip. It is also easily accessible and has a full range of functions necessary to get the job done.

The UART interface is selected as the communication interface with the computer in this project. This interface was not chosen by chance, because a Bluetooth module is used for data transfer, which in turn uses the UART interface. Another advantage is its good data transfer speed - 9600 Kbps.

Calculation of mechanical power.

The weight of the model is 0.7 kg, the maximum speed is 1 m/s with a wheel diameter of 30 mm.

Let's calculate the acceleration:

Torque is calculated as follows:

At the moment of inertia and angular acceleration b =

To calculate the maximum engine power, the engine speed is used, expressed in revolutions per minute:

Engine power is proportional to torque and speed:

Calculation of electrical circuit diagram

Selecting a power control driver.

In this work we use the L298N driver with the following characteristics:

Maximum operating voltage: Upit< Uдрайвера=46 В;

Supply voltage U supply =+5 V, +3.3 V;

Maximum output current (per channel): Ipit< Iдрайвера=2 А:

Calculation of resistors.

The Reset pin of the microcontroller, according to the technical documentation, is recommended to be connected to the power supply through a pull-up resistor with a nominal value of 10 kOhm.

Resistors for connecting the microcontroller and the Bluetooth module are installed based on the technical documentation of the module: operating voltage 3.3 V; when working with a voltage of 5 V, install resistors with a nominal value of 4.7 kOhm.

For stable operation and to avoid burning out the LED, it is necessary that the current flowing in the circuit corresponds to the nominal (10 or 20 milliamps), for this we install a resistor with a resistance of 1 kOhm.

Calculation of capacitors.

To stabilize the voltage coming from the power source, capacitors with a capacity of 30 μF and 100 μF were connected in parallel.

It is already known that the Bluetooth module operates on a voltage of 3.3 V; it turns out that the operating voltage in the 5 V chip will be excessive, which can lead to the module burning out. Therefore, to reduce the voltage it is necessary to connect the L78L33 stabilizer. Based on its technical documentation, 2 capacitors with a capacity of 0.33 μF and 0.1 μF will be required. The connection diagram is shown in the figure.

L78L33 stabilizer connection diagram

PCB design

The development of the device design is carried out on the basis of the developed electrical circuit diagram, taking into account the requirements for maintainability, the requirements of technical aesthetics, taking into account operating conditions and other requirements.

When designing a PCB, the following must be considered.

Unless there are any restrictions, the printed circuit board (PCB) must be square or rectangular. The maximum size of any side should not exceed 520 mm. The thickness of the PP must correspond to one of the numbers in the series: 0.8; 1.0; 1.5; 2.0 depending on the area of ​​the PP.

The centers of the holes should be located at the coordinate grid nodes. Each mounting and via hole must be covered by a contact pad.

The diameter of the mounting holes and the diameters of the microcircuit leads range from 0.8...1.2 mm, and the diameters of the resistor leads range from about 0.66 mm. To simplify the manufacturing process, the mounting holes on the board have a diameter of 0.8 and 1.2 mm. The grid pitch is 1.27 mm.

Solder the elements with POS-61 solder. The board material is fiberglass foil STEF 2-1.5-50 according to GOST 10316-86.

Development of an assembly drawing

When developing an assembly drawing, attention must be paid to the following requirements:

1) the development of an assembly drawing of a DC motor control device is carried out on the basis of the developed circuit diagram, taking into account the requirements for drawing documents;

2) in accordance with the scheme for dividing the product into component parts, assign a designation to the assembly unit and its elements in accordance with GOST 2.201-68;

3) enter the required dimensions in accordance with the requirements of GOST 2.109-73;

4) fill out the specification, meeting all the requirements of GOST 2.108-68;

5) fill out the main inscription and complete other necessary inscriptions (technical requirements, etc.).

3 . Development of an algorithm and program for a control device

In this section, we develop an algorithm for a microprocessor control device for DC motors, as well as develop a control program for a telephone.

Development of an algorithm for a microprocessor control device for DC motors.

Figure 3 shows a diagram of the operating algorithm of the microprocessor control device.

Transmitted byte values:

10:00 - Stop; 01 - Forward; 10 - Back; 11 - Stop.

23:00 - Stop; 01 - Right; 10 - Left; 11 - Stop.

Program development.

Development of a control program for DC motors.

This program is necessary to control DC motors. The microcontroller is controlled by a program from the phone.

DC motor control program using the ATmega8 microcontroller (see Appendix A).

Development of a program for the phone.

To run this program, you must have Windows 98/2000/ME/XP installed on your computer. This program was developed in the Android SDK environment.

The following namespaces are used for work:

import java.io.IOException;

import java.io. OutputStream;

import java.util. List;

import java.util.UUID;

import android.app. Activity;

import android.app. AlertDialog;

import android.app. ProgressDialog;

import android.bluetooth. BluetoothAdapter;

import android.bluetooth. BluetoothDevice;

import android.bluetooth. BluetoothSocket;

import android.content. Context;

import android.content. DialogInterface;

import android.content. Intent;

import android.content. DialogInterface. OnClickListener;

import android.hardware. Sensor;

import android.hardware. SensorEvent;

import android.hardware. SensorEventListener;

import android.hardware. SensorManager;

import android.net. Uri;

import android.os. Bundle;

import android.os. Handler;

import android.os. Message;

import android.view. LayoutInflater;

import android.view. Menu;

import android.view. MenuInflater;

import android.view. MenuItem;

import android.view. MotionEvent;

import android.view. View;

import android.widget. Button;

import android.widget. TextView;

import android.widget. Toast;

Purpose and conditions of use of the program.

The program is designed to generate and transmit signals to a microprocessor device.

To run this program, you must have a device with any version of the Android operating system. This program was developed in the Android SDK environment.

Access to the program

Before starting the program, you must connect power to the microprocessor device and wait for the LED to blink, which means it is ready for work.

To start the program, you must turn on Bluetooth on the device and launch the “BluCar” application. Using the “Connect to a device” button, establish a connection with the Bluetooth module (“linvor”). Once the LED stops blinking, you can begin transferring data.

4. User guide

To check the functionality of the educational mobile robot, you need the following:

Turn on the power to the educational mobile robot using the button shown in the figure.

Power button

Wait for the two LEDs shown in Figure 5 to blink. The first (white) is installed on the circuit, blinking every second, indicating that the circuit has power and is ready for operation. The second LED is located on the Bluetooth module and has 2 operating modes:

Flashing: waiting for connection;

Steady light: indicates connection.

LED working status

Next, turn on Bluetooth on the phone and launch the “BluCar” program presented in Figure 6. In the program, click the “Connect from device” button, and from the provided list select linvor, which is the Bluetooth module. We wait until the LED on the module starts to light constantly, which means a successful connection. The educational mobile robot with a remote control system is ready for work.

Program on the phone “BluCar”

Control methods:

“Forward” button - moving forward;

“Reverse” button - move backwards;

Rotating the phone on a horizontal plane with the right edge down - turning the front wheels to the right;

Rotating the phone on a horizontal plane with the left edge down - turning the front wheels to the left;

To turn off the mobile robot, you need to turn off the power to the circuit and click the “Disconnect from device” button in the program.

Conclusion

As a result of completing a final qualifying bachelor's thesis on the topic: “Development of a remote control system for an educational robot,” a remote control system for an educational robot via a Bluetooth communication channel was produced and created. An educational robot is a machine with two DC motors and a battery. The signal transmission device was a phone with the ability to transmit information via Bluetooth, and the receiver device was a Bluetooth module installed on a board in the machine.

The practical problem considered in the project gives a clear idea of ​​the significance of the presented device. This device will be able to solve very pressing everyday problems, such as controlling all home appliances from your phone and more.

The created remote control system is carried out using a microcontroller. Microcontrollers are much better than their predecessors. They are much smaller in size and have greater productivity, and also significantly speed up the task assigned to them. In this work, a microcontroller is used to process signals that come to it from the phone. It is also responsible for generating signals for the motor driver, which causes the motors to spin directly. The microcontroller is installed in a circuit, which in turn is installed in the machine and connected to the engines.

The above conclusions are drawn from the first (theoretical) part. A block diagram has been created.

The second chapter describes how a microprocessor-based device for remote control of DC motors was developed.

In the third chapter, an algorithm and a phone program for visualizing the control of DC motors was created.

As a result of this work, all set goals and objectives were successfully achieved. In the process of performing the work, skills in developing electrical circuits, their calculations, and layout were consolidated. Also during work, microcontroller programming skills were improved and programming experience was gained in the Android environment.

Bibliography

1. Semenov B.Yu. Power electronics for amateurs and professionals - M.: Solon-R, 2001. -126 p.

2. Lauren Darcy, Shane Conder: Android in 24 hours. Programming applications for the Google operating system. Ed. Reed Group, 2011

3. Kasatkin A.S. Electrical engineering: Textbook. manual for universities. 4th ed. - M.: Energoatomizdat, 1983. -440 p., ill.

4. Evstifeev A.V.: AVR microcontrollers of the Tiny and Mega families from ATMEL. Publishing house "Dodeka-XXI", 2008. - 558 p.

5. Romanycheva E.T. Development and execution of design documentation for radio-electronic equipment. / Directory. M.: Radio and communication, 1989. - 448 p.

6. Sivukhin D.V. General course of physics: T.1. Mechanics: Textbook for physics majors at universities. - M.: Nauka, 1974. - 520 p.

7. Horwitz P., Hill W. The Art of Circuit Design. In 3 volumes. Per. from English - M.: Mir, 1993.

8. Atmel, 8-bit Microcontroller with 16K Bytes In-System Programmable Flash Atmega16 - Datasheet.

9. L298 - Dual Full-Bridge Driver - Datasheet.

10. L78L00 SERIES - Positive voltage regulators - Datasheet.

11. Bluetooth Serial Converter UART Interface 9600bps User's Guide - Datasheet

12. Wikipedia: The free encyclopedia. 2012. URL: http://ru.wikipedia.org. (Date of access: 05/20/2012).

Posted on Allbest.ru

...

Similar documents

    Development of a block diagram of a control device for an educational robot. Selecting a motor, microcontroller, microcircuit, communication interface and stabilizer. Calculation of the electrical circuit diagram. Development of an assembly drawing of the device and program algorithm.

    course work, added 06/24/2013

    Development of a circuit diagram of a microprocessor-based DC motor control device based on the ATmega 128 controller. Development of a package of subroutines in the Assembler language for the purpose of regulating and correct operation of the device.

    course work, added 01/14/2011

    Characteristics of the device and technological data of the industrial robot SM40TS. Description of the U83-K1883 series microprocessor kit, its command system, K572PV4 microcircuit, functional, circuit diagrams and operating algorithm of the control program.

    course work, added 06/02/2010

    Development of a control microprocessor device that implements a specified interaction with the control object, features of hardware and software. System software that ensures the execution of a given control algorithm.

    course work, added 10/25/2009

    Purpose, classification and composition of the access control system. Main characteristics of biometric means of personal identification. User identification by iris. Development of an algorithm for the functioning of the device.

    thesis, added 11/25/2014

    Analysis of existing systems for creating and managing websites, their general characteristics and assessment of functionality at the present stage. Requirements for the server part, means of its development. Interface testing. Creation of a user manual.

    thesis, added 04/11/2012

    Relevance of the task. Development of a functional diagram of the device. Radar installation (RLU). Microprocessor part. Justification of the device operation algorithm. Development of a device control program. Algorithm diagram. Explanations for the program.

    course work, added 10/18/2007

    Analysis of technical specifications. Development of the program interface and its algorithms. Coding and testing of developed software, assessing its practical effectiveness and functionality. Formation and content of the user manual.

    course work, added 07/31/2012

    Modern combat technologies. Robotic means in the military sphere. Design of unmanned aerial vehicles, land and sea robots. Development of a program in Prolog to perform the task of demining a military robot deminer.

    course work, added 12/20/2015

    Designing a microprocessor device that converts the RS-232 interface (COM port) to IEEE 1284 (LPT port). Block diagram of the device. Converting a serial interface to a parallel interface on an ATMega 8 microcontroller.

Hello, Habrakhabr! I sat on the evening of June 11, watching a film. Unexpectedly for myself, I discovered that a woman I had never known before had written to me with an offer to make a robot for their new quest. The bottom line is that you need to solve puzzles, explore hiding places, correctly apply hints, use available things and ultimately get keys and open doors... I was required to make a robot controlled from a computer using a separate program. I had doubts about some problems, for example: will I have time and how exactly to do wireless data transfer (I had previously only done wireless data transfer on the NXT)? After weighing the pros and cons, I agreed. After that, I began to think about data transfer. Since it was necessary to make a robot quickly, there was no time to remember and further master, for example, Delphi, so the idea arose to make a module that would send commands. The computer is simply required to send data to the COM port. This method is strange, but the fastest. This is what I want to describe here. I will also attach 3 programs that will help you make a radio-controlled car.
Transmitter assembly and its program.
I made a module for a computer from FTDI Basic Breakout 5/3.3V from DFrobot, a fairly common ATMEGA 328P-PU microcontroller with an Arduino bootloader and a radio module based on the nRF24L01 chip. Essentially it's just an Arduino Uno with a radio module. It is what it is. The radio module has a feature that I did not immediately notice: the input voltage should be in the range from 3 to 3.6 volts (although applying 5 volts to it will not kill it, but will not work), the upper limit of the logical unit is 5V. This means that to connect the radio module to the mega you do not need a level converter between 3.3V and 5V, but you need to install a 3.3V stabilizer. FTDI has a built-in stabilizer, and I powered the radio module from it.

This is what the module itself looks like (inside and in the assembly):

The program consists of initialization, start message and processing of commands from the control program. This was the case in my case. Basic commands of the Mirf library:

#include
#include
#include
#include
#include
These libraries are needed for the radio module to work

Mirf.csnPin = 4 - sets the pin number responsible for “permission to communicate” between the radio module and the MK
Mirf.cePin = 6 - sets the pin number responsible for the operating mode of the radio module (receiver/transmitter)
Mirf.spi = &MirfHardwareSpi - configures the SPI line
Mirf.init() - initializes the radio module
Mirf.payload = 1 - size in bytes of one message (default 16, maximum 32)
Mirf.channel = 19 - sets the channel (0 - 127, default 0)
Mirf.config() - sets transfer parameters


Mirf.setTADDR((byte *)"serv1") - switches the radio module to transmitter mode
Mirf.setRADDR((byte *)“serv1”) - switches the radio module to receiver mode

Mirf.send(data) - sends a byte array
Mirf.dataReady() - reports the completion of processing of received data
Mirf.getData(data) - write received data to the data array

I am attaching the code for the transmitter program.

Transmitter program

#include
#include
#include
#include
#include

Char active;
byte data;

Void setup()
{
Serial.begin(19200);

Mirf.csnPin = 4;
Mirf.cePin = 6;

Mirf.init();
Mirf.payload = 1;
Mirf.channel = 19;
Mirf.config();

Mirf.setTADDR((byte *)"serv1");

//signal message about the start of work
data=7;
Mirf.send(data);
delay(200);
}

void loop()
{
if (Serial.available()) //If the data is ready to be read
{
active=Serial.read(); // Write data to a variable
}

If (active=="2")
{
data=2;
}

If (active=="3")
{
data=3;
}

If (active=="4")
{
data=4;
}

If (active=="5")
{
data=5;
}

If (active=="6")
{
data=6;
}

Mirf.send(data); //Send data
while(Mirf.isSending()); // Wait until the data is sent
}

Management program.

There is one interesting thing - Processing. The syntax is the same as in Arduino, only instead of void loop() there is void draw(). But it became even more interesting in my situation with the processing Serial library, which allows you to work with a serial port. After reading the tutorials on Spurkfun's website, I played around with blinking the LED on the Arduino connected to the computer at the click of a mouse. After that, I wrote a program to control the robot from the keyboard. I am attaching the arrow control code. In principle, there is nothing unusual in it.

Machine control program

import processing.serial.*;
import cc.arduino.*;

Serial myPort;
PFont f=createFont("LetterGothicStd-32.vlw", 24);

Void setup()
{
size(360, 160);
stroke(255);
background(0);
textFont(f);

String portName = "XXXX"; // Here you need to write the name of your port
myPort = new Serial(this, portName, 19200);
}

Void draw() (
if (keyPressed == false)
{
clear();
myPort.write("6");
println("6");
}
}

Void keyPressed()
{
// 10 - enter
// 32 - space
// 37/38/39/40 - keys
clear();

Fill(255);
textAlign(CENTER);
//text(keyCode, 180, 80);

Switch(keyCode)
{
case 37:
text("Edem vlevo", 180, 80);
myPort.write("1");
break;

Case 38:
text("Edem pryamo", 180, 80);
myPort.write("2");
break;

Case 39:
text("Edem vpravo", 180, 80);
myPort.write("3");
break;

Case 40:
text("Edem nazad", 180, 80);
myPort.write("4");
break;

Default:
text("Takoy kommandi net", 180, 80);
myPort.write("6");
break;
}
}

Receiver program.

The initialization of this program differs from the initialization of the transmitter program in just one line. The key command in the endless loop is Mirf.getData(data). Next, the received command is compared with the numbers that correspond to any actions of the robot. Well, then the robot acts exactly according to commands. I am attaching the program code for the machine's receiver.

Machine programs

#include
#include
#include
#include
#include

Void setup()
{
Serial.begin(9600);

PinMode(13, OUTPUT); //LED

Mirf.csnPin = 10;
Mirf.cePin = 9;
Mirf.spi =
Mirf.init();
Mirf.payload = 1;
Mirf.channel = 19;
Mirf.config();
Mirf.setRADDR((byte *)"serv1");
}

void loop()
{
byte data;

If(!Mirf.isSending() && Mirf.dataReady())
{
Mirf.getData(data);
Serial.println(data);
}

Switch (data)
{
case 1:
motors(-100, 100); // turn left
break;

Case 2:
motors(100, 100); // go straight
break;

Case 3:
motors(100, -100); // turn right
break;

Case 4:
motors(-100, -100); // going back
break;

Default:
motors(0, 0); // we're standing
break;
}

Delay(50);
}

Conclusion.

What came out of all this:

I made this robot for Claustrophobia. They conduct quests in reality in different cities, and just for one of these quests, the organizers needed a radio-controlled robot sapper. I like it. This, of course, is flawed, because... against the backdrop of control using the communication tools built into the laptop, but it was done in its own way, done very quickly and without any problems. I hope this article will help you do something similar, and maybe even more difficult. Here, whoever wants what.

Tags: Add tags

Remote Control, ver. 0.1.1

(control the robot remotely via Wi-Fi from a tablet in manual mode)

multi-purpose program for the OpenComputers mod

The program allows you to gain full control over the robot, perform many actions remotely, and at the same time see the robot itself and its parameters.

For example, you can use a robot to get into hard-to-reach places, unload uranium from a reactor without receiving radiation, build a simple structure where you yourself cannot yet reach, or vice versa, bring something. The robot is under your complete control.

A funny application of the program is to attack players. Robots, based on config settings, can perform actions related to the use of objects, turning on and off buttons, levers and mechanisms and tools in someone else's private, although they do not destroy the private. You can carry out an attack and demolish all the player’s desalination plants, diesel generators and windmills, even if he is not in the game and has not hidden everything from the roof, or has not posted a guard and does not sense attackers.

You can screw the reactor chamber to the victim’s wall, push a 4-uranium rod there, turn on the redstone on the robot and blow up the wall in several blocks, if the careless player-victim has sealed the house tightly along the edge of the wall, as players usually do =).

The IT reactor in the settings destroys blocks within a radius of 2-4 blocks. There is a chance that you will sneak into the victim’s house, while you are in cover and cannot be seen in any way.

Program code (latest):

TABLET:(pastebin get b8nz3PrH tabletRC.lua)

ROBOT:(pastebin get 7V2fvm7L robotRC.lua)

Old versions (old):

Requirements for the configuration of the robot and tablet ( took a linked map as a basis, it is required, an inventory controller is also required in the robot, the rest is optional. You can throw out the signs and stuff the bucket controller, add a little stitching and remove liquids and so on. CL is not yet used in the program. For the fingerboard, a red plate, a magnet, and large equipment are highly desirable):

Tablet (take a hard drive with OS installed):

Robot (you can abandon the CL for now and push in a controller-board expander. You can then push in a WF card or INET card to the robot on the fly if necessary):