2025-01-13 11:50 PM
Dear all,
I am developing motor control system, and would like to observer the (motor) current response.
In the past, the method I often used was DAC, where the current command and actual value were output separately through the DAC to an oscilloscope for monitoring.
I have also used UART/RS422 to send the data to a PC and then plotted it using Excel or MATLAB. However, it was insufficient to reflect (motor) current data in real time. My current control frequency is 20kHz, but the communication update rate can only reach a maximum of 1kHz, even with a baud rate of 921,600 bits/s. (It can only be used to monitor speed response at best.)
I wnat to build/implement a communication and it can enable me to observe a data with 20KHz update rate. This helps in diagnostics and analysis of transients.
So, I would like to ask if anyone has any experience or suggestions.
Currently, I am using the STM32H563 as MCU.
Best Regards,
2025-01-14 03:24 AM
@yang2 wrote:I have also used UART/RS422 to send the data to a PC...
My current control frequency is 20kHz, but the communication update rate can only reach a maximum of 1kHz, even with a baud rate of 921,600 bits/s.
Really? That doesn't make sense!
Are you using a grossly inefficient protocol?
At 921k6bps, you get around 92k bytes per second - so you should certainly be able to do much better than 1kHz
Maybe look into what's causing the bottleneck(s) in your implementation?
What other interfaces do you have available? USB? Ethernet? SPI?
2025-01-14 06:48 PM
Hello Andrew,
Thank you for your comments.
1. The following is my communication protocol. Its packet length is 14 Bytes.
(The original data content is 4 bytes, but the entire packet includes SOF, EOF, some CRC, and a device identifier.)
Thus, each packet(14Bytes) should takes about 121µs (The actual experiment result is 151µs.) base on 921600 baudrate configuration.
The following waveform was measured at a communication rate of 1 kHz and it is in handshake mode. (Each transmission is followed by a corresponding acknowledge)
Room in on only one handshake transmission.
You can notice that even at a communication rate of 1 kHz, the transmission utilization has already reached approximately 43.9%, based on a baud rate of 921,600.
It is completely unable to achieve a 20 kHz update rate. Moreover, I might need to upload multiple pieces of data simultaneously, such as speed, current, temperature, etc.,
Yes, the STM32H5 supports USB, Ethernet, and SPI. Therefore, I would like to consult experienced person on which interface is more suitable for high-speed/real-time communication needs before I start development and integration.
Best Regards,