-
Notifications
You must be signed in to change notification settings - Fork 52
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
Update oled.c to reduce possible interference with motor PWM harmonics #20
base: master
Are you sure you want to change the base?
Conversation
changed frequency from 0d80 (80) to 0x00 (0) to reduce speed for OLED communication in order to avoid motor PWM harmonics (EMI)
Use SWDO pin (silkscreen on PCB) of S42B communication pin header as active low signal to trigger endstop based on angular deviation. Mind that connecting SWDIO to an endstop pin on the mainboard is a non-buffered direct connection to the STM32 controller on the S42B Adjust the sensitivty for sensorless homing with #define sensorless_sensitivty. And generally do not home too fast during testing. Also note that the repurposing of the SWDIO Pin (PA13) as sensorless homing endstop output might break the on-the-fly SWD programming. Pressing RES(ET) on the S42B once and retry programming normally works fine. The triggering of the sensorless homing sensitivty threshold kills the on-the-fly SWD interface!). If it does not, you will have to hold the RES(ET) button manually until "hla_swd" is shown during openOCD programming. Releasing RES directly at this point will start the normal programming. Holding RES too long will result in a timeout.
Added sensorless homing functionality.
Oled stability optimization
The display issue seems to have two root-causes.
Regarding 1. increasing the F_OSC or internal clock of the OLED display seems to help. Testing with a bigger sample size is now required. |
changed comment for OLED F_OSC selection
…to recover from any glitches. Screen goes blank for one second during re-init.
testing by other contributers still showed issues with display glitches. |
with the optimized NOPs in the SPI handler, my testing shows a display issue after 3 days sitting on my bench. As the occurence seems to lowered now, a higher OLED_reset_counter value might be more appropriate, e.g. once per minute (300k) or even once per 10min (3mio).
changed re-init of OLED to ~60 seconds. |
changed frequency from 0d80 (80) to 0x00 (0) to reduce speed for OLED communication in order to avoid motor PWM harmonics (EMI).
Also disccused here: #16