I'm getting somewhere now. It's not giving full throttle but it is giving some throttle.
I had to hook up the throttle unit in parallel with the Arduino for the bike to accept inputs from the Arduino.
This might work out ok because i wanted to have a throttle lever and pedal assist anyway.
More testing to do still!
I briefly had it working without the throttle connected. I had put a 1.2K resistor between the positive and ground wires and that did it. The bike was under control of the Arduino. Then it just stopped working and hasn't worked since.
The Arduino still works, and the bike still works if I hook a regular throttle to it. Mysterious
describe how it's supposed to work, at least in theory..
excellent point.
and is 0% throttle represented by +5V or 0V?
@MLE_online I'd guess that there's a bunch of conditions that trip it into thinking something's wrong. Hall effect throttles don't generally swing all the way from 0v to 5v. For example it might expect like 0.4v or whatever as a released throttle and a slight load across 5v and gnd to decide everything is ok to start.
I've only ever "faked" potentiometer throttles though so this is guessing. (digital pots are handy for this kind of nonsense)
@MLE_online does it work with a pot directly? Sorry if you already answered that somewhere, but if it does a resistor ladder seems like the better answer.
I've never had great luck with trying to use pwm to fake stuff that was being monitored by some IC I didn't understand.
@MLE_online aha! I bet I know another answer!
Part 1: was the voltage TO the orig throttle (pot, I suppose) *slightly* less than 5V?
Part 2: did you ground the microcontroller to the "low" voltage lead of the 3 wires, or the "real" system ground?
What I think is going on: I think the signal your giving it is "out of range" like I said, the cart I have is picky, if the "value doesn't look right" it does a safety shutdown. You might find by limiting the max and min PWM levels, you find a "happy place"
I suggest starting it at 50%, and slowly dialing up/down to feel out the limits.
you got this! Were all counting on you!
:]
@RueNahcMohr It's a full 5V going to the original throttle. The original throttle is not a pot. It's a hall-effect thing.
I grounded the microcontroller to the black wire that is identified as ground.
I have already limited the max and min PWM levels so they match the voltage limits that the throttle outputs when it's at the bottom and top of its range
@MLE_online interesting, they must have a really curious "safe input" system in there.
I suppose you cant see the chip in the throttle, I suspect its a hall effect pot.
Does it look like this?
@MLE_online based on what I learned here, it must be ripple in your pwm freaking it out.
With the 1.2k resistor, its fine with the bench power supply signal?
'tomorrow' I know....
@MLE_online I know.
scope this a second.... ( I know the filter might not be arranged right)
@MLE_online ! your powering the arduino from the throttle supply? oh, I wonder if thats the issue...
I'm going to come up with a crazy circuit you can try or not, but that I think might work.
:]
I don't suspect you will try it, I dont know why I'm driven to solve these puzzles..... oh right, core of personality.. ugh...
@MLE_online ah! miscomm. the inner box is the arduino, I didn't intend to say its + is common!
the outter box is meant as your arduino conditioning circuit.
heh, diagram fail Rue.
@MLE_online hmm, I think you have some CDS cells left over from a project that was light sensitive...
omg wait, is my brain cataloging what other people have too? ....
control a transistor with the potentiometer..
1. ardie -> potentiometer -> transistor -> motor control voltage
not
2. ardie -> potentiometer -> motor control voltage
#1 is probably how it's done inside the hall effect sensor chip. there is probably more than just hall effect sensor + amp etched on that silicon chip. Identify the hall chip if you can and grab the manufacturer's data sheet if possible to verify.
@MLE_online I'm having flashbacks...
https://rasterweb.net/raster/2017/05/29/controlling-the-controller-cheaply/

Hey, it's only been six months since my last post about motor controllers and the Power Racing Series so I guess it's time for an update! If you missed it, I'm working on a tiny electric vehicle that can serve as a reference for teams of beginners to build their own. In the last post [...]
Intuition tells me that 0-5v for a motor is not a sensible (purely analog) control voltage... not enough "steps" between 0 & 5. There must be more to the picture. I'de keep looking for it. See if there is not a digital signal being sent over the wire @ 5v.. +5 being a 1, and 0V being a zero.. you know the drill.
what electronics are inside the throttle assembly?
get the data sheet for the hall in question. study it. use the arduino in conjunction with that hall or some other. arduino outputs can't spoof what the hall sensor does with anything close to an acceptable degree of fineness for a throttle. Analog on/off at best from an ardie by itself
P.S. More than just hall sensor & amp, at least in this specific one. Data sheets are worth gold. The component in this diagram that you didn't mention is the reason the ardie + throttle + 5v works
arduino output voltages are very "bouncey" and not especially stable. better to use the ardie to control a dumb component that is stable at doing one simple job, in most cases.