Open 2007-i opened 3 years ago
Does this line serve this purpose? If you uncomment it, will the wheel be locked only at rest?
// #define STANDSTILL_HOLD_ENABLE // [-] Flag to hold the position when standtill is reached. Only available and makes sense for VOLTAGE or TORQUE mode.
Yes, that will hold position, so it can be used as locking feature for short period, like going into a shop. The drawback however with such a method is, that the whole electronics need to be powered on. Maybe a more useful locking method is to use a switch with a key that shorts the motor phases together. And the same switch turns off the power to the board. So the functionality will be something like this:
Yes, also an option!
if (!rtP_Left.b_cruiseCtrlEna) { // If Stanstill in NOT Active -> try Activation if (((input1[inIdx].cmd > 50 || input2[inIdx].cmd < -50) && speedAvgAbs < 30) // Check if Brake is pressed AND measured speed is small || (input2[inIdx].cmd < 20 && speedAvgAbs < 5)) { // OR Throttle is small AND measured speed is very small rtP_Left.n_cruiseMotTgt = 0; rtP_Right.n_cruiseMotTgt = 0; rtP_Left.b_cruiseCtrlEna = 1; rtP_Right.b_cruiseCtrlEna = 1; standstillAcv = 1; }
It seems that it is possible and this condition can be applied so that it would work only in rest mode. I just didn’t figure out how to launch it correctly.
Is there any controller input that can be used for the condition? And we will have, just like electric scooters, a special entrance for the anti-theft device. I'm ready to solder the contact on the controller if you need it.