Controlling throttle speed completely with Arduino

ChuckB

1 mW
Joined
Jul 30, 2019
Messages
10
I have a 500w non-hub motor that I want to completely control with an Arduino. I don't want to use the hand throttle. I'm going to have a program where I tell it different commands, like "go forward at x speed for 10 seconds" etc.

I have Sunfounder Mega 2560. I spent a lot of time trying to get it to control the throttle but it's not working. The best I could do was make the motor make clicking sounds. I tried to create a low pass filter with a resistor and capacitor but it didn't work. I also played around with a opticoupler.

One thing I don't understand is.. the motor controller has a positive, negative, and sensor(?) wire. If I was setting the throttle speed with the Arduino, what would I do with the positive wire on the motor controller? I'm not sure if I need to hook all the wires up to the Arduino or just the sensor and the ground wires.

If anybody could help that would be great. I spent a day working on this and it's still not working. BTW this is for a cable-car robot, not a bicycle. I hope it's ok I'm asking here. This seems to be the most knowledgeable forum.

This is a video
https://www.youtube.com/watch?v=EBIFFykNipA

Thanks
 
Ok, if I hook the black throttle wire to the Arduino ground and the middle throttle wire to the Arduino 3.3v output, the motor works great. So I guess the Arduino has enough power. If I use a 100ohm resistor and 100uf capacitor, the motor just clicks. Sounds like a car that has a weak battery and the starter just clicking.
 
Ok I got it working. I found a diagram online of a RC filter and it worked.
 
Here's an image. The blue wire on the bottom is the center throttle wire on the controller and the white/blue stripped wire goes to the ground on the controller. I believe the resistor is 100 ohms and the capacitor 100 (not sure of the units). arduino3.jpg
 
Looks like you got it working. From what I have seen so far you can give the throttle or in your case arduino an independent 5v power source as long as the grounds are shared between the throttle and controller. The way I understand it is that the controller only cares about the voltage between the signal wire and ground.

Whats the final application for the cable car?
 
Typically ebike controllers use an analogue input between 1V and 4V (ish). For a hall-effect type throttle.
Your Arduino can output PWM signal with varying duty cycle 0% to 100% pulsing 0V to 3.3V.

The RC filter averages out the % duty cycle too a voltage which becomes your throttle signal. Note Max 3.3V...

Another way you can do this is with the digital to analogue converter (I think the Arduino has a DAC ) and output the throttle signal directly.

You could also have a small op amp circuit with a 5v supply and small gain (2) to get your throttle signal up into the full usable range.

Just some thoughts
Andy
 
Back
Top