KON-C3003 - Mekatroniikan harjoitustyö, Luento-opetus, 10.1.2023-13.4.2023
This course space end date is set to 13.04.2023 Search Courses: KON-C3003
Servo test bench
Demonstration and test device for three different size RC-servos
5. Project documentation
Servo test bench
Project documentation
Contents
Introduction
The device
General design
Electronics
Electrical system and wiring
Microcontroller
Servos
Sensors
Mechanical design
Assembly
User interface
The program
Project analysis
Arrangement
Limitations of the design
Encountered problems
Possible future development
Appendix
3D-models
Program files
Parts list
1. Introduction
The servo test bench is a device that demonstrates the capabilities and features of different hobby-grade servos. The main goal is to provide a first impression of servos to people who have never seen one before and give some perspective into the strengths, weaknesses, and overall capabilities of servos. The servos used are typical for school projects as the goal is also to visualize the movement of the servos and act as an example of a possible project.
2. The device
2.1 General design
The device features seven different hobby-grade servos – five operational ones and two with a visible cross section. The servo cross sections provide a view of the internal components commonly found in servos. For the sake of contrast, one cross section features a digital metal-geared servo, the other an analog plastic-geared one. Three of the functioning servos, a micro, standard, and large servo, are mounted adjacent to load cells for torque measurement and optical switches for determining the angular velocity. The other two, a servo with external feedback and a continuously rotating servo, are not mounted alongside any sensors, because they demonstrate their specific features.
To enhance the learning experience, the device has a simple interactive user interface that displays information about the active servo and allows the user to control certain features, like selecting between servos and operating modes, and turning servos manually.
2.2 Electronics
2.2.1 Electrical system and wiring
The main power source for the device will be an AC/DC-converter with an output of 12 volts. The converter will supply power to the controller and the accompanying servo shield. The controller accepts an input voltage of 7-12 V, but the shield requires 5-6 V, therefore additional voltage regulation is necessary. To drop the voltage down from 12 to 5-6 volts, a DC/DC switch-mode converter is used. When designing a power distribution system, it is vital to ensure correct polarity.
To facilitate maintenance and keep the numerous wires in order, the wires of the components on the lid of the device are grouped into headers: LEDs in one, load cells in another, and the rest in a third.
The following wiring diagram describes where each header pin should be connected:
A note on the markings: the capital letters A and D signify Arduino analog and digital pins respectively, and the capital letter S signifies the servo connection points on the Adafruit servo shield. All the servo connection points include three pins: a signal output (PWM), operating voltage (+), and ground (GND). As can be seen from the schematic, some pins are connected together, so that only one wire is needed to connect them to, for example, ground.
When connecting the 34-pin header to the board, please make sure that the red marker is facing away from the Arduino. The LED header (pins L1-L6) should be connected so that the blue wire of the header is on the same side as the blue wire of the board.
The next schematic describes the overall wiring (excluding headers):
2.2.2 Microcontroller
The central processor of the servo test bench is an Arduino Uno. This is coupled with a servo shield that enables controlling servos using the I2C bus, thus liberating standard I/O pins for other uses. Another function of the servo shield is to provide power to the servos; the Arduino itself cannot provide enough current through its 5 V pin to operate the servos and all the other peripherals simultaneously.
2.2.3 Servos
The functional servos used in the device:
Make/model | Size category | Mass (g) | Torque (kg.cm) | Operating speed (s/60°) | Operating voltage (V) | Additional information |
Turnigy TG9e | Micro | 9 | 1,5 | 0,12 | 4,8-6 | Plastic gears, analog |
Towerpro MG996R | Standard | 55 | 9,4-11 | 0,20-0,16 | 4,8-6 | Metal gears, digital |
Turnigy S8166M | Large | 154 | 33 | 0,21 | 4,8-6 | Metal gears |
Datan B2122 | Micro | 15,81 | 1,8 | 0,1 | 4,8-6 | Analog feedback |
Fitec FS90R | Micro | 9 | 1,3-1,5 | 100-130 RPM | 4,8-6 | Continuous rotation |
Where the torque or speed is indicated as a range, the minimum value is achieved with the lowest operating voltage and maximum with the highest.
The cross sectioned servos:
Make/model | Size category | Mass (g) | Max. torque (kg.cm) | Operating speed (per 60°) | Operating voltage | Additional information |
H-king HK 15298 | Standard | 66,4 | 8 | 0,12 | 4,8-7,4 | Brass gears, digital |
GWServo S03TXF | Standard | 46 | 5 | 0,21 | 4,8-6 | Plastic gears, analog |
2.2.4 Sensors
The array of sensors consists of three load cells capable of measuring forces up to 98 N (the weight of a 10 kg object) and three optical switches for measuring the angular velocity. An optical switch has an emitter that sends a beam of light to the receiver lens, and whenever something breaks the beam, the electrical output signal of the switch will change. This can be used to determine the angular velocity of the servos: the three servos have plates the shape of circular sectors attached to their arms. The plates have two narrow holes in them, one near the first edge of the sector and another near the next edge (see image below). When the servo turns, the optical switch will detect when each holes passes through the beam, and by measuring the time between detecting the holes, we can determine the angular velocity of the servo.
The angular velocities are displayed in time taken for a 60-degree turn (s/60 deg) and the torque is displayed in kg cm (1 kg mass at 1 cm distance, analogous to Nm).
2.3 Mechanical design
2.3.1 Assembly
Servos with a cross section view were created by disassembling servos and grinding the housings with a belt sander.
The board for load cell amplifiers and general ground/current rails. Pins and resistors were soldered into place and amplifiers were fastened with bolts and nuts.
Connectors for wiring before and after assembly. To achieve easier assembly and disassembly, pin connectors were used.
Button inserts were 3D-printed. The power cord is recycled, as well as the main power switch.
The panels for the box were laser cut from 10mm thick acrylic sheet. The sheet was twice as thick as the maximum cutting thickness of the machine, but the cutting was still successful except for some minor bending of the cuts.
Due to errors with drilling holes at wrong locations, some of the holes had to be filled with plastic screws. The screws were inserted to the holes, then cut to length and new holes drilled and tapped right next to the old ones.
The beam for load cells was milled to the right shape.
2.4 User interface
The user interface consists of three buttons, a three-position switch, a potentiometer, five LEDs, and a liquid crystal display. The switch is used for choosing between the three main operating modes: torque measurement, speed test, and info display. The potentiometer is used for controlling the servos. If one of the normal servos (large, standard, or small) is chosen, the potentiometer only works in torque measurement mode. If one of the special servos (continuously rotating or feedback servo) is chosen, the potentiometer works while not in info display mode. The three buttons are used for switching between servos and zeroing the force sensors. The selected servo is indicated by turning on the corresponding LED. During operation of the device, various information will be displayed on the LCD. For example, in force measurement mode, the current reading will be shown. When the feedback servo is chosen (while not in info display mode), the screen will display the current setpoint (the target position of the servo) and the value from the servo’s internal potentiometer (essentially the actual position of the servo). Each button and switch has a label next to it describing its main purpose shortly.
2.5 The program
The program is divided into modules to facilitate editing and improve readability. Most of the function declarations and descriptions are in separate source files. The program incorporates the following pre-made libraries: Adafruit PWM Servo Driver, HX711, and LiquidCrystal I2C.
The main loop consists of two main phases: first phase checks whether the user has queued a change of servo or operation mode, and switches the current operation mode to match. This information will be necessary in the second phase, where the program calls a specific function based on the operation mode. For example, if the user has selected the standard rc servo and torque measurement, the program will receive user input through the potentiometer and display the value produced by the corresponding load cell. There are a total of five different operation modes, two of which (torque measurement and speed test) are only usable with the normal rc servos. The third mode is the info display mode and the two remaining ones are reserved for the continuously rotating servo and the servo with external feedback. In their respective modes, the latter servos will receive user input.
The program defines endpoints to the range of motion of each servo. This prevents the servos from causing unwanted collisions and damage. In addition, whenever the user switches between servos, the current servo will move back to a safe position before the next servo is activated.
The program files are presented in their entirety in section 4.2.
3. Project analysis
3.1 Arrangement
The project was assigned to develop teaching methods in mechatronics. The team working with the project consisted of three research assistants from Aalto university, which was also responsible for the funding.
3.2 Limitations of the design
To fit to its purpose, the device had to be compact so it could be easily transported and stored. The weight had to be limited so the device could be handheld. Another requirement was that the visualisation of the device had to be clear and as much of the construction visible as possible. For the sake of simplicity and ease of use, the test bench is a standalone unit with no customizable features or connections.
3.3 Encountered problems
-Number of pins in Arduino uno (barely enough)
-Wiring differences between load cells and amplifiers
-connectors to optical switches are small and difficult to assemble properly
-servo behaviour with low voltages
-laser cutting materials exceeding the maximum thickness produces skewed cuts
-correct positioning for the photosensors
-The LCD flickers and doesn't show the entire text when the servo bench starts up. Switching to another view and back stops the behaviour.
-the teeth of small servo’s shaft broke when testing
3.4 Possible future development
Possibilities in developing the device can be divided to two aspects, adding more functions in device itself and building more similar devices for demonstrating sensors and actuators. It is also possible to add some IoT in form of ways of communication for example to students mobile devices.
4. Appendix
4.1 3D-models
4.2 Program files
4.3 Parts list
No. | Part | Qty. |
1 | Arduino Uno | 1 |
2 | Adafruit 1411 Servo Shield | 1 |
3 | Turnigy TG9e Servo | 1 |
4 | Towerpro MG996R Servo | 1 |
5 | Turnigy S8166M Servo | 1 |
6 | Datan B2122 Servo | 1 |
7 | Fitec FS90R Servo | 1 |
8 | H-king HK 15298 Servo | 1 |
9 | GWServo S03TXF Servo | 1 |
10 | DFRobot DFR0063 LCD Display | 1 |
11 | Sparkfun SEN-13879 Amplifier | 3 |
12 | Sparkfun SEN-13329 Load Cell | 3 |
13 | Omron EE-SX3162-P2 Optical Switch | 3 |
14 | Resistor, 220 Ω | 1 |
15 | Resistor, 12 kΩ | 2 |
16 | LED, red | 5 |
17 | Switch, button (Normally open) | 3 |
18 | Switch, toggle | 1 |
19 | Potentiometer | 1 |
20 | Mean Well LRS-50-12 Power Supply | 1 |
21 | GE NSR003A0X4Z DC-DC Converter | 1 |
22 | Wires and connectors | - |