Single Motor Hall Sensor Wire as Speed Signal

tmort

10 W
Joined
Jul 3, 2008
Messages
83
I have seen some mentions of this in other posts about Hall sensors, but I haven't found a post just about this. Some of the other comments make sense and others don't so I thought I'd do a post just on this subject.

I am setting up an older ebike that has a good motor with a new controller. The new controller has six wires on the Hall connector and the white one is for a speed signal. I guess some bikes have four Hall sensors and one is a dedicated speed sensor and the other three signal the position and the controller uses that to know which phase wires to energize when.

So my question is can I take one of the Hall wires other than the red and black one out of the connector and replace the terminal and add another short wire and terminal and jump this wire to the vacant spot on the motor side Hall connector housing to provide a signal to the white wire?

I've read you can do this, but I've seen some things about having to add a resistor and other things about it will only measure speed when the motor is running.

This controller works with a display and the display has a switch which turns the controller (and display) on and off. The speed shows up on the display. I think the other poster meant to say the speed will only be displayed when the controller is on and not the motor. The Hall sensors all have a +5V and a ground wire and the third wire is the signal which passes from the transistor when the magnet switches it. So while there will only be a signal when the wheel is moving, the Hall sensors will all have power whenever the controller is turned on (assuming it is hooked up right). As for the stuff about needing to add a resistor, I think that may have been something specific to the particular system they were discussing.

Well that is my understanding anyway. I won't have this all together for a bit anyway, so I thought I might as well post it.

This controller also has another pair of wires for a "speed sensor" of the coil and magnet on a spoke variety. I do have an old wired sensor I can use, but I'd like to keep the number of wires and things that can get caught on things as low as I can. I also want to mount this on the chainstay. The controller fits in a small compartment on the frame by the bottom bracket so I have plenty of wire and that location is more out of the way. But if I can just use the Hall wire method that would be one less wire.

The sensor I have was used and is probably for a front fork. I don't know how well it will work on the chainstay. The only way to adjust the distance from the sensor to the coil is by where on the spoke you mount the magnet. I suppose it will work.

That sort of leads to another related question. I have another bike with a Bafang BBSHD mid drive. It uses a chainstay mounted speed sensor. It can be adjusted in and out. It also has a three pin connector on it, so I assume it uses a Hall sensor rather than a coil to get the signal pulse. It won't work directly, but it seems like if I tie into some other +5V from the controller when it is on (throttle, brake, etc) I could use this and the ground wire to power it and the remaining pin would be the signal pulse and I'd hook that to the non-ground wire of the speed sensor connector on the controller.

I don't have one of those sensors and they cost almost $20 and my other options are free so I'm not looking to do that, but I figured it ties into this discussion.

So I may or may not be right about this, please let me know. Thanks.
 
tmort said:
I am setting up an older ebike that has a good motor with a new controller. The new controller has six wires on the Hall connector and the white one is for a speed signal. I guess some bikes have four Hall sensors and one is a dedicated speed sensor and the other three signal the position and the controller uses that to know which phase wires to energize when.
So...why exactly do you need to skip using the actual speed sensor, and use the position sensor instead? It's a lot less complicated to use the speed sensor meant for the purpose, if there's no problems with it, and it's more reliable and will work whether or not you're using the motor to propel the bike.

Perhaps you meant to say (but didn't ;) ) that your particular motor does *not* have the speed sensor built in?

So my question is can I take one of the Hall wires other than the red and black one out of the connector and replace the terminal and add another short wire and terminal and jump this wire to the vacant spot on the motor side Hall connector housing to provide a signal to the white wire?
Do you mean, use one of the motor hall signals for the speed sensor, instead of (or in addition to) using it as a signal for the controller to determine motor position?

If you are using a sensorless controller, then yes, you can. But (assuming you use the position sensor only for speed sensing) now you aren't using it for the motor position sensing, and you then have a typically less reliable and often noisier startup of the motor each time, since the controller cant' tell even which way the motor is spinning until it starts spinning--with the position sensors it can tell before it starts moving it which way to try to start doing so.

If you're sharing the sensor for both purposes, then it should still operate normally in sensored mode.


As you note, if it is a geared hubmotor you will only have a valid speed reading if the motor is running fast enough to be pushing the wheel; if it's running even a tiny bit slower than the wheel then you are only reading motor speed, not wheel speed; it's not always that easy to tell if this is the case when you are not actually accelerating, or climbing a hill, etc., so if you need to be sure of your wheel speed, this method wont' be a truly reliable way to do that. You also need to know the number of magnet poles and the gearing ratio between motor and motor casing, to put into the speedometer setup as a multiplier for how many times the magnets pass the sensor vs the number of times the wheel itself spins.

If it's a direct drive hubmotor, then it's always the same speed as the wheel, so wheelspeed is the same as motor speed, whether motor is running or not. You only need to know the number of magnet poles for this type, as there is no gearing.


The built in speed sensor usually has eitehr just a single magnet (so no multipliers needed for the speedo settings) or it uses six of them. I have yet to run into any other numbers, though I'm sure something out there is different. So you just hookup the built in speed sensor to the speedo input of the controller, and set your wheel size. If the speed is correct, you're set. If not, set the multiplier to six, and it will probably be right at that point. If it isn't, then try three (in case they used half the magnets they could have). Or check the speed with a phone GPS app and then divide the speed you see vs the gps speed and use whatever the closest whole number is to that as the divider.


This controller works with a display and the display has a switch which turns the controller (and display) on and off. The speed shows up on the display. I think the other poster meant to say the speed will only be displayed when the controller is on and not the motor.
Depends on the kind of motor--only DD hubs will do it the way you describe (geared hubs won't unless the motor is running). See my previous explanation.


The Hall sensors all have a +5V and a ground wire and the third wire is the signal which passes from the transistor when the magnet switches it. So while there will only be a signal when the wheel is moving, the Hall sensors will all have power whenever the controller is turned on (assuming it is hooked up right).
It's not when the wheel is moving. It's when the *motor* is spinning fast enough to push against the wheel, meaning when it is trying to spin faster than the wheel. (assuming a geared hubmotor).

As for the stuff about needing to add a resistor, I think that may have been something specific to the particular system they were discussing.
That depends on the input stage of the controller for it's speed reading input. The built-in speedo output may (probably does) already have the pullup resistor built into it at the motor itself. The position sensors typically do not--the controller has them inside it on the motor hall wiring inputs. So to use a position sensor you probalby have to install a pullup resistor (1k-10kohm) between the signal wire and the 5v line, at either end of the signal (motor or controller).

If you are sharing this position hall sensor between position sensors and speed signal inputs on the controller, then you don't need the resistor because it is already built into the controller. But if you are using it only for the speed signal, it probably doesn't have the pullup in the controller and you'd need to install one.


That sort of leads to another related question. I have another bike with a Bafang BBSHD mid drive. It uses a chainstay mounted speed sensor. It can be adjusted in and out. It also has a three pin connector on it, so I assume it uses a Hall sensor rather than a coil to get the signal pulse. It won't work directly, but it seems like if I tie into some other +5V from the controller when it is on (throttle, brake, etc) I could use this and the ground wire to power it and the remaining pin would be the signal pulse and I'd hook that to the non-ground wire of the speed sensor connector on the controller.

The frame mounted sensor must be adjusted and kept adjusted to work correctly, depending on design and riding conditions they can become unaligned, or the magnets can fall off or move on the spokes, and then you have no signal or an unreliable / invalid one.

The built in speed sensor in the motor typically "just works", so if you have one, I'd do that. :) Using the position sensor is a second best alternative.
 
I hadn't mentioned that it was a geared motor, I'm more familiar with direct drive ones, but it in fact is a geared motor, so the speed and odometer from a hall signal will probably be incorrect. I hadn't thought of that.

I was planning on using one of the hall wires to in addition to providing a position signal along with the others to also serve as a speed or rotation signal. The motor does not have a speed sensor hall sensor, just the tree position sensors.The controller has a sixth white wire for a dedicated speed sensor.

Since this is a geared motor I might as well just go with the frame mounted coil and magnet. It's easy enough and the wires will be out of the way. I'll get a true wheel rotation measurement. The setup on the display only asked what wheel size it was. There were lots of sizes to choose from, so I suppose if I knew the gear ratios I might be able to do the math and figure out what size so specify, but as it is I don't even know what brand/model the motor is. The writing on the label on motor is not legible.

That does clarify a lot of things involved in this. Thanks.
 
tmort said:
I hadn't mentioned that it was a geared motor, I'm more familiar with direct drive ones, but it in fact is a geared motor, so the speed and odometer from a hall signal will probably be incorrect. I hadn't thought of that.

It'll be correct anytime the motor is actually pushing the wheel and that wheel's tire is on the ground.

Any other time...Maybe, or no. :)


I was planning on using one of the hall wires to in addition to providing a position signal along with the others to also serve as a speed or rotation signal. The motor does not have a speed sensor hall sensor, just the tree position sensors.The controller has a sixth white wire for a dedicated speed sensor.

Then you only need to tie, at the controller itself, the speed signal input wire to any of the three position sensor wires. You can do it directly inside the controller on the solder pads for the wires if you like, by pulling the speed sensor wire into the controller, and soldering the unconnected end to whichever motor hall sensor you want to use.



Since this is a geared motor I might as well just go with the frame mounted coil and magnet. It's easy enough and the wires will be out of the way. I'll get a true wheel rotation measurement. The setup on the display only asked what wheel size it was. There were lots of sizes to choose from, so I suppose if I knew the gear ratios I might be able to do the math and figure out what size so specify, but as it is I don't even know what brand/model the motor is. The writing on the label on motor is not legible
.

If the display only gives standard sizes, with no way to custom enter an extreme value, and also has no way to enter a multiplier, you probably cannot use the position sensor as it would require a wheel size many times different than any available "real" size. Or else you'd have to do the math in your head whenever you read the speedo (assumign it can even display a speed as high as you'd get without the magnetpoles/gearing multiplier value in there).

Typically you'll have upwards of 20 or more magnet poles, and a gearing ratio of 4 or 5 or more. If it was 20, and 4, that's a multiplier of 80. So unless there is a wheel size listed that is eighty times the size of the actual wheel you're using.... ;)

So I think you only have the option to use the external sensor.

Well, there is one more, but it's complicated: If you open the motor and find it has a board in there with a spot for a sensor near the cover, and spots on the cover for magnets, you could see if the sensor can be removed from the frame-mounted sensor and glue it to the board in there where the sensor was meant to go, then wire it to the motor halls for power and ground, and run a wire thru the axle (if it doesn't have a spare wire in the harness already) for the speed signal. Then glue the magnet from the spoke-mount into the spot on the side cover.
 

Attachments

  • IMG_20200620_145737546[1].jpg
    IMG_20200620_145737546[1].jpg
    208.4 KB · Views: 374
I'm thinking in this case, maybe in the case of all geared motors this may be why the manufacturer didn't include a fourth speed sensor hall sensor. On the other hand I've seen direct drive motors that use halls that don't have the sixth wire either.

I was thinking I could turn the whole thing into a science project too. Count the pulses from one hall sensor wire and the pulses from the frame/wheel mounted sensor. Mainly though I just want to get this bike on the road with the minimum amount of effort.
 
tmort said:
I'm thinking in this case, maybe in the case of all geared motors this may be why the manufacturer didn't include a fourth speed sensor hall sensor.
Geared hubs commonly specifically do have the separate speed sensor in order to get around the speed sensing issue with using position sensors instead.

I don't see many that don't have it, most of them are at least several years old or more. (the newest one I have that doesnt' have a speed sensor is over a decade old, maybe 12-13 years or more).

The pic above is a Jump bike geared hub, made by Bafang. The speed sensor hall is the one on the curved board that faces the camera. The position sensors are on the outer curved edge, all you can see in the pic is the solder joints connecting them to the PCB.

On the other hand I've seen direct drive motors that use halls that don't have the sixth wire either.
I've not so far seen a DD motor that has a separate speed sensor. Might be some, but so far everything I've seen, if they have an extra wire it's for a thermal sensor.
 
The best argument for using an internal or external speed sensor on a geared motor is that while you can calculate speed off the Hall sensors, you lose that info when coasting.

One of the more popular kit sellers, ebikeling, sold controllers/displays for years and years that could not give you speed on their geared motors when coasting, I guess he didn't care, with all the sales coming in, I believe he fixed that.

I prefer KT controllers. The first parameter they ask for is the magnet x gears product, P1. I believe they use P1 to calculate speed off the hall sensors when the motor is running. Then if the hall signal goes away, and if P2 is set, they switches to the speed sensor. I say that because if I change P1, the speed changes, so they do use it even with a wheel speed sensor. It probably saves on CPU cycles in the microcontroller,
 
Back
Top