Problem with Kunteng Controller / EggriderV2 / Bafang Speedsensor

Pegazus

100 mW
Joined
May 18, 2019
Messages
45
Hi everyone,

I'm struggling with an annoying problem and I'll explain it to you to see if anyone have a solution.

I'm equipped with :
- Bafang G310 from GRIN (great motor by the way!),
- EggriderV2 display
- Kunteng Controller (12 MOSFETS, 48V sinwave).

I'm adding a Bafang speed sensor to be able to read the speed at any moment.

https://www.bafang-e.com/en/oem-area/components/component/sensor/sr-sd02101/

My plane was to connect the white wire from the motor cable to the Bafang sensor and power the speed sensor with the power supply of the throttle.

I connected everything as planned, set the P2 (wheel speed pulse signal) = 2, I played with a magnet around the sensor, I noticed with a voltmeter that the sensor ouput was alive, but... nothing on the display !

More surprisingly, when I moved the throttle, the Eggrider started to display the speed without the white cable connected...

What could be wrong ?
 
Pegazus said:
My plane was to connect the white wire from the motor cable to the Bafang sensor and power the speed sensor with the power supply of the throttle.
what is the white wire from the motor?

if it is indeed a speed sensor itself, as is common, you would not want to connect it to *another* speed sensor, you would wnat to use it directly. it is probably already powered by the hall power supply, if the motor has hall sensors. if not, then you can use the throttle or hall power from controller to power that sensor, as it will have it's own power supply wires.

if it is a thermal sensor, as is also common, you would not want to connect it to any speed sensor or indeed any other thing besides a thermal sensor input on a display or controller system.


so...since we don't know what you actually have or what connections are available to you, you must give us complete exact details of the system including all involved wires and what voltages or signals are on those wires.

we can guess that if it is standard from grin, unmodified,
https://www.ebikes.ca/shop/electric-bicycle-parts/motors/geared/mg310-std.html
https://www.ebikes.ca/product-info/geared.html
then the white wire is a speedo
Internal Speedometer Sensor: The motors have a 6 pole speedometer built into the motor shell, allowing the use of a Direct Plug Cycle Analyst for speed readings rather than requiring a -DPS device with separate spoke magnet and speed sensor.
and it also has halls, so the sensor is powered from them
Z910MotorPinout.jpg

Z910 HiGo Plug PinoutThese motors are terminated with a waterproof HiGo Z910 overmolded connector which has the convenience of phase and signal wires in a single plug. However, it does not allow for the user to play around with hall and phase pinouts which is often required when pairing with a 3rd party motor controller. Fortunately most controller and motor vendors using this connector have chosen a compatible pin configuration. The 6th signal wire is used for the speedometer, which pulses 6 times per wheel revolution.

if the above is not correct, you will have to tell us exactly everythign you actualy have there.



I connected everything as planned, set the P2 (wheel speed pulse signal) = 2, I played with a magnet around the sensor, I noticed with a voltmeter that the sensor ouput was alive, but... nothing on the display !

More surprisingly, when I moved the throttle, the Eggrider started to display the speed without the white cable connected...

What could be wrong ?

you don't say exactly how you connected the sensor, and you also have a lot of other potential problems to clear up (see the section at the top of this post).

the most likely thing based solely on what you've said in the quote above is that you have connected the throttle output signal to the speed sensor signal, so the eggrider is reading the throttle voltage as the speed.

that probably means that the eggrider doesn't actually count pulses, but instead integrates pulses over time to create a voltage for it to read and then display, which seems odd since pulse lengths won't always be the same between different kinds of sensors and magnets and whatnot, so would require a calibration setup within the eggrider for this, that would have to be done on every single installation.
 
I'm removing the speedo sensor from the G310 from GRIN for 2 reasons :
- I want to get the speed of the bike when the motor is off (DH for example)
- I want to add a temp sensor to monitor the motor temperature as described here by Justin (https://endless-sphere.com/forums/viewtopic.php?f=2&t=92124&start=50)

The white wire from the motor is the speed sensor. I was referring to the wires colors of the Kunteng controller.

The throttle output wire is well connected to the throttle connector of the controller.

Even when P2 = 0 I'm still able to get the motor speed, what ever the speed sensor is, internal ou external ! Speed value has been check with my GPS !
 
Pegazus said:
I'm removing the speedo sensor from the G310 from GRIN for 2 reasons :
- I want to get the speed of the bike when the motor is off (DH for example)
the speed sensor in the motor is on the shell, so it will detect speed regardless of mtoor state (even if motor was removed from shell somehow)

using a hall sensor for speed will instead detect the motor speed only, not teh wheel speed.

- I want to add a temp sensor to monitor the motor temperature as described here by Justin (https://endless-sphere.com/forums/viewtopic.php?f=2&t=92124&start=50)
for that, yes, you eiher have to disconnect the speed sensor from the wire and connect the thermal sensor instead, or you have to somehow get another wire thru the axle. ;)

The white wire from the motor is the speed sensor. I was referring to the wires colors of the Kunteng controller.
ah, well, your post said motor cable, which implies the cable from the motor unless otherwise specified. you must be exactly specific about exactly what you mean or we can't know what you mean. we can only guess based on what exactly you tell us.

The throttle output wire is well connected to the throttle connector of the controller.
whcih does not mean that it is not also connected to the speed sensor, because you still haven't said exactly how you wired everything up.

if you do not tell us exactly what you did, wire by wire, etc., we cannot determine if the problem is with your wiring or with some other part of the system.

Even when P2 = 0 I'm still able to get the motor speed, what ever the speed sensor is, internal ou external ! Speed value has been check with my GPS !
motor speed, or wheel speed?

do you mean that even though your throttle also causes it to register a speed just by moving the throttle, it also detects the speed from a speed sensor?

your original post says that
when I moved the throttle, the Eggrider started to display the speed without the white cable connected...
which implies that the throttle signal itself is connected to the egrriders speed input and that you don't have any other speed sensor connected to that input, and the eggrider is interpreting the throttle input as a speed input.

if that is not the case, you must

describe exactly wire by wire how you have each thing connected,

and exactly step by step exactly what you do to test something

and exactly step by step exactly what you see for each step of each test.

if you don't do that then we can't know what you have and hwat you are doing and what you are seeing, and thus we can't determine what the problem is.

you must be precise and clear; presently it's confusing to read what you say you've done and is happening, because it doesn't make sense.
 
Sure here are more details :

diagram.jpg

The problem might come from the controller.

I spied the Tx wire from the controller to the display and bit 3 and bit 4 are empty when P2 is not equal to zero. It is consistent with the fact that I never had any speed display with the external or the internal speed sensor. There must be a way with hall sensor may be and others data to recompute the speed when the controller is configure not to use speed sensor.

I only have speed indications on the display when P2=0 and indeed B3 and B4 alive at that condition.

View attachment S12SN_to_LCD3.txt
 
Pegazus said:
Sure here are more details :

diagram.jpg
the diagram is incomplete and missing necessary connections for us to figure out what is happening.

according to that diagram, assuming that red is 5v and black is ground, you have the new external speed sensor wired directly and only to the throttle power and ground, and then to the throttle connector on the controller. there isnt' a throttle signal wire connected anywhere, and you say the throttle works, so that can't be the case.

it also does not show a signal wire from the external speed sensor, but you say you read speed from it, so it must also be connected somewhere.

if the two signal wires are in parallel as well, and go to the throttle input, then the speed sensor input woudln't have a connection, or else it would also have the throttle voltage input as well.



presumably the diagram does not show a signal wire from the motor speed sensor because it's not in use right now, but it would be helpful if you show where you used to connect it, exactly.


The problem might come from the controller.
is the controller what sends the speed signal to the eggrider?

if so, does it have a specific connector for a speed sensor input, or is it only using one of the motor hall signals inputs for this?

or does the eggrider have it's own speed signal input?

the eggrider connections do not appear to be shown on your diagram, it appears to strictly be controller connectors.



I spied the Tx wire from the controller to the display and bit 3 and bit 4 are empty when P2 is not equal to zero. It is consistent with the fact that I never had any speed display with the external or the internal speed sensor.
This is confusing.

do you mean instead "never had any speed display with the external or the internal speed sensor. when P2 was set to a nonzero value"?

if that's the case then maybe p2 is a parameter to disable speedometer readouts from external sensors, and only allow the internal motor halls to generate that signal. and if so, p2=0 simply means use a single pole speedo sensor, for just one magnet on the wheel? and p2=(anything above 0) means however many poles the motor halls see? either directly or via some conversion chart in the manual?

or do you instead literally mean "never had any speed display with the external or the internal speed sensor."

if that's the case, then that conflicts with your previous post that said "Even when P2 = 0 I'm still able to get the motor speed, what ever the speed sensor is, internal ou external ! Speed value has been check with my GPS " which implies by "even when" that regardless of the setting of P2, you do get a speed reading with either internal or external speed sensor, and "Speed value has been check with my GPS" implies that the reading is correct since it does not say that the speed was wrong in either case.

so again, you need to clarify exactly, step by step, what you are doing, what you are testing, and what your results are for each step as you do them.

without that, the bits and pieces of what you *are* telling us are confusing and appear to be conflicting with each other.

you also still need to answer the questions that have been asked previously.


There must be a way with hall sensor may be and others data to recompute the speed when the controller is configure not to use speed sensor.
i don't know exactly what you mean, but if you mean that it can use a motor hall sensor for speed sensing, it's possible. i don't know if it is designed to do it or not, but the motor hall produces exactly the same kind of signal as a hall sensor based speed sensor, except that with your geared freewheeling hubmotor, it only senses the motor speed, and not the wheel speed (whcih are the same as long as the wheel does not spin faster than the motor).

if the controller is not designed to use an external sensor or an in-hub non-phase hall sensor like the G310 has available, and is only designed to use a motor phase's hall sensor, then you would have to set the controller to sensorless mode, if it has one, and disconnect the hall sensors of the motor from the controller. then connect whichever other speed sensor you wish to use to one of those hall sensor signal lines on hte controller (whichever one is used to detect speed; may have to be determined experimentally).

If the controller does not have a sensorless mode, or you don't want to use it for whatever reason, but it only takes speed readings from the motor hall inputs, then you cannot use an external sensor with that controller, and would require a different one that does take speed readings from a separate input to do that.


If instead the eggrider has it's own speedo input, simply connect your sensor to that, and set it's internal settings for the right number of poles and correct wheel size, and it should then work. If it doesn't have it's own input, then it is getting it's info from the controller, and you'd have to do something like the above to make it work.


I only have speed indications on the display when P2=0 and indeed B3 and B4 alive at that condition.
I don't know what these parameter values mean, or which value you should have there.

but as long as you are using the external speed sensor, and if it only uses one magnet, you should use whatever parameter is for number of poles of speed sensor set to a value for a single pole.

if you are using the motor speed sensor, it has six poles, so the parameter must be set to whatever it should equal for that.

if it does not have the ability to change the number of poles of the speed sensor, then you would instead have to divide the wheel circumference by that number of poles, and input that new smaller wheel circumference, to get the right speed displayed.


a note here
https://endless-sphere.com/forums/viewtopic.php?p=1520165#p1520247
says
Set P2 = 1 on the lCD and the controller will use the external speed sensor input. Then the value of P1 will not be used and it can be anything.
so since you've tried setting p2=0 and p2=2, maybe instead try p2=1 for the new external sensor (or the one in the motor)?
 
Problem solved.

I changed P3 from "Speed control / PAS Gear Ration" to "Torque / Max power" and then I was able get the speed indication on the EggriderV2 !

Still don't understand why but if it can help some Eggrider/Kunteng owner, it's a solution that worked for me :)

By the way thanks for your support !
 
Back
Top