Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhacement proposal: interupt based diversity calculation #8

Open
mihero opened this issue Dec 2, 2017 · 9 comments
Open

Enhacement proposal: interupt based diversity calculation #8

mihero opened this issue Dec 2, 2017 · 9 comments

Comments

@mihero
Copy link
Contributor

mihero commented Dec 2, 2017

To ensure rssi calculation is not affected by other functionalities it could be handled as a separate interupt. This would give control of frequency of diversity calculation.
Also dma for rssi could be changed to be compile time controllable so that dma would store more then 1 values and then calculate average of those to be used on diversity calculation. This would clean rssi values.

@piodabro
Copy link
Owner

piodabro commented Dec 2, 2017

For diversity calculation we could use one of timers interrupt to make it time constant.
But first it could be good to make main loop timing measurement. If it loops faster than diversity calculation delay it wont be necessary ;)

The RSSI values are constantly updated via DMA. Of course this should be improved using a little filtering that will give much better results, i.e. Yi = a * Xi + (1- a)*Yi-1 where 0 < a <, Xi is current ADC value, Yi is current filtered value, Yi-1 is last filtered value.
It will give some RSSI reading smoothing and improve diversity switching.

@piodabro
Copy link
Owner

piodabro commented Dec 3, 2017

I've measured looptime and it is <= 1ms.
I think its not necessary to move diversity switching to interrupts.
but some other things can be improved like I2C on DMA.
I will make some changes in RSSI reading.
I will use TIM3 to make 400Hz interrupts to read RSSI values from memory (written from DMA), and apply some filtering.

@mihero
Copy link
Contributor Author

mihero commented Dec 4, 2017

Ok, sounds fast enough loop.
Filter wise should it be 2 phase, like 1 dimensional kalman filter for both rssi reads independently and then exponential filter for rssi diff calculation. This would provide clean rssi values and then control how quickly diversity switch happens.
I already started creating additional state view for receiver "status" monitoring, that could contain measurement errors, current rssi values and then the current filter constants.
Although having some issues on printing rssiA/B values from the receiver.

@piodabro
Copy link
Owner

piodabro commented Dec 4, 2017

I think it's too complicated filtering.
My intention to use simple averaging filter is removing accidental ADC errors from RSSI signals.

Making RSSI readouts with perdiodically called timer interrupts can give us also place for constant time diversity switching code calls that You proposed.

@mihero
Copy link
Contributor Author

mihero commented Dec 4, 2017

sounds good.
I agree that better to start with simpler working solution then with overly complex.

@mihero
Copy link
Contributor Author

mihero commented Dec 4, 2017

Got the receiver status page working.
https://github.com/mihero/rx5808-pro-diversity-pro58/tree/feature/receiver_status
Seems that dma writing completes somewhere 50-80 times before every rssi update.

@piodabro piodabro self-assigned this Jan 5, 2018
@ghost
Copy link

ghost commented Jan 6, 2018

is this firmware finaly the one that let this pro58 work how it shut be??
i have this thing laying for nothing because its NOT working... so help?

@philbertphotos
Copy link

philbertphotos commented Jan 6, 2018 via email

@piodabro
Copy link
Owner

piodabro commented Jan 8, 2018

@wannaduino
Current version works ok, this issue is to make it working better.
Current solution wroks, and if your module is free of hardware problems it will work just fine.

@piodabro piodabro changed the title Feature proposal: interupt based diversity calculation Enhacement proposal: interupt based diversity calculation Aug 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants