A Small 6 fet Vesc 6 Design

sdobbie

100 W
Joined
Dec 14, 2013
Messages
137
Location
Fife Scotland
Hi everyone, I just wanted to share my progress on a new vesc based controller I am working on. It follows the vesc 6 high power design schematics almost exactly apart from it being 6 fet, using linear regulators for the 3.3 and 5v power supplies and omitting the nrf51822. The layout is nowhere near finished. The mosfets and regulators are meant to be mounted on the underside of the board and heatsinked to a waterproof aluminium case. The board is designed to fit inside a 112 x 60 x 31mm project box and the whole thing has been designed with simplicity, low cost and compact size in mind.

All feedback welcome

Clipboard04.png



Clipboard06.png
 
Nice to see you're designing a Vari-ESC. You might want to read some of the multiple projects for layout guidelines of power stages with through holes; see Hackeys and Thor's threads most recently, you might take inspiration from the cheap foccers (though shaman has had some troubles so pay attention to the latest working versions) zombies had threads in the past also.

So...
F405 is like 12$ on it's own which makes crystals and switching regs cheap by comparison. Ina240 phase opamps are also not cheap and if you're using them I presume you're targeting 50V+

F405 draws like 100mA when programmed on it's own so at 50V that's going to waste 5W into your regulator... You'll need a moderate heat sink. Switching regulators really aren't hard and really are worth the hassle. Choose one with a synchronous fet so you don't need a diode and most of the layout hassle goes away. If below 60V I'd recommend lmr36520 which is really stable with minimal nonsense.

What's going on with u14 u16 u18?

You don't seem to have laid out the gate drives correctly. There's no switch node return to them and the bootstrap and switch look like they're shorted together.

Where's the gate drive voltage rail?

What eda package is that? You might consider throwing it away and swapping to kicad, then you can start from one of the many known good VESC schematics published online. Also kicad is just better.

Good luck.
 
I am designing it as a 60v 25a max controller. There's a lot of traces still to route so there is still some stuff missing in the pictures. I am following the official vesc 6 schematics from the vesc website exactly minus the switching regulators and some fets. The controller is being designed much like one in an electric car where it needs to be supplied with 12v to power all its internal electronics. The linear regulators will only see a maximum of 14v on their inputs as an external switching regulator is being used to supply the 14v and run other stuff on the bike. In the case of U14, pins 2 and 3 are meant to go to ground.

I am unsure how I will calibrate the voltage and current measurements, maybe I have to edit header files in the firmware?

I am using easyeda which has worked well for me for a long time.
 

Attachments

  • vesc_75_300.pdf
    312.2 KB · Views: 99
K, makes sense if you are using external dcdc.

You have to change things in the hwconf folder... Copy the hardware file (.c and .h) closest to yours and edit accordingly. It has the potential dividers, shunts, pin assignments etc.

Then edit conf_general.h to include your new hardware file, comment out the old one (hw_60.h and .c if i remember correctly) and you're good to go.

Compile and flash your board.

Pro tip... Vedder uses 3.44V regulators. The rest of the world uses 3.3. Don't miss that line.

At 25A you probably don't have to be particularly carefully with your traces for the power stage, and with through holes FETs you won't be switching hugely fast so hopefully you won't have too many problems.
 
Ok, will look for 3.44v regulators. Never heard of those before.

I suppose I can change the switching frequency in the hwconf file? The KT controller I have just now switches at 20khz and used through hole mosfets. I made a lot of progress on the PCB layout today but I was wondering if I can use the board without the 8MHz crystal oscillator? I saw in the cheap focer diagram that the oscilator is required for USB to work but I won't be using USB. I had a flipsky vesc esc and the usb broke so I just connected to the serial port on it with a USB to serial cable and it worked perfectly.

Hugely appreciate the help and advice, thanks.
 
You don't need the 3.44Vreg, you just have to change it in the config file. It's a line you can easily miss... I did...

I can't answer for sure on the crystal, but there is code in the software that sets up the oscillator to use an external crystal so you'd have to modify that which would be 10 to 100x the effort of just putting a crystal and two caps on.

Playing with the st clock control is not fun if you don't have access to the HAL libraries (VESC doesn't use ST HAL). Unless someone else has already done it, you're probably going to struggle more than you will with a crystal. You've got to set up the oscillator, then all the PLLs that feed the various buses and clocks and vedder has over clocked the ADC so st libraries won't even let you do what he's done...

You don't need to change the switching speed. 30khz VESC means 15khz pwm which is fairly slow even for the through holes. You can change it in hwconf files or you can change it at run time. But you probably won't need to.

How many of these are you planning to make?
 
I will make one prototype and if it works, I will test it for a few months and then make as much of them as I can provided there is enough interest and they sell well. I can probably use the jlcpcb smt assembly for my production run but all prototypes will be hand assembled. I can't see any reason it wouldn't work if I follow the schematic exactly. In regards to downloading firmware, I was only able to find the bin files on github. Can anyone point me to the source code for the vesc 75/300 so I can modify the hwconf and then compile?
 
Well sadly I won't be able to make this controller as compact as I wanted to because even with a 4 layer pcb, I didn't have enough space to route all the traces. Looks like I will have to make a 12 fet version instead as there are just too many components with too many pins to make a small 6 fet design possible. My biggest mistake was not leaving enough space around the stm32 chip.
 
sdobbie said:
Well sadly I won't be able to make this controller as compact as I wanted to because even with a 4 layer pcb, I didn't have enough space to route all the traces. Looks like I will have to make a 12 fet version instead as there are just too many components with too many pins to make a small 6 fet design possible. My biggest mistake was not leaving enough space around the stm32 chip.

I'm 100% sure you can route this in the space available. My VariESC was 100x67mm and has 12 TOLL FETs and one sided placement on 4 layer. Also included Bluetooth and 100V dcdc converters.

Woly said:
Maybe you should look at version 4 vesc. It's pretty small.
Horrid thing the V4. DRV chips like to pop and 2 shunts. Far more work. Stick with the VESC6 design. There's no real reason for it to be much bigger.
 
I worked hard on rerouting and I will manage it in 3 layers. Looking a lot better now. Only issue is that I don't have space for the three phase temperature sensors so was wondering if I can just use one sensor attached to the heatsink and just attach that to the adc_temp pin (pin17)? Also there is TX_SCL_MOSI on pins 23 and 29 and RX_SDA_NSS on pins 20 and 30 but it doesn't specify which pins I am meant to use.

Clipboard05.png

Clipboard07.png
 
You have to connect to both. I think he did this to avoid too many connectors but who knows.

Why 3 layer? 4 layer is standard. Have you found some oddbod supplier who does 3 layer?

You can do just one temperature sensor, just pick one of the u v w mos temperature sense channels and define in the .c and .h files.
 
I was thinking that if I didn't use a layer in the stackup options in JLCPCB I would save money but have had to go with 4 layer. Routing is pretty much done now and I just need to make up a parts order. Will see if the smt assembly service can put the stm32 chip on for me because I can't solder that myself.
Clipboard02.png
 
This looks reasonable overall. Still wondering what u14 15 16 and u34 17 16 are for. Still implore you to use a switching reg, it'll literally take you half an hour to design and there are tons of them on jlcpcb

Careful with the vesc branding. Vedder and frank at trampa lose their shit whenever someone calls a VESC a... VESC... Basically managed to copyright the VESC name 5 years after releasing it to the public domain and after countless other VESCs were made but they're running around bullying everyone.

F405 is like gold dust. Good luck getting them, jlc been out of stock for 6 months now.
 
Thanks for that heads up, I have removed the vesc branding and when it comes to selling this, I will just put a note somewhere that it's based on vesc designs.

I have also put a ground pour on all internal layers but don't know if this is a good idea. I have given it good clearance and used many ground vias to stitch all groundplanes together.

On that image, the parts you mentioned with prefix U hadn't been named correctly, they are important and are M74VHC1GT66DTT1G normally open analog switches and I have put them in as per the circuit design from the vesc project. They areomething to do with current and voltage sensing. In this form factor I won't be able to fit the switching regulators in with the limited space I have. If this design works well, I will use them in higher powered variants as I will have more board space.

If all seems good, I will get the order put in and make a prototype. There's a few places I can get parts from. Not too worried about cost for prototype stage.
Clipboard02.png
Clipboard09.png
Clipboard01a.png
 
This will probably work, but I don't think it'll be great for high power. There are a few thin areas though i guess you plan on adding copper to them.

I'm not sure why you've got 3 random bootstrap caps on the back of the board. They can easily go on top.

Check your battery+line. It looks to me like the top left corner of the PCB might burn.

For the gate drivers, consider swapping them for ncp5183, far more robust than the ti package and they are industry standard footprint with loads of drop in replacements. TI for some dumb reason have decided to buck the standard and swap the bootstrap and switch pins over.
Try to keep a completely solid inner ground plane, don't make cunning cuts through it to try to shield noise etc.

What FETs are you using? Make sure you pick ones with a good Cgs to Crss ratio, should be a ratio of 100 or more really or you risk parasitic turn on.

Why haven't you used the standard motor hall connector pinout? You want to keep the ground and signals well coupled to about noise spiritually firing the hall interrupts.

On that note, it's not on the VESC schematic but I'd recommend filtering the hall signals with a roughly 15khz cut off filter (that's the VESC pwm frequency).
 
It's only meant for 30 amps and I will thicken up the exposed solid regions with extra copper.

I managed to get those capacitors on the top side of the board and also became aware of a missed connection which I fixed. Huge thanks for that.

The ncp5183 requires too many external components which I cannot fit on the top side of the board. I will however use it in future designs.

I was going to use IRFB4110 but its gate capacitance is probably too large. I will look for some other alternatives.

I haven't bothered about the pinout as all connections are going to be soldered to the board with wires and routed outside the metal case with connectors on the ends just like any generic bike controller.

Will try adding the filters, I take it they will just be LC filters?
 
sdobbie said:
It's only meant for 30 amps and I will thicken up the exposed solid regions with extra copper.

I managed to get those capacitors on the top side of the board and also became aware of a missed connection which I fixed. Huge thanks for that.

The ncp5183 requires too many external components which I cannot fit on the top side of the board. I will however use it in future designs.

I was going to use IRFB4110 but its gate capacitance is probably too large. I will look for some other alternatives.

Will try adding the filters, I take it they will just be LC filters?

Just 1 extra diode surely?

IRFB4110 was a great fet, probably the best? 10 years ago. But things have moved on, there are much much better ones now. The TI chip had plenty of power to drive the gate capacitance, but it's the reverse transfer capacitance you have to look out for.

RC filters fine. Something like 1kohm 100nF.
 
It needed an extra diode and resistor. The diode mentioned in the datasheet was quite large and would have needed to go on the underside of the board. I don't like the idea of cooking the board twice for smt assembly as I will be building these myself and getting a reflow oven. I have ordered 5 boards and will be ordering all available components tonight but there is a huge shortage just now.
 
I have managed to get all the parts needed apart from the canbus chip which isn't essential at the moment and the X50328MSB2GI clock crystal. Are there any substitutes I can use for the crystal or even omit it? As far as I know, the crystal is only needed for USB to work.
 
Re setting up the clock controller to use internal clock might be a nightmare in the VESC code.

You can pretty much substitute any crystal with the correct frequency if you exchange the footprint.

You might have to alter the capacitor values. Check the data sheet of the one you choose.

Some require drive resistors but most seem ok without. Bit of a black art calculating drive resistors.

Find the model that st use on their nucleo boards?

As for canbus, there are pretty standardized footprints for those 8 pin transceivers. I'd be surprised if there wasn't a readily available substitute.
 
sdobbie said:
.. and the X50328MSB2GI clock crystal. Are there any substitutes I can use for the crystal

Where did you get that part number from ?, any VESC doc/post ?

vesc4 uses ABM3B-8.0-10-1UT (vaguely remember it being available in mouser)
 
Dude... Jlcpcb say they have 15000 in stock of that crystal!
 
Yes, the available stock is maybe for the smt assembly service but I won't be using that. On LCSC the stock is zero. Might have to just try an 8mhz crystal like one would use on an arduino.
 
Back
Top