Contenus de la page
The idea
The idea came from the tennis ball thrower we have at EirLab and we use in events to host fun games using it. We wanted do create a ping pong size version and add a couple twists to it to make it more interesting. There already was a projet like this last year so we wanted to improve on that. The three ways of improvement were portability, power and throwing effects.
The motors

The project idea includes the use of three rotary motors angled at 120 degrees in order to add an effect to the ball when launched. The way the group sought to achieve this was by controlling the motors’ speed proportionally through three potentiometers: one controlling the shot power, another controlling the effect on the horizontal axis, and another to control the effect on the vertical axis. This is possible through the regulation of the respective speed of each motor, as will be explained later in the code section.
The electronics

To control the motors we made a little bord that hosts an ESP32, three potentiometres and three outputs for the drivers. The potentiometres are the interface to control the launcher, currently they are mapped from right to left to the general speed of the motors, the left-right speed differential to input latteral effect on the ball and the last one is to induce a lift or a top spin by creating a top-bottom speed differential.
The drivers are generic brushless motor drivers that are controlled with the period of the output PWM.
The code
This is divided in two parts : the initialization and the control. The first part replicate the startup sequence needed to setup the drivers. The second defines the interface described earlier and sends the command to the drivers that control the motors.
#include <Arduino.h>
#include <ESP32Servo.h> // Installez la bibliotheque Servo de Michael Margolis 1.2.0
// ( allez dans arduino IDE -> tools -> manage Libraries )
const int pwm_pin = 14;
const int pwm_pin2 = 26;
const int pwm_pin3 = 25;
const int POT_PIN1 = 12;
const int POT_PIN2 = 33;
const int POT_PIN3 = 39;
const int PWM_MIN = 1000; // 1000 us => vitesse max dans le sens anti-horaire
const int PWM_MAX = 2000; // 2000 us => vitesse max dans le sens horaire
const int PWM_STOP = PWM_MIN; // milieu => STOP : vitesse nulle.
Servo esc1;
Servo esc2;
Servo esc3;
int value;
void setup() {
Serial.begin(115200);
Serial.println("Initialisation des ESC...");
esc1.attach(pwm_pin);
esc2.attach(pwm_pin2);
esc3.attach(pwm_pin3);
delay(1000);
esc1.writeMicroseconds(PWM_STOP);
esc2.writeMicroseconds(PWM_STOP);
esc3.writeMicroseconds(PWM_STOP);
delay(100);
esc1.writeMicroseconds(PWM_MAX);
esc2.writeMicroseconds(PWM_MAX);
esc3.writeMicroseconds(PWM_MAX);
delay(100);
esc1.writeMicroseconds(PWM_STOP);
esc2.writeMicroseconds(PWM_STOP);
esc3.writeMicroseconds(PWM_STOP);
delay(3000);
pinMode(POT_PIN1, INPUT);
pinMode(POT_PIN2, INPUT);
pinMode(POT_PIN3, INPUT);
}
void loop() {
int a = analogRead(POT_PIN1);
int b = analogRead(POT_PIN2);
int c = analogRead(POT_PIN3);
value = map(a, 0, 4095, PWM_MIN + 40, 1500);
int x = map(b, 0, 4095, -100, 100);
int y = map(c, 0, 4095, -100, 100);
if(value < PWM_MIN + 50) {
esc1.writeMicroseconds(PWM_MIN);
esc2.writeMicroseconds(PWM_MIN);
esc3.writeMicroseconds(PWM_MIN);
}
else{
esc1.writeMicroseconds(value-x-y);
esc2.writeMicroseconds(value+x-y);
esc3.writeMicroseconds(value+y);
}
delay(80);
}
Modelling

The project was entirely designed in 3d using Onshape. It allowed us to collaborate easily on the design. Knowing what machines we have at the fablab we decided to make most parts doable on the laser cutter and the more challenging parts are done using a 3d printer. Eventually all parts except for the main chassis part can be printed using a 3d printer but we decided to cut some of them in metal sheets using the waterjet cutter for added strength.
An important part of the project was the optimization of the space used. Due to the mechanical trigger device, it was necessary to enlarge the size of the outer casing to avoid any interference. Another determining factor was the design decision regarding the removable battery. To make this possible, it was necessary to add small rails on the sides of the larger casing, since it had to be printed in 3 parts, and also to design the path for the wires and electrical components.
Fabrication

The project’s fabrication combined 3D printing and laser cutting. Most assembly parts, like the casing and guides, were 3D printed for precision and customization due to its complex design, while laser cutting was used for stronger components such as the motor supports and MDF core. The design searched to optimize internal space, enlarging the casing to accommodate the trigger mechanism and adding rails for a removable battery. The casing was printed in three parts with planned channels for wiring and holes for the screws used for fixation. This assured a functional device integrating mechanical and electronic components.
Bill of materials
- Brushless motors x3
- Generic brushless motor drivers x3
- ESP32 board
- Lithium batteries 2S
- 10mm MDF
- PLA and PETG for 3d printing (~300g)
- Screws of various sizes
- Small metal plate
- Potentiometers
- Smaller electronic components (such as wires and connectors)

