EFeru / hoverboard-firmware-hack-FOC

With Field Oriented Control (FOC)
GNU General Public License v3.0
1.17k stars 969 forks source link

brake mode #324

Open landrisan opened 2 years ago

landrisan commented 2 years ago

Variant

USART

Control type

FOC

Control mode

Torque

Description

I would like to use the motor as an electromagnetic brake, with adjustable gain. So, would be possible instead of setting speed over UART, to set up the gain of the brake and the motor to not rotate at all... just wait to be rotated and give a brake feedback according to the value recived via UART

Candas1 commented 2 years ago

Hi,

It's not possible with the firmware but you could do this yourself from an arduino. In torque mode you are sending a torque setpoint via UART, and you know at what speed the wheel is rotating.

landrisan commented 2 years ago

ok, I can do that. In fact, I already tryed. But for high braking gains, the motor must run in reverse. For example, if the motor is rotated to the left, to brake-it, I must send command to rotate to the right. Is ok to work like that? For long term ussage, the mainboard can work like this? I also noticed that the input voltage is increased, from 36v to 40v, hat was with battery tested. If I need to use with a power supply, I think I must use a Zenner diode and a power resistor to drain over voltage. Will test..