Laogeodritt
New member
Hi all!
I'm in the early engineering stages of a project, and I'm trying to figure out whether the Teensy 4.0 QDC will be able to handle the motor encoder we're using and our position detection requirements, or whether I need to plan on designing external circuits to do what we need. I think I have a good grasp on it and am just looking to confirm my understanding and figure out a few missing details, so hopefully this is a simple question for some of y'all.
Project context: We are considering using the Teensy 4.0 in a scientific instrument prototype. We will be using a motor whose quadrature encoder is outputting up to 5,000,000 pulses per second at the maximum motor speed (overall, so 2.5MHz on each signal A and B). We want to be able to accurately accumulate the motor position and take stroboscopic imagery, which involves providing a trigger signal at a precise position every rotation to the flash and camera equipment.
I've gone over Chapter 56 of the i.MX RT1060 manual (PDF, as hosted on the PJRC site) and the QDC seems to do more than what we need, all in hardware. From a search on the forums, I discovered mjs513's QuadEncoder library, which I understand is included by default in Teensyduino. (Yay! One of the things I love about using Teensies for these prototype and one-off projects)
My questions are:
* In general, does the QDC peripheral on the Teensy/i.MX RT1060 seem well suited to this task? Am I obviously missing some challenges in this post?
* Is it possible to route the POSMATCH signal to a GPIO output pin (e.g. via the XBAR), or are we limited to processing the event in software? At a glance it doesn't seem like the QuadEncoder library supports that, but that doesn't mean I wouldn't be able to configure this directly in the hardware registers myself.
* What is the "IPBus clock" that section 56.5.1.3.2 (filter) is talking about? Am I correct in assuming it's ipg_clk_root, and that this clock is 1/4 of the system clock (i.e. at an ARM clock of 600 MHz, this would be 150MHz)?
* I don't have too much experience with motor encoder noise/filtering at this speed. With our 2.5MHz A and B signals, presuming the 150MHz IPBus clock is correct, does this seem realistic to filter? With prescaler of 1, that seems to give us minimum 60 clock cycles per pulse on each of A, B, which I think gives more than enough leeway to play with number of samples or sample period.
* Is the Teensy 4.0's GPIO happy to handle a 2.5MHz+ digital input signal? I haven't really worked with digital signals over 1MHz with Teensies or other microcontrollers, and I'm not sure if the GPIO input circuitry might have practical limits below the QDC filter clock limits. (With the Teensy's internal clocks as fast as they are, are my expectations just way too low for its GPIO circuitry...?)
Thanks in advance!
Laogeodritt
(P.S. I really appreciate a traditional, web-searchable forum still being around. I've figured out so many of my problems or implementation challenges with Teensies thanks to searchable threads on here. Thanks for continuing to run it!)
I'm in the early engineering stages of a project, and I'm trying to figure out whether the Teensy 4.0 QDC will be able to handle the motor encoder we're using and our position detection requirements, or whether I need to plan on designing external circuits to do what we need. I think I have a good grasp on it and am just looking to confirm my understanding and figure out a few missing details, so hopefully this is a simple question for some of y'all.
Project context: We are considering using the Teensy 4.0 in a scientific instrument prototype. We will be using a motor whose quadrature encoder is outputting up to 5,000,000 pulses per second at the maximum motor speed (overall, so 2.5MHz on each signal A and B). We want to be able to accurately accumulate the motor position and take stroboscopic imagery, which involves providing a trigger signal at a precise position every rotation to the flash and camera equipment.
I've gone over Chapter 56 of the i.MX RT1060 manual (PDF, as hosted on the PJRC site) and the QDC seems to do more than what we need, all in hardware. From a search on the forums, I discovered mjs513's QuadEncoder library, which I understand is included by default in Teensyduino. (Yay! One of the things I love about using Teensies for these prototype and one-off projects)
My questions are:
* In general, does the QDC peripheral on the Teensy/i.MX RT1060 seem well suited to this task? Am I obviously missing some challenges in this post?
* Is it possible to route the POSMATCH signal to a GPIO output pin (e.g. via the XBAR), or are we limited to processing the event in software? At a glance it doesn't seem like the QuadEncoder library supports that, but that doesn't mean I wouldn't be able to configure this directly in the hardware registers myself.
* What is the "IPBus clock" that section 56.5.1.3.2 (filter) is talking about? Am I correct in assuming it's ipg_clk_root, and that this clock is 1/4 of the system clock (i.e. at an ARM clock of 600 MHz, this would be 150MHz)?
* I don't have too much experience with motor encoder noise/filtering at this speed. With our 2.5MHz A and B signals, presuming the 150MHz IPBus clock is correct, does this seem realistic to filter? With prescaler of 1, that seems to give us minimum 60 clock cycles per pulse on each of A, B, which I think gives more than enough leeway to play with number of samples or sample period.
* Is the Teensy 4.0's GPIO happy to handle a 2.5MHz+ digital input signal? I haven't really worked with digital signals over 1MHz with Teensies or other microcontrollers, and I'm not sure if the GPIO input circuitry might have practical limits below the QDC filter clock limits. (With the Teensy's internal clocks as fast as they are, are my expectations just way too low for its GPIO circuitry...?)
Thanks in advance!
Laogeodritt
(P.S. I really appreciate a traditional, web-searchable forum still being around. I've figured out so many of my problems or implementation challenges with Teensies thanks to searchable threads on here. Thanks for continuing to run it!)