▲ 2 r/embedded
Inline current sensing
I want to measure the phase current of a bldc motor for motor control . There are two thing to do: 1) generate center aligned PWM signals, and 2) read the current sensor data at the middle of the PWM signal.
Does anyone know how to trigger the adc conversion for the current sensing synchronously to my PWM signal (running at 25kHz).
I am using a teensy 4.0 and a INA241 as a current sense amplifier. The analog signal is send to the teensy adc.
Right now I am generating a PWM signal using the standard libraries (no Center alignment) with a frequency of 25kHz. The current sensor reading is triggers by using a timer on my teensy at 25kHz. All in all my motor control works, but I would like to do it right.
Can anyone help me?
Thanks!
u/Global_Fee1240 — 4 days ago