I’m working with an STM32 and a DRV8305, and when I try to call Serial6.println(“angle”), something strange happens. The motor rotates normally in one direction, but when I try to reverse, it overcurrents and trips the driver protection. What could be causing this? Could the serial port affect the PWM?
So, can I use Serial.println() to output angle, speed and torque values with Teleplot library? I could do this before and there were no problems. The problems are caused only by the output with the word “angle”… In documentation. The documentation recommends using SIMPLEFOC_DEBUG, instead, and don’t recommend use println more than a few times per second.
Hey @tarasradio,
You should be able to print to the serial in real-time. Maybe with some performance degradation, but if it’s not called upon each loop call, you should be fine.
Your problem seems a bit extreame, are you sure that the Serial6 is the one you need?
Are you sure that the pins for the DRV8305 and the Serial6 do not interalap?
Hello . Yes, I am sure that the driver pins and the USART6 pins do not overlap, I connected the PCB to the STM32F446RE and I took this into account. I’ve even double-checked that this is the case. Trying to translate the control cycle into a timer interrupt call also did not help in solving the problem.
What about the sensor pins?
Did you try printing other words/text?
It is only “angle” that kills the program or anything printed?