The benefit of adding sensors to a motor is improved low down torque. In the case of electric skateboards this means easy smooth starting from stationary.
This is how i sensored a SK3 for my setup. Everyones setup will be different so adjust accordingly.
Please read the sources I've provided and do your own research so that you have a rough understanding of how it all works. Doing so will make troubleshooting much easier. Double check that the information I've provided is correct, please don't blindly follow what I have done.
My setup: Electric Mountain Board. Single Turnigy SK3 192KV Motor, VESC 4.10, Gear ratio 80 / 15, Wheel diameter 200mm, Voltage: 12s
Step 1: Internal or External Sensors and What Spacing?
This tutorial is about adding external sensors. You can sensor from the inside by gluing the hall sensors between stators. There are 12 stators in my motor, you space them every 120 degrees( 3 stators between each sensor.)
The most compact way is 60 degree method, which is compatible with VESCs..
360 / ((p / 2) x ph)
p = number of poles
ph = number of phases
For a 7 pair 14 pole motor like the SK3 the key number is 17.14 degrees. So the centre of each hall sensor needs to be 17.14 degrees from the next.
Step 2: Which Hall Sensors and How Do They Work?
I began using honeywell ss441a sensors because i know others have had success with them, however i later switched to latching SS460. SS461 work fine too. Research suggests you need to use bipolar latching hall sensors, though it turned out after reading the data sheet that the ss441a aren't actually latching sensors but Enhanced digital bipolar. However despite this, they do definitely work, but i recommend the other two models mentioned above.
Heres some sources to select halls for BLDC motors
A hall sensor has 3 legs. one live, one ground, and an output. When a north(depends on the sensor) field passes in front of the sensor, voltage is apply to the output leg. By using all 3 sensors the VESC knows where the rotor is. and calculates the optimum time to switch on the individual stators. Here is a great video demonstrating was happens
Step 3: Making a Hall Sensor Holding Bracket.
Im lucky enough to own a 3d printer. So it was pretty easy to knock up a bracket in fusion 360. However, others have had success building one by hand. See here.
My free to use fusion 360 files are here, bare in mind you may need to edit them to suit your needs.
My halls are a total of 2mm away from the motor housing , 1mm of plastic and 1mm air gap. They are 30mm deep from the front of the motor.
Having an adjustable bracket allows fine tuning to make the motor more efficient. However, as long as the 17.14 spacing is correct the sensors should work in any alignment. To roughly tune them you need to rotate them back and forth a little to find the point which has the most torque, you can do this by feel using you hand.
The way you fine tune them is to measure the current draw when the motor is locked at a selected RPM, rotate the holder to find the point where the current is lowest and then tighten up the bolts. It is only most efficient for the RPM you tuned at, so make sure the RPM you select is low.
Make sure the motor is actually running in sensored mode when tuning. When using the VESCs hybrid mode, sensorless mode is switched on at a specific RPM!
Step 4: Wiring to the VESC
UPDATE: ITS ADVISABLE TO USE A BYPASS CAPACITOR BETWEEN VCC AND GROUND FOR INCREASED LONGEVITY, I HAVE ADDED THESE SINCE WRITING THIS ARTICLE
All the +5V s are wired in parallel, and the grounds are also wired in parallel. Each of the outputs are wired individually to the VESC. See my very artistic drawing for reference. I used Ethernet cabling.
Tip: Dont flex the legs of the hall sensors too much, they will break off. (I learnt this the hard way)
I created and soldered 3 short (50mm) wires to the +5v legs, 3 short wires to the grounds, and soldered the outputs directly to the cable. Then I mounted the hall sensors into the holder (On mine the narrow side faces towards the motor, check the datasheets for yours), and bent the legs. I then used epoxy resin to secure and insulate the legs. Once dry, i soldered all 3 lives together to the cable, and all 3 grounds. Use heat shrink to tidy everything up.
On the other end of the cable you need to solder on a 6 pin JST PH 2mm connector. The individual pins are labelled on the underside of the VESC. The outputs can be in any order. Just make sure you get the 5v and ground correct or you may have a very bad day!
Step 5: Vesc Setup
You need to be confident and familiar with VESC tool to proceed.
With your vesc successfully connected to the vesc tool, Run the motor detection. It should calculate the hall sensor table settings for you, you then just apply and upload the settings to the vesc.
Mine complained my that the 1st and 7th values were out of range and needed to be truncated. I think this is normal, at least it seems to work fine any how.
You now need to set the sensor mode to "Hybrid" apply and upload. This setting uses sensored mode at very low speeds and switches to sensorless at higher speeds.
One final setting you may wish to alter is "Sensorless ERPM Hybrid" This sets the point at which the VESC switches from sensored to sensorless mode. The default value is 2000, which means it will switch at a very low speed. This value may be adequate for normal size wheels, but for larger wheels it may be beneficial to increase this value. I aimed for the switch over to happen at around 5mph.
My max erpm is 60,000 and my max speed about 27mph, 5mph is about a 5th of 27mph. So a 5th of 60,000 is 12,000.
You will have to experiment to find out the best setting for you. You wont damage anything messing with this setting.
Step 6: How Do I Know It Is Working?
The easiest way to test if it is working is to switch from sensored to sensorless mode in the vesc tool, upload the new setting. Next, grip the motor gently and pull the trigger on your controller a very small amount. You will notice an increase in torque in sensored mode. In sensorless the motor torque will be weaker and may even rock back and forth a tad. See the video of me testing mine.
On my mountain board it is impossible to pull off from stationary in sensorless mode, due to the wheels being so large. In sensored mode its a breeze, see the video of me trying to go as slow as possible in sensored mode.
Step 7: Conclusion
As stated right and the start, do you own research understand everything before you begin, and double check everything in case i have made mistakes.