2024-06-25 06:59 AM
Hello,
I am trying to implement a P-controller-algorithm for two levers, where one lever follows the other one. The problem I have is that when the duty cycle of the PWM-signal reaches zero the PWM stops working if I change the position of the lever again. The signal is constantly high but doesn't give any current to the other lever even tough the PWM gets configured with a new duty cycle. The random thing is that the lever starts to follow again after pulling the other lever back and forth. I am wondering if there any issues with the configuration with the PWM signal on TIM1 or any other suggestions?
The P-controller algorithm is in the StartADCTeleRegTask in the main file linked bellow.
Any help is much appreciated!