XCM-K and similar - throttle & brake strategy

VIS

10 µW
Joined
Nov 23, 2024
Messages
6
Location
Poland
Hi, i have controller with XCM-K onboard. (I cant find answer for my question).
Motor is standalone brushless 3 phases 1.8KW with connected Hall sensors.
I have pedal throttle and mechanical brake switch.
Sometimes when apply brake and press throttle, system have two random states: engine shaking and after relase brake my vehicle self running 10-50% speed (like on cruise control which is not there), or When runs, engine shake and stop, i need disconnect battery to reset. Throttle is standart Hall, and brake is mechanical on/off switch in lever.
Undervoltage its out the question, i have few factory new batteries - Li-Lon 48V 23Ah.
Can someone explain to me what is the logic idea of this controller?
The problem occurs in ONLY several devices.
Thanks for reply.
Simon
 
Last edited:
Probably buggy firmware. Some versions written so that they respond differently than others to the dual-input, so that some can't handle the situation in a helpful way, but others might. So you get different controllers that are otherwise identical that don't respond the same.

There's probably no way to change the behavior, as they are probably not programmable / updateable controllers (and you would have to have a source for the firmware and the update program that usually doesn't exist).

One thing you can do that might prevent the issue is to use the brake lever to trigger a tiny relay, instead of directly connecting ot the ebrake input. The relay would be an DPDT type, coil powered by 5v, and the other end of the coil is wired to the ebrake lever output, so that it grounds the coil and activates the relay. One pole is also wired to 5v, and it's NC contact that stays "on" when the relay is off is wired to the throttle's 5v input (instead of wiring the throttle to the controller 5v directly). The other pole is wired to ground, and it's NO contact that stays off when the relay is off is connected to the ebrake input of the controller. Pulling hte brake lever activates this relay, which turns off the throttle and turns on the ebrake.

That prevents the controller from getting into the fault condition you see, since it should only ever get one input or the other.
 
Thanks for reply. Good idea. I didn't think about disconnect throttle when braking....I will disconnect tomorrow brake switch, and perform test drive. When not failure, probably i make circuit with relay. I am attaching a diagram for forum users. 7805 IC is linear stabiliser for 5V to supply MCU and Throttle. Is inside in many Controllers. Max current is 100mA. Throttle voltage have 4.3V, because connected behind the diode - diode making drop voltage. D2 cut off voltage spikes generated from coil and prevent 7805 for damage. D3 is for block reverse voltage by coil from 5V line to input low level brake. Relay max current 50mA and only with NC (normal connect contacts). Regards. Simon

P.S. Note ! In many controllers disconnecting ground from the Hall in throttle sensor, causes the "Full Throttle" effect! Cutoff only supply or output from hall sensor, never sensor ground !
 

Attachments

  • Throttle cutoff.jpg
    Throttle cutoff.jpg
    89.6 KB · Views: 4
Last edited:
P.S. Note ! In many controllers disconnecting ground from the Hall in throttle sensor, causes the "Full Throttle" effect! Cutoff only supply or output from hall sensor, never sensor ground !
Yes, a broken ground wire on the throttle often causes undesired system behavior in threads people come here to post and troulbeshoot. :)

When disconnecting the throttle "remotely" for whatever reason, I usually do it at the sensor 5v because someitmes disconnecting the signal wire leaves just enouhg of a floating signal on the wire to allow the ocntroller to do something I don't want it to. Some controllers have electronics to prevent this but most don't.
 
"Electronics to prevent" is only one element. It is resistor "Pulldown", connecting between ground and throttle signal wire connected to MCU. Typical value is 10k (kiloohms). Resistor short "floating" voltage to ground, when no signal in input. When throttle send voltage, this resistor not making "short circuit" In my controller equipped is also PWM filter for connect throttle with PWM signal. Filter convert to PWM to dirty linear, but MCU read it as linear voltage from hall. When measure resistance between ground and signal wire, and resistance is from 4.7K or 10K (typical value is 10K for pulldown), yours controller have prevent prevent for floating voltage when throttle signal is disconnect.

To check if You have filter to connect PWM signal or throttle, need open controller and check elements in PCB about throttle signal.

If not 10K resistance in controller, connect resistor 10K between ground wire and throttle signal, without fear of damaging anything.

I know a little about electronics but not much about electric bikes, so we can exchange information.

When resolved my problems, I will share my project on the forum.
 

Attachments

  • IMG_6451.jpg
    IMG_6451.jpg
    428 KB · Views: 4
  • IMG_6450.jpg
    IMG_6450.jpg
    4.6 MB · Views: 4
  • IMG_6453.jpg
    IMG_6453.jpg
    2.2 MB · Views: 4
Detailed info, schematics, and the like are *always* welcome on Endless Sphere--there are too few people/projects that have that level of info. :)



I know a little about electronics but not much about electric bikes, so we can exchange information.
While I'm not a true expert, I know a fair bit about both, if you are curious you can poke around my posts over the last decade and a half or so. ;)

These days I don't usually give as detailed an answer as I might once have, as most readers don't understand it and dont' want to, and dont' generally read any of it anyway. :(

Otherwise I would have given something closer to your answer instead of the highly simplified "electronics to prevent this" :lol: (but i would not have gotten as detailed)
 
I'm glad the informations will be useful :) I solved the my problem. I disconnected the brake circuit from the lever. Before few vehicles braked immediately with lever and the other vehicled they kept going with lever pressed and brake switch ON because brakes is litlle bit wear and the hall sensors gave conflicting information about the engine status and brake switch. Secondly, this controller probably has the option of connecting a PAS sensor instead of a throttle. I control my vehicle with PWM pulses and the controller thought that the throttle pulses were pulses from the PAS sensor and activated the engine at idle speed. My additional controller (DIY) has a softstart and probably these short pulses were read as pulses from PAS. Oryginal controller not have softstart - motor goes up - 1s to 5600 RPM without load with power 1.8 KW. o_OThese are additional functions that are not mentioned in the manual and generated random problems. Thanks for You help. When end test, I'll upload some photos of the project.
 

Attachments

  • IMG_6150.JPG
    IMG_6150.JPG
    2.3 MB · Views: 1
Back
Top