VESC 6 Beta

General topics and discussions about the VESC and its development.
Site Admin
Posts: 280
Joined: 15 Dec 2015, 08:38
Location: Sweden

Re: VESC 6 Beta

Postby benjamin » 18 Apr 2017, 08:17

I have the first board from the beta batch at home since last week and have done some testing on it, and so far it looks good. The only issue is that I got a TVS diode wrong in the BOM, so I will send an update to the manufacturer today and then production will start in the next days. I think it will take around two weeks until the VESCs arrive at trampa and after that they will be shipped out to everyone who ordered within a day or two.

What I'm trying to finish now is a programming and test bench based on a raspbery pi with a touch screen. The plan is to upload the firmware and bootloader at trampa and run a short test on every VESC with a reference motor before shipping them to make sure that they are working. This test bench has to be user friendly as they have a bit limited knowledge about electronics and software, and making the touch interface and interacting with openoch from qt takes a bit of time.

There are several things I'm working on with the firmware and vesc tool for the release:

1) Triggered sampling modes. This means that the high speed sampling on the VESC can be set to be on continuously with a circular buffer and wait for a trigger, such as a fault code. After the trigger occurs sampling will continue for a set number of samples after the trigger and then the samples will be sent to VESC tool for plotting. This way it is possible to see every adc sample together with the estimated position before and after faults to analyse exactly what is going on.

2) Pushing the hardware to the limits. For this I have been using some quite difficult motors and increased the limits and voltage until something stopped working. The test I did yesterday was on my scorpion 5525 225kv 20-pole motor. I used a 12s battery reached around 110k ERPM. I ran the motor at full speed in one direction and gave a 100A current command in the opposite direction and did this while decreasing the time constant until I got a fault code. Then I'm using 1) to figure out what went wrong. In the end I somehow managed to short some of the winding strands in the motor and the motor started smoking with a 12s battery connected. I thought that this would be the end of the VESC, but it survived.

Another test I have been doing is running a 6-pole high kv inrunner on 50V and increase the speed until the observer looses tracking and a fault occurs after which I'm using 1). At 20 kHz switching frequency around 160K ERPM works well and at 30kHz I've reached over 200K ERPM. This test is demanding on the hardware as a lot of energy can be released when tracking is lost. Again the VESC survived, even though I was almost certain that it would die as the VESC4 has died on that motor on 12V from a lab power supply. It seems like the cycle-by-cycle current limit feature of the DRV8301 is very useful in a situation like this. By the way, all the protection and fault generation features that can be configured on the DRV8301 are accessible from VESC Tool now. Another thing that helps with low inductance and resistance motors like this one is the new layout of the power stage where every distance is short and the impedances are low. While I did the simulation from my previous video I realized how important it is to keep the inductance low on the power stage to avoid ringing with high voltage spikes.

3) Understanding and improving the observer. The observer has been quite sensitive on getting the gain parameter right when tracking motors at high speed with low switching frequency, and when tuning it for high speed the low speed performance tended to get worse. The problem is that at high speed and low switching frequency there is quite a lot of rotor movement between consecutive updates of the observer, and it has to be able to deal with that. As the observer is non-linear this can become a problem as simply increasing the gain on the error term for each iteration will not necessarily make the error approach 0 in just one step when there has been a lot of movement since the last step. The math behind analysing the observer and its stability in situations like this is quite complicated, so I used a lot of trial and error to make improvements. What helped a lot in the end was running the observer for a number of iterations (six currently) and in each iteration truncate the error term at a certain value and increase the gain a lot for the iterations where truncation was applied. The effect of this is that in the first iterations the error will be brought down rough and fast, and in the final iterations it will be fine-adjusted with less gain. I spent two days on trying different variants of playing with the gain and doing iterations in different ways, but this is what worked by far the best in the end. This made the observer less sensitive to the parameters and it worked better on a wider speed range. A problem I had before where the motor sometimes could start screaming when pushing high currents at almost 0 speed also disappeared, and tracking motors with back-emf that is not as sinusoidal also got more stable. 1) helped me a lot again while working on the observer as it is easy to see on the plot when the rotor angle tracking fails.

I think this is a good example of an unexpected problem that they didn't consider when designing the observer (I have read all papers I could find from R. Ortega who made this oberver, which is the best observer in many aspects I have seen so far). At high speed the SNR for all parameters is good and with sufficient sampling frequency all observers tend to work well there, and most industrial motors move so slowly that sampling fast enough is no problem, so I guess they haven't really seen the problem.

4) Parameter detection and tuning. Until now detection and tuning has been working quite well for motors similar to the 14-pole 50-60mm outrunners I have been using on e-skateboards, but other motors such as my ebike hub motor and some inrunners required quite a bit of manual tuning. I have tried to make detection and parameter calculation work on the first try for almost any motor to make things easier for new users. The main problem was flux linkage measurement and observer gain calculation. The flux linkage measurement works much better now since I have improved the startup method in bldc mode with unknown parameters (which is what it used) and the observer gain calculation is updated to be almost spot on after what I learned during 3). The default parameters from the wizard work for everything from my ebike hub motor to my 6-pole inrunner at 150K ERPM with the default parameters. There are still a few improvements I want to make to the flux linkage spinup though. For example, when measuring flux linkage with e.g. a propeller the motor needs more current to reach enough speed (or the goal speed has to be reduced), and it would be good to notify the user that this might be the case, or even automatically make another attempt with adjusted parameters.

One of the most important key features of the VESC as I see it is that regular users who don't have a phd in motor control can get hobby motors with unknown parameters up and running with state-of-the-art industrial motor control techniques without too much effort. Therefore getting the setup wizard running well has high priority.

Anyway, a lot is happening, and I hope that this year will be interesting for hobby motor control. Regarding the source code release, a few people have been helping me with testing and I have also given the current firmware source code to a few who are familiar with it so that they can make configurations for their hardware, but currently it is difficult for me to deal with all the feedback and questions. The goal is to get contribution guidelines and a description of how parts in the firmware work on the project website in time for the release so that people won't waste too much time trying to understand everything from just reading code and ask more questions than I can manage to answer. So far several people have invested quite a bit of time on the firmware and if they had known several things about it from the beginning it would have made their life easier. The fact that I haven't been able to respond to all questions I got after they spent so much time also makes me feel bad. This is the main reason that I haven't uploaded the latest source code yet - now people wait rather than digging too deep into the outdated firmware, which is best before there is sufficient documentation and contribution guidelines for it. There are also other opinions on handling this situation rather than delaying the release as I do now, but this is my way of handling the situation and I hope that everyone can understand that.

Posts: 35
Joined: 24 Apr 2016, 10:20

Re: VESC 6 Beta

Postby linsus » 18 Apr 2017, 08:47


I think everyone can understand the workload you have and that we're all very grateful for all the hours of love you put into the VESC Project, It's more important to keep the enthusiasm for the fun aspects, than getting overwhelmed by deadlines and milestones cause you feel obligated to do alot of work others depend on. Also, I'm fairlry certain you'd answer all the questions if you could and had the time.

With that said I'm super excited for the new VESC and to try it next time we see eachother!

Keep up the awesome work!


Posts: 7
Joined: 11 Oct 2016, 09:14
Location: France

Re: VESC 6 Beta

Postby Pimousse » 26 Apr 2017, 19:54

Hi Benjamin,

Than you so much for this huge update.
It's quite hard to understand every details but one thing is 100% sure : you achieve a piece of art !! :o

Also, spending lot's of time to make the configuration easy for everyone is a great improvement.
And finally, I think we all respect the way you manage your incredible project.

Thank you for making the open source philosophy even more beautiful. :)



Posts: 1
Joined: 08 May 2017, 13:10

Re: VESC 6 Beta

Postby sunbeachfun » 09 May 2017, 14:03

Kudos Benjamin !

Very interesting project.
I've been lurking for a year, reading through the old code and getting familiar with the hardware design of version 4 to use as a controller for a larger watercooled inrunner motor. I'm glad I procrastinated as version 6 will perfectly fit my experiment.

Has a release date (party) been set?
I noticed that there is marketing on the T website, are these just placeholders when it is released or are these available to purchase today?

Again Kudos ! and, Thank you.


Posts: 8
Joined: 10 May 2017, 03:10

Re: VESC 6 Beta

Postby michael_zh » 10 May 2017, 03:25

Hi Benjamin,

I have been watching the project for a long time,
great piece of work!!!

I have a question ,why the topic about “VESC 5” is gone?

Posts: 943
Joined: 25 Mar 2016, 12:29
Location: Delft, Netherlands.

Re: VESC 6 Beta

Postby rew » 10 May 2017, 06:55

My mistake: See viewtopic.php?f=6&t=709&p=4167#p4167

Posting something on the same forum twice is not useful. Many people read "everything" so will be seeing your question twice wasting their time.

Posts: 11
Joined: 05 Apr 2016, 13:08
Location: Leeuwarden

Re: VESC 6 Beta

Postby JTAG » 11 May 2017, 02:48

Aaaawh to bad :roll: ! That topic had the schematic of the VESC6, does anybody still has this schematic? Or is there a more recent schematic available?

Site Admin
Posts: 280
Joined: 15 Dec 2015, 08:38
Location: Sweden

Re: VESC 6 Beta

Postby benjamin » 11 May 2017, 19:57

Here's the latest schematic.
(298.49 KiB) Downloaded 2503 times

Posts: 86
Joined: 24 Dec 2015, 15:24
Location: Germany

Re: VESC 6 Beta

Postby hexakopter » 11 May 2017, 20:54

Thanks for the updated schematics. I think now I know why I was thinking the new VESC 6.0 can measure a higher current than the old design. You are using 0.0005 Ohm shunts now. But my fallacy was that I forget to bring the gain into account. The current shunt amplifiers build into the DRV8302 have a gain of 10V/V and the AD8418 have a gain of 20V/V. That would explain the same max measurable current. Maybe that info is also interesting for others.

Because I don't remember if I have read that anywhere on this forum and this is the VESC 6 beta thread, it is maybe also interesting for others that the MPU9150 (like seen in the schematics) is not mounted on the PCB of Trampa's/Benjamin's BETA batch. The NRF24L01 however is mounted. That's at least what I know. So no guarantee.

Posts: 2
Joined: 25 Apr 2017, 10:24
Location: Stavanger, Norway

Re: VESC 6 Beta

Postby solbergen » 13 May 2017, 22:46

Now that the vesc6 will have significantly better cooling due to the aluminium casing etc, do you know the approx steady-state power throughput it will be able to handle? How much of an increase in possible power throughput should we expect?

Return to “General”

Who is online

Users browsing this forum: No registered users and 2 guests