How to control Motor Controller Throttle Position using Arduino?

So here's my dilemma;

I'm planning to purchase a 48v DC Motor with Controller on Ebay (https://www.ebay.com/itm/Full-Set-Brushless-48v-1800w-Electric-Motor-Speed-Controller-for-Go-Kart-Drift/303251784646) to be able to build my own Go-Kart from scratch, control it using an Arduino, and control the Arduino using a game engine such as Unity 3D. I have attached an image of the wires from the motor controller for reference, as well as a photo of the controller itself.

Basically the throttle connection has 3 wires (5v+, ground, and signal). I'm assuming I just need to intercept the signal wire with the arduino and vary that signal to the motor controller.

My question is, can the Arduino interface with this type of motor controller (in the link above), and manipulate throttle position?

Thank you for taking the time to read, and I truly appreciate any feedback (whether positive or negative).

Do you have a manual or or more detailed specification? From your link I can't see any information about what control signals are needed so it's impossible to say what would be required to run it from an Arduino.

Plus I have no real idea what "a game engine such as Unity 3D" is or how it might control the Arduino.

Steve

Bit of searching threw up Tdpro "brainpower" motor controller help | Endless Sphere

hmmm... I'm not seeing any info there regarding using arduino to control throttle position (which is essentially what I want to achieve.
Basically the throttle connection has 3 wires (5v+, ground, and signal). I'm assuming I just need to intercept the signal wire with the arduino and vary that signal to the motor controller.

Hi,

Can you tell us your electronics, programming, arduino, hardware experience?

Thanks.. Tom.. :slight_smile:

Hi,

I have very little arduino experience; basically the biggest thing I ever did was control speed of a treadmill motor by sending PWM signals to the control board.

I have some programming experience in Unity (C# and Javascript), Java, and HTML/PHP.

Very little electronics experience :slight_smile: But a potentially big project which I hope to learn a lot from!

For anyone interested in following this project, I found an interesting video which explains how these electronic throttles work, and how to manipulate them. Arduino Drive by Wire Controller Conversion - YouTube

From this website, and looking at the throttle wiring, it appears that the 5v wire is constant and the signal wire varies between 1 and 4 volts, which I believe is the wire which I will need to intercept with the Arduino.

The link in Reply #7 does not give a complete wiring diagram and without that I certainly cannot interpret the instructions.

I'm not going to watch 10 minutes of YouTube on your behalf - sorry. But from looking at the first few seconds it does not seem to be about electric motors for scooters. I could see a throttle valve which suggests it is about control of a petrol engine.

...R

Many thanks for your reply Robin 2.

Unfortunately there is very limited wiring information for this 48v brushless motor on the Internet, so I'm just trying to pull from multiple sources to get an understanding of the system before I purchase it.
From my limited research so far, it would appear that the signal wire from the throttle pedal is what I will use to manipulate the motor's speed using Arduino, since this wire is 1 to 4v. The other wires which control the speed of the motor are the Hall wires, which are all 48v.

You need to connect ground to a ground pin on your arduino and the signal to one of the digital pins with pwm (should have ~ sign next to it). Then import the servo.h library and control it like a servo.

The code lines you need to include are:

#include <Servo.h>

Servo ESC;

void setup()
{
ESC.attach(2);
}

void loop()
{
ESC.writeMicroseconds(1000);
}

Change the micro seconds to between 1000 (0% throttle) and 2000 (100% throttle) and the "2" to whichever pin you attach the signal pin to

Thank you so much Kearsley_15!

Finally a piece of useful information :slight_smile:

I will go ahead and purchase the motor with controller, etc, and give this a go.

Cheers!

1 Like

No problem

hey, do you think it's possible to use the arduino as a switch to essentially stop throttle from manipulating motor controller, for a specified time (say 3 seconds), then re-enable that function?
I'm thinking to have the arduino connected between the throttle and the motor controller, to essentially work as a switch that opens and closes the connection between throttle and motor controller.

Since the signal is only +1 to +4 volts, I believe it should work fine?

What are your thoughts?

paulsamaroo:
hey, do you think it's possible to use the arduino as a switch to essentially stop throttle from manipulating motor controller, for a specified time (say 3 seconds), then re-enable that function?
I'm thinking to have the arduino connected between the throttle and the motor controller, to essentially work as a switch that opens and closes the connection between throttle and motor controller.

Since the signal is only +1 to +4 volts, I believe it should work fine?

What are your thoughts?

I'm a little confused as to what you want to achieve, however I'll take a stab that you want to feed the 1-4 vdc signal from the throttle to an analogue input of the Arduino rather than directly to the motor speed controller.
It follows that you can now modify the output signal (from one of the PWM outputs of the Arduino) as you wish and drive the motor according to your program, examples of such modification may be:-

  1. Run output linearly following the input
  2. Output follows input but 1-4vdc in gives 1-2vdc out - half speed.
  3. Disable output, motor stops.
  4. Ignore input and drive output regardless of it.
  5. Increasing input produces decreasing output (invert the input).

...plus many, many other input to output relationships.

So if I were building a go-kart to let a young child use I might use option 2, and if I had several karts ready to start a race I'd introduce option 3 until the race started.

Is this what you're trying to achieve?
All are possible.

GM

paulsamaroo:
Thank you so much Kearsley_15!

Finally a piece of useful information :slight_smile:

I will go ahead and purchase the motor with controller, etc, and give this a go.

Cheers!

[Did you have any success? I am also doing similar using PWM though not successful yet ]

Any success using microseconds for controlling throttle of bldc motors??

Yes!!!! All of the above. You hit the nail right on the head man. Thank you so much.

Does anyone know if it's possible to do my testing without the batteries, but rather with a 110V outlet? I've seen a 110/220V AC to 48V DC converter on amazon, but it's only rated at 10 Amps. However, the motor is rated at 28 Amps with a Maximum current of 40 Amps.

I am using Kelly controller. When I tried PWM to feed throttle input to Kelly, voltage rises steadily upto 1 V but beyond that it is unstable jumps from 5 v to 0 v and motor doesn't function. Without motor connected things are fine. So sure it's something with Kelly or motor connection.
Using servo microseconds, I am getting constant 5 v on pin. Tried reducing 2000 to 100 also. Current ratings seems consistent between Arduino and Kelly. As per Kelly manual even a potentiometer can be used for throttle.
Anybody can guide me?