Controlling brushless hub throttle via Arduino, not spinning

doublejosh

100 µW
Joined
Dec 20, 2015
Messages
7
I'm trying to control a brushless hub motor via Arduino by way of the motor controller's throttle signal. Getting no spin :(

To troubleshoot and calibrate I output a signal from the Arduino between 0v-5v to the throttle signal wire (green,vs red/white). I've tried voltages all over the range. I've even tried a slow oscillation between low and high to find the throttle control range (and eventually fine tune speed adjustment). No amount worked. The throttle does not affect the motor at all :cry:

It's worth noting that normally Arduino signal out is digital (using PWM to determine the voltage). But I'm using a DAC (digital to analog converter) to create what I think the throttle expects.

Troubleshooting... I can confirm the motor runs fine by using the self-learn wires. I'm able to make the wheel spin both ways (disconnecting/reconnecting). This strongly suggests the hub motor wiring (phase + hall) is correct.

My assumption is that normal throttles work by power flowing from the positive throttle output into the ground wire. Then normally a physical mechanism adjusts how much power it sends off to the signal wire instead. True?

Am I skipping a key electric loop that makes the throttle work? ...rather than just an amount coming into the signal wire? (I'm more software than electrical) :shock:

Perhaps there's a brake wire that's disabling the motor or some anti-theft feature locking the throttle?

Pictures of the controller...
https://www.dropbox.com/s/3e4iu6j8uim939a/2016-10-02%2014.19.57.jpg?dl=0
https://www.dropbox.com/s/jroxhechn14w8rd/2016-10-02%2014.20.12.jpg?dl=0
https://www.dropbox.com/s/enp6b5w84i94099/2016-10-02%2014.22.00.jpg?dl=0

Background info...

Equipment:
- Brushless hub motor, 36v 500w
- Motor controller
- Arduino, 5v control signal output
- DAC (digital to analog converter, creates analog signal)
- Accelerometer (tilt sensor)

This is an effort to make an open-source, DIY, one-wheel, self-balancing, electric skateboard for myself and others. Hope you're into the idea!

https://github.com/doublejosh/emmett
https://github.com/doublejosh/emmett/wiki
http://openemmett.tumblr.com
 

Attachments

  • 2016-10-02 14.20.12.jpg
    2016-10-02 14.20.12.jpg
    296.8 KB · Views: 2,567
  • 2016-10-02 14.19.57.jpg
    2016-10-02 14.19.57.jpg
    214.2 KB · Views: 2,567
  • 2016-10-02 14.22.00.jpg
    2016-10-02 14.22.00.jpg
    173.7 KB · Views: 1,760
  • 20150514155351-295cb.jpg
    20150514155351-295cb.jpg
    80.2 KB · Views: 1,942
  • File Jan 20, 11 52 42 PM.jpeg
    File Jan 20, 11 52 42 PM.jpeg
    104.3 KB · Views: 1,942
I'm not a great help but the signals voltage is normally between 0.9 and 4.1v I assume your sending the 5v from the controller to the arduino and that controls it high and lo back to the controller for throttle ? If so maybe a resistor between + and - to ground it may work, I had a lot of trouble myself on a pot throttle right pain.
 
Right. Normal throttle signals go from about 1v to 4v (but a little lower in most cases). The throttle feeds 5v to the signal line. Most controllers have about 20K resistance to ground to make sure it shuts off in event of throttle wire fail. If the controller does not see something around 1v when it turns on, it may go into a fault mode as a safety feature. You should be able to measure the voltage coming off the D/A from the Audrino. Just a simple RC filter from the output should work.
 
Thanks for the replies.

Seems reasonable that the controller could get locked up if the throttle wasn't plugged-in when started up. I did try connecting the 5v throttle output directly into the signal wire, but it wasn't connected initially (and the ground was then disconnected). With the Arduino needing to boot up to send the signal, it might be tough to avoid an initial fault.

I used an analog muti-meter to test the voltage coming from the DAC before connecting it to the throttle wiring.

@fetcher Where/why are you suggesting the RC filter?

I should have asked originally... perhaps there's a brake wire that's disabling the motor or some anti-theft feature locking the throttle?
 
There's the battery wires and a red power wire on its own that needs to be switched to the battery live and the motor wires obviously the brake wires can be left disconnected it should spin up in this state.
That white pair of wires is the self learning wires I see in the picture, power off connect them and power on if the motor spins the correct way disconect the wires then power off if it spins wrong way power off repeat the process till it spins correct then disconnect before power down.
 
@Ianhill...

The third power wire (red) is connected to battery. I believe that if it wasn't connected the self-learning wouldn't be spinning the motor at all.

Great to know that the brakes being disconnected is not a problem.

I haven't had any trouble with the self-learning system, that's working fine. It let's me know the motor is hooked up correctly.

Thank you for helping.
 
The DAC is the RC filter. Simplest version looks like this:

Super-simple-DAC-circuit.jpg

Most controllers will fault if the throttle signal goes over 4.5v or so. Going below 1v does not generally cause a fault but it's remotely possible.

If you have a pot or actual throttle lying around, you could test with that to verify everything is working with the controller. With a pot, you attach the 5v and ground to the ends of the pot and connect the pot wiper to the signal line. It should work just like a throttle.

I seem to remember there was something tricky about using the PWM command in Audrino. If it measures good with your meter, it should be OK.
 
Gotcha, thanks. I do already have the DAC running (via I2C) from the Arduino to the throttle, rather than just PWM. Will definitely try with a simple potentiometer for a sanity check. Sure hope I don't end up dealing with allowing current to the signal while the whole thing turns on, what a pain!

Added a few photos of the logic board connected to the controller for a full overview.

http://openemmett.tumblr.com/post/151570419779/logic-board-connected-to-power-and-throttle

https://66.media.tumblr.com/0830a93c538d731439be25104bf9346a/tumblr_oeskmwfZje1v3scgqo1_1280.jpg
 

Attachments

  • tumblr_oeskbv3C6S1qzp471o1_1280.jpg
    tumblr_oeskbv3C6S1qzp471o1_1280.jpg
    201.3 KB · Views: 2,522
I'm pretty sure it will be OK if the throttle signal starts out at zero. Somewhere between 4.3v and 5v should trigger the throttle safety fault. A real A/D is good. The PWM command and the simple RC filter has been used successfully to drive the throttle on a controller before, so you should be able to make it work.
 
Nice. Thanks. Perhaps I can reduce the cost/complexity a bit in the future by swapping the DAC for a simpler RC filter (version two).

I'll post what I learn from the potentiometer test.
 
Maybe a stupid answer but do you have common ground for arduino and controller? Otherwise you dont have a closed circuit.
And you have to use a voltage divider to your analog output to feed the controller with max 4.1v or 4.5v or use a capacitor and max 82%pwm (analog value 209)

This is just my own thoughts. I have no experience.
 
@jojje123 I definitely agree this might be the issue. Perhaps if I run the Arduino with the throttle power output and ground?
 
I mean that if ground to arduino and the controller is not connected together the you send your pwm-output to the space or something. Its like connecting a bulb to the positive side only of a battery. It doesnt work. Always use common ground

Skickat från min E5823 via Tapatalk
 
Back
Top