📜 ⬆️ ⬇️

Once plywood, atmega, yes raspberry

Introduction


I am engaged in the design and development of layouts for the development of mathematical software. Layouts are mobile platforms (carts) of various configurations. As a rule, carts perform one single function — they carry the target equipment (scanning distance meter, video camera, laptop with a control system, etc.). All carts have a complete solution and are made of metal or plastic and have on board a lower level control system responsible for controlling engines and collecting various information from sensors.


There are a number of significant problems with ready carts:

  1. It is difficult to install the necessary equipment to perform the target task. Often, in the process of work, the range of equipment used and its location may change. Drilling, sawing and modifying the metal body is a very laborious process. Scotch ordinary and double sided - “our everything”, with all the ensuing consequences.
  2. Each trolley has its own control system that binds the developer to the hardware and control system and occupies a significant part of the programmer's precious time.
  3. The high cost of trucks and their components. The inability to quickly purchase ready-made solutions and spare parts.

All this prompted a completely natural idea that we need a universal and not very expensive platform from components, as they say, from a nearby store, with the possibility of painless installation of arbitrary equipment with a simple and unified management interface. The cart should be easy to manufacture and easy to assemble. As a rule, there are no strict requirements for the layout, which is why it is a layout.

Concept.


As a result of brainstorming, the concept of a future platform was born:
')
  1. Wheel formula 6 wheels, all leading. To simplify the design active suspension is not required. In this case, all the engines of the board are connected in parallel, which will allow in the future to make trucks with fewer wheels using a single control system.
  2. The trolley case is made of light material in processing, allowing relatively quickly to install the necessary equipment and carry out communications.
  3. Trolley control via UART or USB (virtual comport) - you can connect a laptop, single board computer, radio module.
  4. Gearboxes, wheels, electronics, batteries from the nearest suitable store.


Separately, I would like to mention a ready platform from POLOLU Dagu Wild Thumper All-Terrain Chassis .

Under our concept, this platform could not be better, even the presence of a metal case was compensated by a large number of mounting holes, the installation of the equipment did not cause any problems. But upon closer acquaintance, there were significant design flaws. The main and key point is the articulation of the wheel and the motor-reducer, which does not hold water.



The main load falls on the sliding bearing in which the output shaft of the motor-reducer rotates and with prolonged use and intense loads this node is guaranteed to fail.



The second point is the shaft-wheel adapter, this element is made of brass and sits on the shaft with a large backlash, not rarely during tests, one of the wheels flew off the shaft during movement.

As a summary, I want to say that as a platform for solving our problems, Dagu Wild Thumper is not suitable.

But as they say, every cloud has a silver lining. The gearmotors and the wheels of this carriage are quite suitable as components, it is only necessary to design and manufacture a reliable bearing block with an axle, which will take over the entire load.

Platform.


Motor wheel.

The bearing block was manufactured on the production base of the institute.



Two bearings are pressed into the block housing, an axis with an annular retainer, an adapter motor-reducer.









The wheel and gear motor from the parent carriage Dagu Wild Thumper.

The block turned out to be a very reliable unit capable of withstanding serious loads. The only thing and probably very significant but: the production of this site requires a CNC milling machine and a qualified specialist. In the photos, the motor has an incremental encoder on the shaft.

Housing

The optimal material for the body, after some hesitation, was (surprise, surprise) plywood. The drawing, abundantly equipped with stiffening ribs, after some time acquired a material appearance.





With the availability of laser cutting of sheet materials, the manufacture of a whole batch of such cases was not difficult and costly. Drilling, sawing, screwing a variety of equipment and other modifications of this case (long live PVA glue and screws screws) do not pose any difficulties.

Platform assembly.



The body is painted with spray paint. Medium-sized engines include incremental encoders to count the number of revolutions. Motor connectors are standard for radio-controlled models.

Lower level control system.


The control system has the same requirements as a trolley: the availability of components and ease of manufacture. Ready solutions for managing collector motors weight. The same POLOLU has many suitable options, but there is an important point - you need one “USB cord” for the whole system.

I have been friends with ATMEL controllers and assembler for a long time, making a small PCB is not a problem either. To simplify the design and manufacture of the board, I use ready-made microprocessor modules. As the module was used ARDUINO Nano Atmega328. The module is small and on its board, in addition to the processor, there is an FT232RL chip, which provides USB communication, the so-called virtual com port. All that connected him with his former life was erased from the insides (may arduinschiki forgive me) and a printed circuit board was made with the necessary strapping and a new firmware was flooded.



The scheme includes:

  1. ARDUINO Mini Atmega328 microprocessor module with USB interface.
  2. Two N-bridges on power transistors with PWM control.
  3. Current sensor and voltage sensor for monitoring the discharge of Li-Po batteries.
  4. LEDs for indicating the operating modes of the system.
  5. Connectors for external power supply and motors.
  6. Connectors for incremental encoder engines.
  7. Connectors for connecting analog sensors connected to the inputs of the ADC controller.
  8. UART interface connector.

The firmware is written in assembler and is a command processor, i.e., a text command comes along with UART (USB) with parameters, the controller processes and executes it (for example: to give the starboard engines 25% of the nominal voltage), in the opposite direction sends encoder values, battery voltage, ADC readings, etc.

As a result, we have a UART (USB) trolley control channel through which text control commands are sent and we get response lines, including telemetry and service data. A wide range of devices fits in with this interface, ranging from radio modems (X-Bee) to tablet computers. I will not dwell on the control system in more detail, since this is the topic of a separate article. But about one of the devices connected via UART as a top-level control system, I will discuss further.

Raspberry, it is the top level control system.


Of course we are talking about the Raspberry Pi. Affordable, inexpensive, compact, Linux is the same. On board there is everything, and what is not connected via USB.

Trolley control algorithms can be programmed directly on the trolley itself using a modern graphical interface. Just plug in the monitor and keyboard. Fiddler computer is not needed! In this case, it is possible to program a lower level controller from a raspberry; it is enough to connect a programmer, appropriate compilers and the development environment available.

We join raspberry and arduin.

On the GPIO connector of the raspberry there is a UART, I2C, SPI, + 5V power supply and just feet.



We connect our Arduino low-level control system to the rapberry pin UART. The only thing is: raspberry 3.3 volts, and the microcontroller provides 5 volts logic, without an adapter with the coordination of logical levels is not enough. And if it is necessary to fence a certain adapter fee, that is, it makes sense to use other GPIO pins.
To leave the i2c bus free at the height of waste, when in nature there is a huge number of sensors with a connection on this bus. As a result, a wonderful device with a gyroscope and an accelerometer, a full-fledged navigation module, is installed on the adapter board. The power supply of the raspberry is carried out through the Micro USB connector, which is not very convenient, since the connector itself is hlipkovat and is not always at hand, as a result, an external power supply connector + 5V is connected to the adapter.





The adapter card is designed so that everything fits into the plastic case, and the pins UART and power supply + 5V are brought out



Separately, I want to mention the power of raspberries, it is strictly limited to 5 volts coming from the USB connector, the decision is controversial, but nothing can be done. For this purpose, I use the BEC stabilizer used in amateur radio models, it has a small size, power (3A) is enough with a large margin and fully meets our requirements.



Full body kit.




  1. Lower level control system based on Atmega328 controller.
  2. Geared motors with incremental encoders (left and right side)
  3. IR distance sensors SHARP GP2Y0A02YK0F with analog output
  4. Li-Po battery 7.4V
  5. Power supply 5V.
  6. Top-level management system based on Raspberry Pi
  7. UART adapter and i2c navigation module in the Raspberry Pi.
  8. USB Wi-Fi module.
  9. USB WEB camera.


The story of what comes freedom for creativity with a Wi-Fi cart with Linux on board and a bunch of all sorts of buns is clearly beyond the scope of this article. With this part, I think everything is clear.

Result.




In conclusion, I want to say that the task was solved. We have a cart with a body that is “not sorry” from inexpensive components. The only exception is the bearing unit, but this is the price for reliability and capacity, the cart can carry very heavy equipment. The control system of the lower level is easily scaled by the number of engines and the range of connected sensors, as well as integrates easily with the high-level system: Raspberry Pi (UART) or laptop (USB). Raspberry Pi can do everything as a top-level control system allows you to connect a whole bunch of useful equipment and really can work with this equipment, a C compiler and a graphical gourmet shell included.

Source: https://habr.com/ru/post/175889/


All Articles