Kelly controller programming

Get all your technical information about electric bikes here.
Post Reply
scrachdat   100 µW

100 µW
Posts: 9
Joined: Dec 29 2017 6:31am

Kelly controller programming

Post by scrachdat » Feb 08 2018 12:04pm

I really need help trying to figure out how to get my kelly controller from luna cycle to connect to my pc so i can program it i have tried loads of thing different computers, different ports compatibility mode. nothing works just the same old can't connect to the controller.
please help i need to set the max current for it before i can use it.

sorry if this is in the wrong place or i have done something wrong i am new to the whole forum thing.

User avatar
trazor   10 W

10 W
Posts: 68
Joined: Jan 13 2015 10:48pm
Contact:

Re: Kelly controller programming

Post by trazor » Feb 09 2018 7:28pm

Which Kelly controller model do you have? I've a couple of KBS models and all are straightforward to program. My cable is this https://www.amazon.com/gp/product/B01DT ... UTF8&psc=1

User avatar
skeetab5780   10 MW

10 MW
Posts: 2119
Joined: Jun 15 2009 10:58pm
Location: MA
Contact:

Re: Kelly controller programming

Post by skeetab5780 » Feb 09 2018 8:36pm

You need to install a generic usb to rs232 port driver so the programming cord is recognized by your PC. You can normally find one with a quick google search for whichever OS you run. but if you cannot im sure kelly will provide you with a download link. Then after that make sure your controller is powered on before connecting and loading app.

scrachdat   100 µW

100 µW
Posts: 9
Joined: Dec 29 2017 6:31am

Re: Kelly controller programming

Post by scrachdat » Feb 10 2018 12:34pm

Hey thanks for helping, my controller is the kbs72121X it uses a db9 plug for programming so I have purchased a db9 to rs232 from kelly. then from amazon i purchased a rs232 to usb adapter, i've installed the drivers and when connecting the rs232 to usb adaptor it shows up in my device manager.

however after all this is done and the kelly controller is powered over pin #7 it still does nothing. can't connect to controller.

I have tried 3 different computers with the same outcome, could it be the lead?

kelly is asking me to send it to them in china but i'd rather not do that if i can avoid it.

if need be i can take pictures of everything.

Rs232 to usb:
https://www.amazon.co.uk/gp/product/B07 ... UTF8&psc=1

User avatar
fechter   100 GW

100 GW
Posts: 12760
Joined: Dec 31 2006 3:23pm
Location: California Bay Area, USA

Re: Kelly controller programming

Post by fechter » Feb 10 2018 4:35pm

I've had problems with some of the USB to RS232 adapters. Seems the controller wanted a low that was under 0.5v but the adapter only pulled down to around 1v. The high level was OK. I was able to make mine work by adding a 4.7k resistor from the TX line to ground. Drove me crazy trying to figure out what the problem was.

If you have an oscilloscope, you can measure this.

If you buy the adapter from Kelly, it should be compatible.
"One test is worth a thousand opinions"

User avatar
teklektik   10 GW

10 GW
Posts: 4020
Joined: Mar 26 2011 1:15pm
Location: CT, USA

Re: Kelly controller programming

Post by teklektik » Feb 10 2018 6:15pm

Beware bad nomenclature and misnamed 'USB to RS-232' adapters that are really 'USB to TTL'.

RS-232 has +/-15V signal levels, not 0-5V or 0-3.3V.

Just because it's serial doesn't make it RS-232. The programming cables for the CA and Infineon-style controllers are USB to TTL and won't work with the Kelly which has a true RS-232 interface.

scrachdat wrote:
Feb 10 2018 12:34pm
...I have purchased a db9 to rs232 from kelly. then from amazon i purchased a rs232 to usb adapter
This doesn't really make sense. You are confusing connector types (DB9) with signal protocols (RS-232).

You need a DB-9/RS-232 to USB cable.

If you are stacking up adapters or cables to achieve this it may be that you have the Rx and Tx signals interchanged so no signal is actually getting through. This can happen with 'DB-9 to DB-9' or 'DB-9 to DB-25' adapters (if that's what you have) which sometimes are straight-thru and sometimes cross the Tx-Rx pins.
Visit Grin Technologies at www.ebikes.ca
Build Thread: 2WD Yuba Mundo V4

User avatar
amberwolf   100 GW

100 GW
Posts: 24954
Joined: Aug 17 2009 6:43am
Location: Phoenix, AZ, USA, Earth, Sol, Local Bubble, Orion Arm, Milky Way, Local Group
Contact:

Re: Kelly controller programming

Post by amberwolf » Feb 11 2018 3:23am

There's also another serial standard, rs485, that some controllers use instead of RS232. Is it possible your controller does?

scrachdat   100 µW

100 µW
Posts: 9
Joined: Dec 29 2017 6:31am

Re: Kelly controller programming

Post by scrachdat » Feb 11 2018 6:41pm

okay yeah, my bad I have been mixing those up, so this is what I have on the controller there is a sm-4a connector.
I have purchased from kelly, an SM-4a to DB9 converter.
then from this I have db9 to usb prolific chip set serial cable.

also I have tested the pins on the sm4a to db9 adapter and I don't have anything close to 15V only 5V or 4.3V

I am doubling up adapters

I will try the serial cable from kelly and see if that works. if not I will have to send the unit to china.

thanks for all the input.

User avatar
teklektik   10 GW

10 GW
Posts: 4020
Joined: Mar 26 2011 1:15pm
Location: CT, USA

Re: Kelly controller programming

Post by teklektik » Feb 11 2018 7:45pm

scrachdat wrote:
Feb 11 2018 6:41pm
I have purchased from kelly, an SM-4a to DB9 converter.
then from this I have db9 to usb prolific chip set serial cable.

also I have tested the pins on the sm4a to db9 adapter and I don't have anything close to 15V only 5V or 4.3V
Okay - so you have a KBS-X controller with the in-line pins not the plain KBS with the DB-9, correct?
My Bad - I thought you had the KBS type with the built-in DB-9.
Pulling down the KBS-X manual, I see this:

KBS-X_SerialPort.png
KBS-X_SerialPort.png (25.97 KiB) Viewed 1207 times

So - it looks like you have the proper adapter to get to DB-9/RS-232. But the voltages on the DB-9 make no sense for RS-232.

I think this is what you have (you really need to post links so we know exactly what you have...)
http://kellycontroller.com/sm-4a-to-db9 ... -1403.html
The nature of the controller connector is such that you need this adapter.

Which is meant to mate with this:
http://kellycontroller.com/pc-cable-and ... p-316.html
You got a different one and that may be the issue... (TX/RX cross-over? Real RS-232?)

Three things to check:

(1)
From the manual you should see the +/- voltages on the outer pins of the in-line SM-p connector. Try pulling off the adapter and just measure the voltage on the outer pins against Gnd (any of the RTN pins - 6, 20, 21) (careful not to short things out!). Oddly, there is no ground reference on that in-line pin set - the manual is pretty vague as to what is to be found there.

(2)
Check the voltages on pins 2 and 3 against GND pin 5 for the SM-a to RS-232 adapter. You may have done this above, but this is just to be sure that you measure against the signal ground on the connector.

DB9_pinout.png
DB9_pinout.png (3.59 KiB) Viewed 1207 times

(3)
Do the same voltage checks as (2) on the DB9/RS-232 to USB adapter on your laptop.

The important results are from (2) and (3) - with luck, the voltages will match up and these two connectors can safety talk to one another. The test in (1) is sort of a research project, so don't lose any sleep if you don't want to fiddle around with it.

All that aside, the Prolific chip set is annoyingly finicky and there are many trashy drivers that just plain don't work. ES is filled with posts about folks having issues. I personally have four sets of drivers and only one works on my laptop. Not saying that's your problem, but there's a history there...
Visit Grin Technologies at www.ebikes.ca
Build Thread: 2WD Yuba Mundo V4

scrachdat   100 µW

100 µW
Posts: 9
Joined: Dec 29 2017 6:31am

Re: Kelly controller programming

Post by scrachdat » Feb 12 2018 7:55am

Yes, correct KBSX with SM4-P for the programming cable, no DB9 connector on controller.

Test 1, without the SM-4A to DB9 adapter connected using #20 as gnd
SM4-P
1)V+, 5.52V
2)TX, 3.36V
3)RX, 4.89V

With adapter connected
1)V+, 1.79V
2)TX, 3.35V
3)RX, 1.62

Test 2 testing pins on the SM-4A to DB9 adapter pin5 as gnd, (not connected to DB9 to USB adapter.)
pin 2, 0V
pin 3, 0V

With DB9 to USB connected, (connected to USB on my computer.)
pin 2,0v
pin 3, 0v

Test 3 USB to DB9 adapter only connected to PC.
pin 2, 0V
pin 3, 0V

Controller: KBS72121X: http://kellycontroller.com/kbs72121x55a ... p-529.html
SM-4A to DB9 adapter: http://kellycontroller.com/sm-4a-to-db9 ... -1403.html
DB9 to USB adapter: https://www.amazon.co.uk/gp/product/B07 ... UTF8&psc=1

User avatar
fechter   100 GW

100 GW
Posts: 12760
Joined: Dec 31 2006 3:23pm
Location: California Bay Area, USA

Re: Kelly controller programming

Post by fechter » Feb 12 2018 9:16am

scrachdat wrote:
Feb 12 2018 7:55am

With adapter connected
1)V+, 1.79V
2)TX, 3.35V
3)RX, 1.62
Something doesn't look right there. the V+ should be closer to 5v.
"One test is worth a thousand opinions"

User avatar
teklektik   10 GW

10 GW
Posts: 4020
Joined: Mar 26 2011 1:15pm
Location: CT, USA

Re: Kelly controller programming

Post by teklektik » Feb 12 2018 11:46am

scrachdat wrote:
Feb 12 2018 7:55am
Yes, correct KBSX with SM4-P for the programming cable, no DB9 connector on controller.
....
Okay - thanks for the links - the devil is in the details and that clears up some things.

So - although I have no experience with the Kelly specifically, I can comment on the serial interface. Here's some thoughts:
fechter wrote:
Feb 12 2018 9:16am
scrachdat wrote:
Feb 12 2018 7:55am

With adapter connected
1)V+, 1.79V
2)TX, 3.35V
3)RX, 1.62
Something doesn't look right there. the V+ should be closer to 5v.
Concur. This doesn't look right at all.
Starting at the beginning:
scrachdat wrote:
Feb 12 2018 7:55am
Test 1, without the SM-4A to DB9 adapter connected using #20 as gnd
SM4-P
1)V+, 5.52V
2)TX, 3.36V
3)RX, 4.89V
This looks good - controller seems ok.
I would expect the converter to use one of the Maxim, TI, or clone chips which can take 6V to run voltage doublers giving as much as +/-12V for the RS-232 signals.
  • Pin 1 is a bit under 6V so looks good.
  • Pin 2 is not unreasonable for an output - lower than I might expect, but ok
  • Pin 3 probably has a pull-up on it to 5V for TTL current sinking input and so looks fine
scrachdat wrote:
Feb 12 2018 7:55am
With adapter connected
1)V+, 1.79V
2)TX, 3.35V
3)RX, 1.62
This looks bad.
  • Pin 1 (the power supply) has been dragged down to an inoperably low level by the adapter electronics. This suggests the adapter is drawing huge current and is pretty sick.
  • Pin 2 (adapter input) is probably pretty high impedance and doesn't affect the pin at all. Ok.
  • Pin 3 (adapter output) is at a rather indeterminate logic level - clearly not working properly - not surprising considering the low power supply voltage on pin 1.
scrachdat wrote:
Feb 12 2018 7:55am
Test 2 testing pins on the SM-4A to DB9 adapter pin5 as gnd, (not connected to DB9 to USB adapter.)
pin 2, 0V
pin 3, 0V
Not good, We expect the TX pin to be 'marking' at about -10V to -12V. The lack of output voltage suggests the voltage doubler inside the chip is not running which fits with the observation that the power supply is being dragged down to an unworkably low level.

Looking at your remaining readings, I would expect to see the same marking -12V on the TX out pin of the RS-232 to USB adapter, but that might be the result of an unhappy driver, so it's a little harder to draw conclusions; although it doesn't look right, it might be explainable.

It looks to me like you purchased the proper controller to RS-232 adapter and what appears to be an ok RS-232 to USB adapter. That said, the controller to RS-232 adapter looks dead to me. It appears to have a JST-SM 4p polarized connector so there's no chance of plugging it into the controller incorrectly. RS-232 inputs/outputs can tolerate dead shorts and +/-25V without damage so it's essentially impossible for your USB to RS-232 adapter to have harmed it. It was quite likely dead on arrival.

I really wouldn't like to venture anything about the PC-side adapter - the outputs look suspicious, but perhaps explainable.

I would recommend contacting Kelly, pointing them at this thread (or copy your voltage readings, etc in the email) and request a replacement SM-4p to RS-232 adapter. In my opinion yours is damaged - in fact, I wouldn't recommend leaving it in the controller and powered up judging by the way it's loading down the controller 6V supply voltage.

As always - different views may be out there, but that's all I can surmise from simple voltage readings (those helped a lot, BTW).

Anyhow - just some thoughts. Hope this helps.
Visit Grin Technologies at www.ebikes.ca
Build Thread: 2WD Yuba Mundo V4

scrachdat   100 µW

100 µW
Posts: 9
Joined: Dec 29 2017 6:31am

Re: Kelly controller programming

Post by scrachdat » Feb 15 2018 11:01am

Kelly have confirmed that these voltages are incorrect.
5.52V or 1.79V is not right.

When the controller is powered,please measure the voltage between pin11 and Ground.
Please measure the voltage from pin4 or pin5 to Ground also.
I am now under the impression that the controller is faulty as it will not run my motor either, it keeps throwing out hall sensor problem, 4, 2, with one motor and it used to say that with old motor and changed it's mind to an electrical RPM problem 2,1

scrachdat   100 µW

100 µW
Posts: 9
Joined: Dec 29 2017 6:31am

Re: Kelly controller programming

Post by scrachdat » Feb 16 2018 11:32am

Success, after a response from kelly they, told me to apply 12V across the SM-4P connector and then the controller was able to communicate with the computer.

so controller must be faulty and the problem was there wasn't enough voltage coming from the controller to power the connection.


Thanks for everyones help! :)

jumpjack   100 W

100 W
Posts: 184
Joined: Apr 11 2011 6:16am

Re: Kelly controller programming

Post by jumpjack » Mar 20 2018 3:41am

Some important general notes on programming Kelly controllers:
- each Kelly controller family (KHB, KEB, KBS,...) requires its own specific PC adapter; a generic RS232/usb adapter is NOT always the right choice: check the controller manual and page;
- not all USB/serial adapters work properly; the ones from "prolific" are known to be hard to work, due to drivers specifically designed by prolific NOT to work with clone products; some drivers can even irreversibly damage a not-genunin Prolific USB/serial cable! Use the USB/serial cables provided by Kelly itself.
- its "said around" that althoug Kelly controllers are rated 10-30V or 8-30V or 18-72V, they "usually work better if powered by 18-24V"
- NEVER attempt programming a Kelly controller while motor is running; even better, disconnect high-voltage battery while programming.
- Kelly manuals also recommend to:
* install program in C: drive
* disable antivirus before launching program

Post Reply