You are here

DRV8301 Gate Drive value in Control Register

5 posts / 0 new
Last post
shaman
Offline
Last seen: 8 months 2 weeks ago
VESC Free
Joined: 2018-12-09 15:59
Posts: 60
DRV8301 Gate Drive value in Control Register

image

So I’m looking to write to the control register of the DRV8301 with a slightly new value without overwriting the OCP settings. I want to reduce the Gate Current from default (1.7A) to 0.7A by writing the appropriate value to it. Ben has already set up the structure to do this with defined functions and he does this to set the OC values like in the code above. Below is the register map of the control register I want to write to. My understanding of bitwise operations are rusty and I don’t quite understand how or what Ben is writing to this register after all the bitwise operators and bit shifting. Does anyone know anything about this or how to help? The goal is to reduce the gate drive strength in order to increase rise/fall times for some custom hardware I'm designing. This can help reduce voltage spikes and ringing on the switch nodes by increasing dt in the V = L*di/dt equation of voltage created from inductance and changing currents. 

image

district9prawn
Offline
Last seen: 1 year 4 months ago
Joined: 2018-04-26 12:18
Posts: 123

If you only want to change the gate drive current the only change you need to make is to write a 1 into bit 0 at register 0x02.

In the line before drv8301_write_reg() in your pic, add the line

reg |= 0x01

Bits 1-15 are untouched since they are OR with zero.

In drv_8301_init(), it looks like 0x0430 or (0100 0011 0000) goes into the 11 data bits. You can change this to 0x0431 to initialize the vesc with 0.7A gate drive on boot.

 

shaman
Offline
Last seen: 8 months 2 weeks ago
VESC Free
Joined: 2018-12-09 15:59
Posts: 60

Thanks @district9prawn! Ah yes now I remember the or-equals operator. I'll change the value in the init function to 0x0431 as suggested. I need to brush up on my digital stuff...

 

earllandry
Offline
Last seen: 4 years 4 months ago
Joined: 2019-12-13 05:03
Posts: 1

Thank you @district9prawn! Exactly what I needed to know. 

valentines day gifts for her

Rovimo
Offline
Last seen: 3 years 2 months ago
Joined: 2021-01-28 11:13
Posts: 1

Gate drive value in control register, Coding and more important things are mentioned here also. I would like to implement this code here because it is really interesting for brillassignment reviews. I want to built your interest first and after that it just be look that we all are waiting to having and also to keep these related pages.