digitaldanny / AudioEffectsGlove

A hand tracking glove that controls parameters of various audio effects.
1 stars 0 forks source link

State of Charge Estimation #70

Closed digitaldanny closed 3 years ago

digitaldanny commented 3 years ago

In this PR:

digitaldanny commented 3 years ago

Looks like I could change the ADC14 to 8-bit conversions using the following function MAP_ADC14_setResolution(ADC_8BIT);. This will save CPU cycles, but I do not think it is necessary as of now. It would also reduce the need to shift data to the right some amount for compressing the ADC readings. Just leaving this here as a note in case I end up wanting to do this.

digitaldanny commented 3 years ago

Right now I am working on the multi-channel ADC conversions. With my current code, ADC channel 0 works flawlessly; however the following channels are related to the previous ADC conversion. The final ADC3 channel is basically just noise. I am assuming this is an issue of not waiting long enough between conversions.

digitaldanny commented 3 years ago

Fixed the multi-channel ADC issues. With my current implementation, reading from all 4 channels sequentially with the ReadAdcChannel function is not efficient since it will trigger conversions on all 4 channels each time it is called before returning one value. Since my flex sensors API already uses this function and there is still plenty of CPU time for the required tasks, I am just going to leave it as it is.

/*
 * +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
 * DESCRIPTION: ReadAdcChannel
 * This function triggers the ADC conversion on all 4 channels and returns
 * the requested channel's value.
 *
 * NOTE - This function is not efficient when reading from all 4 channels
 * sequentially since it will trigger a new conversion each time.
 * +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
 */
uint16_t Adc::MSP432::ReadAdcChannel(uint8_t adc_channel)
digitaldanny commented 3 years ago

I believe I may have blown my in-amp by leaving the external power switch floating. Going to replace this hardware and test it out again later today.

digitaldanny commented 3 years ago

Todo:

digitaldanny commented 3 years ago

Implemented the static SOC estimation. May return to dynamic SOC estimation later if time permits.