Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 8 of 8

Thread: Teensy 3.6 DAC performance

  1. #1

    Teensy 3.6 DAC performance

    I'm working on a project to build a closed-loop controller to drive some galvanometers. Essentially I plan on implementing a simple PID controller in software in the Teensy, to use the dual DACs to drive some large op-amps to control the position of the galvanometers. There will be physical position detectors with a position-sensing circuit that i'll use to feedback via the dual ADCs.

    My question is: what's the maximum frequency I can expect to update the DACs? Looking at the spec sheet for the processor, it looks like it guarantees about 33Khz (30µs settling time), but i'm wondering if I can push it significantly faster than that if i'm looking for no more than 10-bit resolution, and i'm not moving full-scale between samples? Should I be operating in DMA mode and writing directly to the DAC registers?

    Looks like the ADCs can handle somewhere between 1-24 Mhz in 13-bit mode, so no concern about performance there.

    Thanks,
    —Joey

  2. #2
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,655
    Here is an earlier thread that might suggest ways you could test the DACs with a scope
    https://forum.pjrc.com/threads/26036...-using-Arduino
    "So even with large steps and a 100 pF load, the DAC seems capable of settling in just a few us." (T3.1)

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,088
    Yes, the DAC is a lot faster than Freescale's specs.

    Several people have reported very brief/narrow spikes when it switches between certain codes, so you should always use an analog low-pass filter before feeding the voltage into sensitive opamp circuits.

  4. #4
    Excellent. Thanks for the tips. That prior thread and your note, Paul, are a great help.

    Hopefully I'll have a really interesting project to post about in a few months. Long road ahead of me learning about analog design and getting a bit out of my comfort zone though…

  5. #5
    Member educa's Avatar
    Join Date
    Jan 2017
    Location
    Belgium
    Posts
    27
    33kHz on the dac as safe number is allready a lot for the closed loop galvos. I tried this on a arduino due which was a slower cpu (84mHz I think) and cortex m3
    you can easily set the dacs a lot faster but the question is how fast the galvo drivers can react. Galvo sets greater than 30K are quire expensive

    While I' m typing now. Is the dac of a teensy 3.6 capable of generating the complete 0 -> 3.3v range or is it like the arduino due only a subset like 0.75 -> 2.55v ?

    that is important for the opamp setup

  6. #6
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,655
    Quote Originally Posted by educa View Post

    While I' m typing now. Is the dac of a teensy 3.6 capable of generating the complete 0 -> 3.3v range or is it like the arduino due only a subset like 0.75 -> 2.55v ?
    DAC does 0 to 3.3v, output max 1 ma.

  7. #7
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,088
    When using 3.3V power as the reference, the DAC does have a full 0 to 3.3V output range.

    However, the output current is very limited. Resistive loads will result in somewhat less range, due to the limited output drive. Capacitive loads will dramatically reduce the speed. If you care about the DAC's performance, an opamp buffer is highly recommended, perhaps with a simple R-C filter if your opamp doesn't appreciate the fast edges when it updates (many opamps have trouble with this).

  8. #8
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,600
    Sallen-Key filters based on a voltage follower op-amp are simple to implement and give already acceptable results if the corner frequency is half the sampling frequency. When doubling the sampling rate so that fs >= 4*fmax, everything "digital" will sink below the analog noise floor.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •