How to get active parking brake

Anyone know how to get good parking brake? I want the motor to actively resist any movement. In FOC mode, the braking is just nonexistent in the lower speeds.

BLDC mode braking is a lot better - but the motor doesn’t spin very well in that mode. It can’t detect the hall sensors (which it can in FOC mode) and so it only goes sensorless and makes the motor louder than when spinning in FOC mode.

I’ve heard that the kind of braking I’m looking for is achieved by shorting the 3 motor phase wires which can be accomplished via code. Though, in my quick search, I can’t find any tutorial or documentation on programming for VESC-Tools (granted I didn’t look long, I may have missed it).

Anyone have any advice? Thanks!

4 Likes

there isn’t a way to do motor locking in vesctool afaik (maybe in command terminal, but not many are expert in that level), probably in the future tho

maybe im wrong and it exist already somewhere after fw5.2 which i haven’t catch up on

2 Likes

You would have to use encoders instead of hall sensors

2 Likes

I just started fucking around with skate motors and 8K encoders on machinery and damn that response is fucking crisp :ok_hand:

5 Likes

Honestly? Don’t overcomplicate it. A physical brake is always better than an electrical one. Case in point:


(Not my pic)

Just chock it up with something small when you’re parked, and remove it when you’re ready to go.

2 Likes

Just put your remote there :grin:

4 Likes

A “hold” mode would be cool.

The beta 6.0 firmware using silent hfi can track motor position and hold it in place like an encoder would. It’s pretty amazing:

While that feature is not built into the throttle modes, here are a few ideas to implement it:

Take a look at the smart reverse code and modify it to position hold rather than slowly backup

Modify that code to monitor erpms and apply current in either direction to “erase” that movement. IE, it moves 20 erpms forward, apply current until it moves 20erpms backwards and modulate current to hold erpms at 0 change.

To use, you could hold full brake and hit the cruise button.

3 Likes

So a position PID?

5 Likes

I saw a skateboard review that had active braking on a board. The guy stood on it on an incline and the board didn’t budge.

This is important to me for other projects as well. But the idea that I have to get off the board and put my foot down so I don’t go rolling down a hill just turns me off. Imagine driving a car with brakes that barely worked once you slowed down!

I’m making an all-terrain board with foot straps, last thing I need is to feel like I can’t trust my own brakes.

It’s what I’m hoping to do… I finally found something useful that could help:

There’s a function called “mcpwm_foc_set_handbrake” which has a comment saying it emulates an electric handbrake. I’ll have to check it out, see if I can use this function or code something similar.

I’m away from my motor for the next few days, but I’ll see what I can do when I’m back. There’s no documentation at all to read, but at least the code is well commented.

It’s sad that this kind of braking is such a selling point for the board I mentioned earlier, shouldn’t be so difficult.

I’ll be sure to provide info when/if I get the level of braking I’m looking for.

Honestly, I sometimes put the motor on DC mode just to feel that insane braking ability. Put the current up to 100a and it takes all my strength just to budge it. You can just feel the coils and magnets repelling each other so forcefully the motor doesn’t wanna move. Granted it’s not how it should be braking, but feeling it makes me motivated to make it happen.

3 Likes

I wonder if PID set position might work for the handbrake?

1 Like

That’s lingyi esc who has this function, but it’s actually not as perfect as u might think. If u stop on a slope, the board will appear to not be moving, but it’s actually cogging, the steeper the angle, the more cogging u will feel

2 Likes

meepo does it with hall sensors for years now.

2 Likes

I’ve felt this braking on a Hurricane and it will only cog if you really force it. I have to put my whole body weight into a flick for it to move at all and it only skips a couple phases.

1 Like

I think the higher pole count * gear ratio / wheel diameter the better, so if meepo works with 28 poles 90mm hub motor then a 14 pole 3:1 gear ratio 110mm drive would perform slightly better

Basically, the more pole switches per mm of distance rolled the better, the resolution of the Halls is 2 poles in theory so the motor should rotate by the distance between poles, and we want that to not really move the board

2 Likes

it works, but not as perfect as one might think if we start calling it parking brakes

its not perfect but good enough. I would be happy if vesc had something with equal performace.

1 Like

same, it can be useful in certain setup where smart reverse in not needed

Like bikes, most motorcycles don’t reverse much if at all but can benefit from “motor lockup” in certain situations

Motorcycles have an active parking brake…

Yeah that’s what I just said.