I am quite new to the VESC and understanding the oepn source firmware.
Can anyone please explain me how is the negative current being sensed in the VESC tool?
In the firmware I see "GET_CURRENT()" for to read the input at the ADC pins mapped to current sensing.
// Current ADC macros. Override them for custom current measurement functions.
#define GET_CURRENT1() 4095 - ADC_Value[ADC_IND_CURR1]
#define GET_CURRENT1() ADC_Value[ADC_IND_CURR1]
I understand, how the ADC_Value[<ADC-Index>] reads the positive current which corresponds to values between 0 - 4095. But for negative current 4095 - ADC_Value[<ADC-Index>] is used. However, I am not very sure how it is reading the negative value of the current.
I have a custom application and for that I am using bidirectional ACS current sensors that reads +/-10As.
I have to update the firmware corresponding to the current sensors. So I have to make mimic current sensors as Shunt Resistors for VESC.
It will be great if anyone can help explaining the current sensing principle in VESC Firmware.
Or, if anyone has done this before (which I am sure would have been implemented) and can help me in resolving my problem. It will be great help. Its been more than 4-5 days I am investigating this, andhave no right leads.