Sparfuchs said:
Another additional question i have is if there is a way to block the hubmotor so no one can push the bike ? I've read something like "electric lock" but didn't find a topic that explains how that works ?
Various kinds of "antitheft" have been designed into assorted controllers, most of which only work with DD hubmotors or other motors with no freewheel between motor and wheel (or the ground, really).
I have one here that when engaged begins attempting to detect wheel motion (via the slightly noisily method xenodius describes vs silently via halls), and if any is detected, it applies power to the motor to counteract that motion. THe harder you push the harder it pushes back, up to some limit short of the max power of the controller. It isn't perfect, and it can cause a great deal of heat in the motor and controller and phase wires while this is going on. (but only while fighting motion...if ti's just sitting there it doesnt' use any more power than when it's not engaged).
Others just turn on all the FETs in either top or bottom of all three phases, to create a short between teh phase wries and make them really hard to turn. This also creates heating during the motion-countering.
Etc.
If you don't have this option on your controller, and you are using a DD hubmotor or other nonfreewheeling motor, you can add a switch to the phase wires (at the hubmotor itself, at it's axle wire output is safest, least wirelength, etc. It is VERY VERY important if you do this to NEVER EVER turn this switch on unless the battery is NOT CONNECTED to the controller, so that it cannot be accidentally turned on with the switch turned on. The switch would be a 3P1T, (has six pins to wire up) so that it has three separate poles, and just an OFF and an ON position. All three poles would be wired together at the C terminal, and separately wired to each phase wire at the NO terminal. So when it is turned on, it shorts all three phases together. If you did this with the controller powered on, it could blow up all of the phase FETs...so you would need to ensure this cannot happen. You don't need a huge switch for this one, but you do need one that can handle a certain amount of current, as it will have to handle however many amps are generated in the shorted phase wires during the maximum rotation speed of the wheel in this condition (probably very slow, probably fairly low amps compared to the phase amps the mtoor sees while actually in use) .
Another option that may require a much larger switch (because it has to handle the actual motor phase currents, whcih can be quite high, which the previous one does not) is to use a 3P2T, (has 9 pins to wire up) wired with each of the motor phase wires separately connected to each of the C (common), and the controller similarly to the NC contacts, and then wiring all three of teh NO contacts together right at the terminals. It must be a break-before-make type of switch (most are this type), so it never shorts the controller phase wires together.
This basically ensures you can't short the controller out accidentally, by disocnnecting it's phase wires first, and then connecting all three motor phase wires together, when you turn the lock on.
You can use a toggle or rotary or knife or keyswitch, whichever suits your application, as long as it can handle the currents required. The voltage isn't as important, as it doesn't need to break the connection with power applied (you wouldn't want to do this anyway).
Somewhere around here there are examples of both of the above, from more than several years ago, but I couldn't find them in a quick search.