Introduction: Pickleball Machine Upgrade With Arduino

I bought a pickleball machine to help me improve my game. I realized there were some improvements that I would like in my machine. One of the problems that I had involved the speed control. The speed dial is very sensitive which makes ball placement difficult. For example a BALL SPEED setting of 4.0 just gets the ball over the net, while a speed setting of 4.5 sends the ball to the baseline. So even though I have a speed dial that goes from 1 to 10, I have to work in the range of 4.0 to 4.5.

Another limitation of the machine was the single speed dial controlled both spin motors inside the machine, which produce all straight balls. Better machines have independent control for each of the motors.

I also wanted a remote control to turn the machine off and on. Another feature found in more expensive machines.

I decided that my new controller
should:

· Improve ball speed control

· Remotely control the machine

· Add left and right spin capability

· Be easy to update the software

For this additional capability, I replaced the original controller with an Arduino microcontroller.

Step 1: Supply List

ARDUINO UNO R3 amazon.com/gp/product/B008GRTSV6/

Big Red Box – Enclosure sparkfun.com/products/11366

Uxcell boat rocker switch amazon.com/uxcell-Position-Rocker-Switch-Black/dp/B072L2B68P/

Control knobs amazon.com/gp/product/B012UY7G64/

Molex connectors amazon.com/gp/product/B074G5PQHL/

Polulu VNH5019 Motor Driver Shield www.amazon.com/gp/product/B07K8TC37D/

12V Wireless Remote Control Relay Switch amazon.com/gp/product/B078SQKYMX/

Wires with Pre-Crimped Terminals pololu.com/product/1805

Crimp Connector Housing: 1x10-Pin pololu.com/product/1909

10K OHM Linear Taper Rotary Potentiometer amazon.com/gp/product/B071X4DKV7

E-outstanding 5-Pack DC-099 Power Jack Socket amazon.com/gp/product/B07C4F7BP5

Metal Push Button amazon.com/gp/product/B00U5UBSC4

Sung Motor Speed Controller amazon.com/gp/product/B07KM8MV86

Stand-off M-F Assortment Kit amazon.com/gp/product/B06XB8RNS2

USB 2.0 Type-B Printer Cable amazon.com/gp/product/B01LPBIGBW

Mini Toggle Switch amazon.com/gp/product/B01M3261RL

Toggle Switch amazon.com/gp/product/B00004WLKC

USB-3-0-B-Female-to-B-Male-Right-Angled-Socket-Panel-Mount-Extension-Cable ebay.com/itm/30cm- /392276429142

Step 2: Ball Machine Disassembly

I removed the controller from the machine. The controller disconnects with an easily detachable Molex connector.

The bottom plate was held by 7 screws.

The battery and oscillator motor are attached to the bottom plate. The oscillator motor comes with a molex connector. The first time you remove the plate you will need to disconnect the battery using the terminal connectors. I added a Molex connector to the battery wires to make it easier to remove the bottom plate in the future.

Step 3: Machine Motors

Inside the machine there are three motors. The two spin wheel motors were wired in parallel. I cut the connection between these motors. The third motor (the Table Motor), drives a turntable that sits on the top of the machine feed the balls into the machine. I attached Molex connectors to each of the motor wires.

Step 4: Controller Construction

I used a Big Red Box from SparkFun to hold my new controls. I cut off the end flanges from the box and mounted a Sung motor speed controller and a 12V wireless remote control relay switch. The relay switch was silicone glued to the box.

I drilled the other holes needed in the box.

I then mounted the on/off rocker switch and the power jack socket and connected the wires to the relay switch and Sung motor speed controller. I silicone glued the connecting wires to the side of the box.

Step 5: Controller Construction Continued

I mounted the Arduino to the Big Red Box cover at an angle so I could connect the USB cord.

The Polulu motor shield is located on top of the Arduino. The motor shield is powered by the ball machines 12-volt battery. The blue jumper allows this battery to power the Arduino. I changed the blue jumper to a wired connection, (highlighted in the yellow circle) which allows me to update the software using a USB port mounted to the front of the box. Without this wired connection, you would need to disconnect all motors when updating the software or risk burning out the Arduino board. Your other option is to take apart the control box and remove and then replace the jumper after updating.

Step 6: Controller Construction Continued

I connected the wires to the Arduino controllers using the Polulu crimp connector housing and the Polulu wires with pre-crimped terminals. You only need to purchase one set of the 1 X 10 pin crimp connector housing. Custom make the set of 2, 6 and 8 housing by cutting the unneeded sections from the 1 X 10 housing.

The red box is smaller than the original controller unit so I made a hardboard template to allow mounting to the ball machine and hot glued the red box to it. I then added the buttons and potentiometers and made the electrical connections between the box and cover.

I added the knobs and labels to the front of the controller and inserted the unit into the pickleball machine.

I connected the controller to the motors and battery and then screwed on the base. The mechanical construction part of the project is done.

Step 7: Controller Operation

The blue dials control the speed of the spin wheels. When the left and right dials are set the same the balls shoot straight. When they are set at different levels they spin either right or left. The OSC controls the oscillator. Turning the INTERVAL dial regulates how often the balls shoot out of the machine.

The USB port and PROG switch are used to upload new programs to the Arduino. The charger is plugged into the charge jack to recharge the battery.

Step 8: Remote Control

The ball feed turntable is now operated by remote control. Pushing the button starts and stops the ball feed turn table.

Step 9: Short and Long Buttons

The buttons optimize the ball speed control. When the machine is turned on the wheel RPM will vary according to the speed dial. When the dial is turned to zero, the motor does not spin. When the dial is turned to the maximum, you get 100% RPM from the motor.

Next you change the wheel speed using the left and right speed dials until the ball just goes over the net. This is your minimum speed.

Pushing the short button resets the span of the speed dial at the lower end of the speed control. The push is acknowledged by the machine turning off the spin wheels for 5 seconds. Turning the dials to zero now gets the balls over the net. This gives subtle control for dinking drills.

You do the same thing for long balls. Adjust the speed dials again until you ball reaches the longest point desired. Then push the long button. This sets the highest dial range to send the ball to the farthest point desired.

Now you have much better control of the ball flight. To reset the system simply turn the machine off and then turn it back on.

Step 10: Spin Control

Ball spin depends on the settings for the left and right motor control dials. When the dials are the same the balls go straight. Different settings result in the balls spinning to the left or to the right.

Step 11: Program Upgrade

To upgrade the Arduino computer program you connect a USB wire from your computer to the connector on the controller. You turn the PROG switch to the off position, which isolates the spin motors from the Arduino. If you connect the USB with the switch turned on the USB will power the spin motors and you will eventually burn out the Arduino.

Likewise, if the PROG is in the off position when you turn on the ball machine, nothing will happen. This switch must be on for the ball machine to function.

Summary

This upgrade met all of my goals:

· Improved dial ball speed control

· Remote control of the machine

· Left and right spin capability

· Easy to upgrade the software

Other possibilities exist with the software. It is an easy matter to upload a sequence of ball locations, long ball, ball to right, ball to left, short ball, etc. This Arduino controlled machine now has capabilities only found in more expensive machines.

Step 12: Electrical Connections

Step 13: Arduino Program

//Manual 12 V motor controller

#define Motor1 9 //Enable Motor 1

#define DIRM1A 2 //Direction A for Motor 1

#define DIRM1B 4 //Direction B for Motor 1

#define Motor2 10 //Enable Motor 2

#define DIRM2A 7 //Direction A for Motor 2

#define DIRM2B 8 //Direction B for Motor 2

int pot1 =A2;// assigns analog output to Pot1 from A2

int pot2 =A3;// assigns analog output to Pot2 from A3

int pot1Read=0;// Reads pot1

int pot2Read=0;// Reads pot2

int Speed1=0; //Calculated speed of motor 1

int Speed2=0; //Calculated speed of motor 2

int HS1=255; //set span rates

int HS2=255;

int LS1=0;

int LS2=0;

// Input buttons

const int FastButtonPin=11;//location of fast button

const int slowButtonPin=5; //location of slow button

// Buttons logic 1=yes 0=no

int FastButtonSet=0; //set to 1 if button pushed

int SlowButtonSet=0; //set to 1 if button pushed

void ButtonsPushed()

{

if (digitalRead(11) == LOW) // Just Fast Button pushed

{

FastButtonSet=1;

HS1=(pot1Read/4); //change from HS1

HS2=(pot2Read/4); // change from HS2

Serial.println("Fast Button Pushed HS2 = ");

Serial.print(HS2);

analogWrite (Motor1,0);

analogWrite (Motor2,0);

delay(5000); // Shut motor off for 5 seconds

}

else if (digitalRead(5) == LOW) //Just Slow Button pushed

{

SlowButtonSet=1;

LS1=(pot1Read/4);

LS2=(pot2Read/4);

Serial.println("Slow Button Pushed LS2 = ");

Serial.print(LS2);

analogWrite (Motor1,0);

analogWrite (Motor2,0);

delay(5000); // Shut motor off for 5 seconds

}}

void setup() {

pinMode (Motor1,OUTPUT);//speed motor 1

pinMode (DIRM1A,OUTPUT);//direction motor 1

pinMode (DIRM1B,OUTPUT);//direction motor 1

pinMode (Motor2,OUTPUT);//speed motor 2

pinMode (DIRM2A,OUTPUT); // direction motor 2

pinMode (DIRM2B,OUTPUT); //direction motor 2

pinMode(11,INPUT_PULLUP);// Used for Fast Button with pull up resister

pinMode(5,INPUT_PULLUP);// Used for Slow Button with pull up resister

pinMode(pot1,INPUT);

pinMode(pot2, INPUT);

digitalWrite (DIRM1A,HIGH);

digitalWrite (DIRM1B,LOW);

digitalWrite (DIRM2A,HIGH);

digitalWrite (DIRM2B,LOW);

Serial.begin(9600);

}

void loop()

{

//When pots are changed change motor speeds when buttons are not set

{

pot1Read=analogRead(A2); //Pot1

Speed1=(map(pot1Read,1023,0,HS1,LS1 )); //Change last two numbers to vary the pot span

analogWrite (Motor1,Speed1); //changes motor speed based on pot setting

pot2Read=analogRead(A3);

Speed2=(map(pot2Read,1023,0,HS2,LS2 )); // Change last two numbers to vary the pot span

analogWrite (Motor2,Speed2); }

//Read Button State

if (digitalRead(11) == LOW||digitalRead(5) == LOW) // if either Fast or Slow Buttons have been pushed

{

ButtonsPushed();}}

Arduino Contest 2019

Participated in the
Arduino Contest 2019