Developing hexapod from scratch (part 5) - electronics
Hello! The development of the hexapod is nearing completion of the first combat version, and now it is time to describe all of its electronic filling. I also added HC-SR04 to detect the obstacles that were so lacking for visual satisfaction in the appearance of the hexapod. There will be a little new video and you have a chance to kick me electronically.
Development stages:
Part 1 - design
Part 2 - assembly
Part 3 - kinematics
Part 4 - mathematics of trajectories and sequences
Part 5 - electronics
View with installed HC-SR04
Initially, the case was designed for separate power and control boards, so that one is placed in the center of the case closer to the battery, and the second is brought up for ease of debugging. And so let's get started.
Control block
The control unit is the “brain” of the hexapod based on the SAM3X8E controller and consists of two boards: a board with a controller and a distribution board. The board with the controller is already used (the picture below), but the distribution board will have to be manufactured. Perhaps in the future I will order a board at the factory with a place for the controller to remove the sandwich.
The main purpose of the distribution board is to power the “light” peripheral devices, the controller and distribute the signals among its pins. I have compiled a list of my requirements for this board:
- Ability to install on the board HLK-RM04 (UART-WIFI converter);
- Ability to connect I2C display;
- Ability to connect HC-SR04;
- Ability to measure battery voltage = board supply voltage;
- Ability to measure peripheral supply voltage and HLK-RM04;
- Connect tweeter to indicate battery discharge;
- LED indication of the system status: something important fell off (the configuration is incorrect or something else), something unimportant fell off (display for example), everything is OK;
Having decided a little on the elemental base and appreciating the possibilities of my nest egg with loose powder, I started immediately wiring the board without creating its circuit diagram. It worked the first time and I did not find any jambs in the work. The wiring is as follows:
He specially made the tracks wide so that there were no problems in the manufacturing process. I decided to make a board with LUT, it turned out well with only 2 times. Under the spoiler of the photo to compare the unsuccessful and successful options (on the left unsuccessful, on the right successful).
Photos
Well, then everything is according to the instructions - we trick the board, drill holes and throw components. The result was not long in coming:
HLK-RM04 is inserted in the center, a loop to the power board is inserted into the comb on the right, power is supplied to the left. The voltage on the board is measured by a simple voltage divider. During long-term operation (30–40 minutes), the voltage regulator for HLK-RM04 heats up significantly and I just put in a radiator.
HLK-RM04
Power board
The total current consumption (peak) of the drives is approximately 30A (on average ~ 1.3A per drive) under heavy load, when walking 10-13A, at rest - 5-6A. The measurements were carried out empirically with a multimeter.
I decided to make the power separate for each drive based on linear voltage regulators, i.e. 18 linear voltage regulators - one for each drive. As linear regulators are used LM317D2T-TR configured to output 5V. There are several reasons for using 18 linear voltage regulators and using regulators in principle:
- You cannot directly connect the drives to the battery, for them the maximum permissible supply voltage is 6V;
- Relative independence of speed \ efforts of drives from input voltage;
- Linear regulators are piled up. I once bought them a 70pcs package on Ali (the item made the largest contribution to the solution);
- I did not find a linear voltage regulator for such a current;
- I did not find a compact and lightweight DC-DC circuit for such a current;
- The option of connecting regulators in parallel is rather dubious;
- The option “linear regulator + amplifying transistor” deprives the power circuit of all the protective functions that the linear regulator provides (at least people write this, and in this case I agree with them);
- I am pretty poor at designing switching power supplies;
The board is very simple and I did not begin to draw a circuit diagram for it, and the desire to quickly see the result also made itself felt. The wiring is as follows:
Above there are contact pads for soldering wires for the battery, from the bottom a comb for a cable and power to the control unit, and drives are connected on the sides. Initially, I also wanted to make it possible to measure the amount of current consumed by each servo drive and measure the temperature of the board, but decided not to complicate it yet.
The board was simple and reliable, there is nothing to break. Conducted load tests at an input voltage of 11.1V (3S LiPo) and 7.4V (2S LiPo). At an input voltage of 11.1V, as expected, the controllers were too hot and the temperature protection was triggered while walking (the radiator did not save, and the SMD controllers, too), which forced me to lower the input voltage. At a voltage of 7.4V, the regulators are warm and with prolonged walking, the protection does not work anymore - that's what you need.
The board also made LUT and it turned out pretty well the first time. Unfortunately, there is only a photograph of the experimental version of the board, and I didn’t really want to take out the new one for about 4 hours somewhere and didn’t want to disassemble it for the sake of photography (about 70% of the case needs to be disassembled). The difference between the old and the new is only in the absence of holes in the center line of the board (funny experiments were conducted).
Some video
Performance Testing HC-SR04
My cat's attitude towards hexapod
The first street walk