You are here

Navigating the firmware

4 posts / 0 new
Last post
thewho
Offline
Last seen: 4 years 6 hours ago
Joined: 2018-07-19 10:02
Posts: 37
Navigating the firmware

Hello

Iv'e been "designing" an 10s compatible esc so I was looking through the firmware source but I find it hard to get a grasp on where to find what.

I'd for example want to edit:

  • Current sense values
  • Phase and source voltage values
  • Pins for fet hi/lo, current sense, voltage sense etc. (I've not checked the datasheet to see if any other pins is suitable for adc)

 

Btw, does anyone know what gate drivers Benjamin uses in the 75/300 Vesc? He might have said it in his latest video but then I've missed it.

TechAUmNu
Offline
Last seen: 6 months 4 weeks ago
Joined: 2017-09-22 01:27
Posts: 575

Probably the same as me... 

He is using the same INA240 current shunt amplifiers.

I used UCC27211 gate drivers. I think he is using them in a smaller package.

TechAUmNu
Offline
Last seen: 6 months 4 weeks ago
Joined: 2017-09-22 01:27
Posts: 575

Also for those settings look in the hwconf folder, you can copy the vesc 6 files and make your own hardware configuration for your board. In the .h files for each hardware version it defines the R1 R2 input voltage divider (also the same for phase voltage sense) and the resistance and gain of the current shunt/amp.

pas940
Offline
Last seen: 3 weeks 1 day ago
VESC Free
Joined: 2026-02-02 07:04
Posts: 1

 

Hi All,

Sorry to dig up an old thread but this is close to what I'm looking for, I've designed my own board based on a VESC 6.4. but it's designed for 5S battery, and lower currents. I've changed the shunt resistor, Vin divider and the phase voltage dividers to 18k/2.2k. I can see most of the other stuff in the firmware to change to suit but the phase voltage has me stuck, I tried using AI and they sent me down a rabbit hole and Chatgpt said what Grok was doing wasn't going to fully work...

Grok had me add lines in hw_myesc.h:

# define ADC_V_L1_VOLTS  (ADC_VOLTS(ADC_IND_SENS1)*(18000+2200)/2200)

... for 2 and 3 as well

Chat GPT said I need to make changes in mcpwm_foc_adc_int_handler()

adding:

#define PHASE_DIVIDER (9.18/46.46) // this is my divider ratio over the origional ratio.

va *= PHASE_DIVIDER

... for 2 and 3 as well

 Is there a document somewhere that explains where the phase voltage divider ratio is set in the firmware? Do I need to do both of these or something else?

Thanks 

Paul