M.Eng (Hons) First Class
Software engineer at Starship Technologies and co-founder of Purple Parrot. Previously at CERN and ESA. MEng (Hons, 1st) from the University of Plymouth. Based in Tallinn, Estonia.
There are a number of things I could start looking at for this project, specifically, I could look more into the motor (Iāve already decided a Phub 188A from peiscooter is the way). I could look at the frame, and start thinking more about the mechanical build, or I could look at the hardware or software.
Iām currently waiting to order the motor, itās a pretty big investment for something thatās not a requirment in my life right now. So that leaves only a few other options. Being an electronics engineer, I guess the first thing my mind goes to is the electronics, and hey, a little bit of dopeamine from getting some electronics working my keep me working on the SBS for many months to come!
To my mind at the moment, there are several main subsystems for the hardware:
And thatās all I can think off. Each section above will have itās own pages/post (dependig on how I decide to go forward with documentation). I will start with the ESC, though. A fellow engineer has done so much of the hardwork here already, a guy called Benjamin Vedder has made an open source ESC, which heās called VESC - for obvious reasons. While the schematics are freely available, the gerbers/layout is not. That suits me quite well (otherwise I would feel like Iām cheating, copying the main subsystem from someone else!). The code, though, most importantly is open source and freely available too. While I can (and have!) written code for STM32 uPs for ESCs (I made a 1000W BLDC ebike controller), I know that I will get bogged down on that - building a SBS from scratch is going to be a long project, anything to speed it up is welcomed. I can always go back and write my own code if needed, but I would rather give back to the community of the VESC, so I hope to make some merge requests for that.
The first thing Iām going to look at is the ESC. As mentioned, the schematics are available (in KiCAD) from his other site. It seems that he has two sites, and a github. The second site I linked has the schematics for the newer versions of the ESC. I will attempt to make the VESC 6 MK IV. There only seems to be a pdf of schematics available. Thatās not the end of the world, though, I will most likely make some small modifications to the design as I go, and layout of a PCB is pretty enjoyable anyway, and gives it a personal touch!
What I do need to check, though, is that the firmware is available for the VESC 6 MK IV, that would be a show stopper!
So, looks like all the firmware is here. The README states that it should work for all board kinds, and to run āmakeā to see. I havenāt pulled the code (yet!) but I did dig through the MakeFile, which looks really interesting. Thereās some code that refers to a āBig Hammerā to build for all boards:
@echo " [Big Hammer]"
@echo " all_fw - Build firmware for all boards"
@echo " all_fw_package - Packaage firmware for boards in package list"
Thereās also some code for getting a list of boards:
# Strip the paths down to just the names. Do this by first using `notdir` to remove the paths, then the prefix (hw_), then remove the suffix (.h). Finally, sort into lexical order.
ALL_BOARD_NAMES := $(sort $(subst .h,,$(subst hw_,,$(filter hw_%, $(notdir $(TARGET_PATHS))))))
Now thatās one hell of a make command! The TARGET_PATHS comes from a recursive make function. Without running the code, Iām guessing (and from reading the codeās comments) takes the header files, strips everything but the board numbers. The README gives some hint as to what these look like:
## Supported boards
All of them!
Check the supported boards by typing `make`
[Firmware]
fw - Build firmware for default target
supported boards are: 100_250 100_250_no_limits 100_500...
So the board names seem to be things like 100_250. hmmmm. I think tomorrow I will pull the code on my Linux machine and run make, and see what happens. Iām feeling pretty confident that thereās FW for the VESC 6 IV, enough to go forward now anyway!
Time to fire up KiCAD! I think thatās all for today, tomorrow Iāll check out the code some more, and get the KiCAD project set up!