VESC - Reversing a sensored motor

My motor is turning in reverse and I can’t find a way to change the direction in software. (besides using the nunchuck in reverse).

I’ve tried swapping phases (which works for reversing), but the hall sensor detection always fails now. I think I’ve tried all the permutation of swapping the hall sensor wires and it always fails.

Any idea how to reverse direction, besides mounting the motor on the opposing wheel ?

It seems like it should be possible in software - if I can do it from the nunchuck.

Im not really a VESC expert but I’ll try to help.

Put the phase wires in the way you say detection works. Turn off power, unplug vesc from computer. Flip outside phase wires. Turn vesc back on, plug in and connect. Try detection again.

Again, I’m no VESC expert but it worth a try.

Edit - From VESC Tool: Z-Button: The Z-button is used to change the direction of the motor if reverse is activated. Without reverse, Z has no effect.

Edit 2: Make sure control mode is disabled. You may have it on, and forgot to change it. (App config, PPM) make sure to write config and then reboot the VESC.

Sadly the sensor inside the motor are possibly badly place, they are probably too far from the stator, or in a small angle, that could lead them to work in one direction but not the other. :worried:

You can open the motor to see if you can move the sensor, but they are most likely to be pot in epoxy.

I guess to best outcome, is to change the side of the motor, or just run without sensor.

@JLabs how do you know which one are the outside phase wires ?

There is a black, a blue and a yellow wire.

It will go in reverse with Z activated, but I would like to avoid pressing Z all the time.

I’ll try all the suggestion, and eventually switch motor side if nothing works.

The black is the ground… the red is the 5V… and the 3 other are sensor (they are automatically detect if your using a vesc) you don’t have to know witch one is witch. But you can still try to move there position, to see what can happen

You can pretty easily swap the sensor wires (which I imagine is much easier/less likely to break something by opening the motor). Each phase has a corresponding sensor wire. In the image below, the sensor wires plug into the holes on the top left of the board on the left. Going left to right, you can see a 5V, TEMP, H1, H2, H3, GND. That’s the sensor’s 5V, Temp sensor, corresponding hall sensors, and the ground. The corresponding phase connectors, going from left to right on the bottom of the board on the left are P1, P2, and P3.

So plug in your phase wires so that the sensor detects correctly, then swap 2 phase wires (to swap the spin direction) and swap the same (corresponding) sensor wires. ie. If you swap the wires connected to phase 1 and phase 2, then swap the sensor wires H1 and H2.

Edit: if you’re adamant about no hardware changes, you could swap the port configuration (what physical pins on the processor correspond to what function) in the firmware, essentially swapping the sensor wires.

1 Like

@JohnnyMeduse I was talking about the phase wires. not the hall sensor wires

@rpn314 I tried, from my configuration that works

to swap the outer phase cables, and also swap the outer hall sensor cables (that should make sense right ?)

but it failed

anything that could explain that ?

I’ll be trying again

Sorry my bad… but still unlike other esc vesc is mde to automatically detect the motor and sensor… also if the problem is inside the motor there only little you can do

@JohnnyMeduse it’s unclear why it would be a physical issue in the motor.

but so far no luck switching phase and hall sensors.

it seems like it should be a really simple software fix though.

Sensor are suppose to be place at certain range (generally glue directly to) of the stator, if the are too far or badly place, they might only work in one way if the magnetic field is strong enough

@JohnnyMeduse why does everyone else seem very intent that changing phase & sensor wire will work ?

Here is my methodology right now :

hall sensor & phase wires H: blue green yellow & P: black yellow blue WORKS (reverse) reboot H: blue green yellow & P: yellow black blue DOES NOT WORK reboot H: yellow green blue & P: yellow black blue DOES NOT WORK reboot H: green blue yellow & P: yellow black blue DOES NOT WORK reboot H: blue yellow green & P: yellow black blue DOES NOT WORK

Is there a point trying the other combination of phase wire swapping ?

You can switch two phase wires, but then you need to do motor detection again and apply.

@psychotiller so retry what I just posted above but hit apply every time after I do detect ?

Yup! You have to apply and write every change you make or they take no effect.

@psychotiller I tried your methodology, no improvement :

H: blue green yellow & P: black yellow blue WORKS (reverse) reboot (didn’t have to actually write this one, detect worked on the first try)

now swapping phase wires :

reboot detect, apply, write, reboot H: blue green yellow & P: yellow black blue DOES NOT WORK reboot detect, apply, write, reboot H: yellow green blue & P: yellow black blue DOES NOT WORK reboot detect, apply, write, reboot H: green blue yellow & P: yellow black blue DOES NOT WORK reboot detect, apply, write, reboot H: blue yellow green & P: yellow black blue DOES NOT WORK

Back to the original one, and it works, without detect / apply / write. H: blue green yellow & P: black yellow blue WORKS (reverse)

Am I missing something ?

because in 99% of the case that works, motor will reverse is direction and sensor will work. But there always this 1% that won’t work.

That’s good to know, weird that I landed on the “magical combination” of H and P first.

After fiddling for the wires for so long I questioned the contacts, but I can always go back to the one that works.

It’s tempting to look at the firmware since software is what I’m most comfortable with. But seems way more dangerous than mirroring my mount.

Edit: @JohnnyMeduse @JLabs is it possible that the hall sensor is damaged and will give out on me at some point if it has this weird behavior ?

Hall sensors aren’t complicated; if it works to detect spin in one direction, it should work the other. I think maybe you’re adding too many variables by monkeying around with the sensor wires in between detection tests.

Maybe a silly question but have you tried changing the phase wires to, say, black yellow blue (or black blue yellow) while leaving the hall sensor wires in the default configuration? When you say “DOES NOT WORK”, are you saying that auto detect doesn’t detect the motor spin direction, or that the motor doesn’t spin?

If there is a problem with the hall sensor / wire connections within the motor, you ought to be able to find it with a multimeter (spinning the can by hand). I can give you a quick synopsis on how to open that motor up if a wire is loose at the hall sensors.

But before you do that, I think you need to hold one variable constant (in this case the hall sensor wires) and make sure you’re testing without incorrect auto-detect presets in order to isolate the failure point. If you already did that above, that I apologize.