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

Thread: Teensy 4.0 and step stipcks hookup.

  1. #1
    Junior Member
    Join Date
    Feb 2020
    Posts
    17

    Teensy 4.0 and step stipcks hookup.

    Another Teensy project, another pile of dead teensies

    I hooked up a stepstick (TMC2208) by the book to a Teensy 4.0.

    EN, STEP and DIR are directly connected to Teensy pins, VCC_IO (as TMC calls it) to 3.3V from the Teensy 3.3V supply, and VMOT to a 12V supply. All GNDs are common.
    And a 100uF cap over the 12V and GND as the datasheet says.

    The TMC2208 is supposed to be able to run at 3.3V and not send unexpected 5V out. In this case it's not supposed to send anything to the Teensy!
    The same prototype board works fine hooked up with an old Uno.

    Click image for larger version. 

Name:	deadteensy.jpg 
Views:	44 
Size:	194.1 KB 
ID:	19205

    What is good practice when it comes to hooking up stuff to the 3.3V Teensy? It seems quite fragile.

    I could add level shifters, or add some inline resistors on the signals.

  2. #2
    Junior Member
    Join Date
    Feb 2020
    Posts
    17
    Explaining your problems makes you think

    After some measurements it looks like the damned chip has internal pullups to some internally generated 5V. When motor power is supplied to the chip it will pull-up some IO pins to 5V, even if the digital power supply is 3.3V.

    Bastards!

    I could add some pull-down resistors, or external stronger pull-ups to 3.3V, or make sure the Teensy are driving those pins before powering on the stepper driver (assuming they pull harder) .

  3. #3
    Junior Member
    Join Date
    Feb 2020
    Posts
    17
    Did some further research while waiting for new Teensies to ship.


    From https://learn.watterott.com/silentstepstick/faq/:
    SilentStepSticks with variable 3-5V logic voltage
    At power-up the motor supply voltage VM should come up first and then the logic supply voltage VIO. On power-down the logic supply voltage VIO should turned off at first and then the motor supply voltage VM, because the internal logic of the TMCxxxx driver is powered from VM. To ensure the correct powering a schottky diode from VIO (anode) to VM (cathode) can be added. The v2 Protectors for SilentStepSticks include this schottky diode.
    And indeed the TMC is messing with VIO, the supplied 3.3V logic voltage, when powered up. Not enough to kill an Arduino UNO, but enough to kill a Teensy 4.0.
    Click image for larger version. 

Name:	VIO.jpg 
Views:	54 
Size:	158.1 KB 
ID:	19212

  4. #4
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    13,752
    Ouch! Hopefully the pile of dead T4's is small in number. Another thread had robot Servo's feeding back power on data lines - bad wires were mentioned - ruining T4's too.

  5. #5
    Senior Member
    Join Date
    Mar 2016
    Posts
    322
    For what it's worth, you can use 74HCT (or 74AHCT) logic to interface between 3.3V logic and 5V for outputs. the 74HCT541 has 8 non-inverting buffers. Recommend current output limit is 8mA though HCT seems more robust than that. I'm using them in one design.

  6. #6
    Junior Member
    Join Date
    Feb 2020
    Posts
    17
    Quote Originally Posted by defragster View Post
    Ouch! Hopefully the pile of dead T4's is small in number. Another thread had robot Servo's feeding back power on data lines - bad wires were mentioned - ruining T4's too.
    That was me too. My pile of dead boards is quite respectable. Makes a grown man cry.

    It seems like the powering sequence is the issue here. The motor power supply has to be turned on and stable before you turn on the logic power. The TMC chips are quite fragile too, powered on in the wrong order and they break.

    Looks like the safest would be to add a voltage regulator from motor voltage to 5V and power the teensy with that.
    The be safe I should add that schottky diode watterott suggest.
    And possibly a separate 3.3V linear regulator that powers the TMCs 3.3V line to isolate it from the Teensy. That spike they send when motor power is turned on looks pretty nasty.

    And a bunch of 300ohm resistors in series with all signals, that fixed the problem on the robot.

  7. #7
    Senior Member
    Join Date
    Mar 2016
    Posts
    322
    So a little bit more on my design with the T4 - it's driving a number of steppers controllers. While, in theory, I could drive the stepper controllers directly off the 3.3V logic (they have opto interfaces), I chose to use 5V. Mainly because there seems to be a lot of vagueness in stepper driver specs. Some say 5V or higher and most are silent about voltage and current. But also because I wanted to isolate the T4 from external voltages that could run very high (48-80 V, typically). So I used 74HCT541 non-inverting buffers for outputs. This creates a 3.3V only central zone. Nothing external touches the 3.3V zone. Either from optos for input or the 74HCT541s for output. HCT logic has a Vih of 2V so it works fine with 3.3V logic. So far, the only thing that has damaged a t4 in my shop is an errant soldering iron.

  8. #8
    Junior Member
    Join Date
    Feb 2020
    Posts
    17
    Quite embarrassing.

    I am the idiot again sending 12V into the poor Teensys 3.3V, and the drivers IO power pin. A crappy cable carrying 12V on my prototype board had the plastic insulation melted and it sometimes contacted the 3.3V line!

    I really need to improve my prototype building skills.

    To avoid my poor prototyping skills I quickly designed and ordered some PCBs, it's dirt cheap to get them made. Just takes some time for shipping.

    Click image for larger version. 

Name:	TinyStep.jpg 
Views:	40 
Size:	249.4 KB 
ID:	19262

  9. #9
    Member
    Join Date
    May 2018
    Location
    Land between two rivers
    Posts
    45
    Does anybody know if these issues also effect the TMC2209? I've integrated a few of them onto a PCB with all the rest of my needed circuits. I can see how to add circuits to deal with the issues. If possible I don't want to increase the BOM cost and the size of the PCB.

    I've added a p-fet switch to allow turning on of the VCC_IO after the motor VS supply is turned on. The p-fet also blocks any spike from the TMC2209 chips when the VS supply is turned on.

  10. #10
    Senior Member
    Join Date
    Jul 2020
    Posts
    916
    This sounds like a job for digital-isolators, galvanic isolation for motor drivers is good to have anyway.

  11. #11
    Senior Member
    Join Date
    Mar 2016
    Posts
    322
    As I understand it, any of the TMC drivers that can run on 3.3V or 5V are affected by it. PFET is not a bad idea at all. I've been through a lot of TMC driver datasheets (2208, 2209, 2130, 5160) and did not see anything on the timing of VCC_IO vs VMot. Watterott has some info here. Though I'm not 100% sure what he is trying to say on this page.

    optoisolators aren't a bad idea though programming the stepsticks requires isolated async or SPI adding additional cost. Most board that use stepsticks don't bother with isolation. Also, supporting a reasonable step rate - say 100kHz or higher- needs fairly high speed optos (ie, more costly than your garden variety optoisolators).

  12. #12
    Senior Member
    Join Date
    Jul 2020
    Posts
    916
    Quote Originally Posted by PhilB View Post
    optoisolators aren't a bad idea though programming the stepsticks requires isolated async or SPI adding additional cost. Most board that use stepsticks don't bother with isolation. Also, supporting a reasonable step rate - say 100kHz or higher- needs fairly high speed optos (ie, more costly than your garden variety optoisolators).
    Digital isolators, not opto-isolators. They are 1Mbps and up and logic inputs/outputs. They are becoming affordable and available
    in a mix of directions per chip.

    For instance: https://uk.farnell.com/silicon-labs/...tal%20isolator

    Most opto isolators are too slow for modern logic as the slew-rate is below the minimum to guarantee glitch-free
    operation - there are some fast ones, but I think the digital isolators are taking their place.

  13. #13
    Member
    Join Date
    May 2018
    Location
    Land between two rivers
    Posts
    45
    Quote Originally Posted by PhilB View Post
    As I understand it, any of the TMC drivers that can run on 3.3V or 5V are affected by it. PFET is not a bad idea at all. I've been through a lot of TMC driver datasheets (2208, 2209, 2130, 5160) and did not see anything on the timing of VCC_IO vs VMot. Watterott has some info here. Though I'm not 100% sure what he is trying to say on this page.
    Looks like they are clamping VCCIO to ground until VM is present. Could be nasty to some power supplies. I like my p-fet switch much better. Especially considering I'm also turning on the VS motor supply via an IO line from the Teensy. I also read lots of TMC docs and never saw anything on it so that was why I asked. Now that I'm warned, one IO pin, and <$1 in parts fixes the VCCIO issue.

    My power supply turn on sequence 56V POE comes up. 5VDC Vin for Teensy is generated from it. Teensy powers up and generated it's 3.3VDC supply. During Teensy initialization, POE power mode allowed is negotiated. Could be via hardware or network packets. Once negotiated the dummy hardware loads are turned off, and the VS motor supply is turned on. After it is stable, then the VCC_IO p-fet can be turned on. In the future I may switch to higher voltage stepper motor driver circuits so I can directly use the POE power to run the stepper motors. Likely at the same time I switch from 2-phase steppers to switched reluctance ones.

    I don't have specific back EMF protection. I do have MOVs as part of my EMI filter. Clamping the motor lines to be between GND-diode drop and VS+diode drop would be good for robustness.

    As for digital isolation for the rest of the lines. Yes, capacitive and RF digital isolators are faster and have less glitches. Opto could be used if Schmidt triggers are used on the outputs, but that adds cost and PCB space. Something like the TI TXS0102 or ON NTS0102-Q100 like I've used in the past would work, widely second sourced. Now I'd use the flip chip 8 pin BGA package and reflow them. In the past I used the SO-8 and hand soldered. The 8 pin BGAs being two rows of 4 .25mm ball pads spaced on .5mm centers meets my .20 minimum spacing requirements for low cost 2oz copper PCBs.

    Yeah, I surveyed a bunch of PCB manufacturers for low cost 4 layer 2oz copper on all 4 layers. To be able to sent to any of the lowest cost ones I needed >= 0.15mm copper to copper spacings and trace widths. So my PCB has been designed with that in mind. I actually set my minimum to 0.2mm for higher reliability, why push it. The extra copper will give great heat sinking in the PCB for fanless operation even at a full 2A load. I'm not sure what my home made stepper motors will need. They are pieces of art, not traditional stepper motors.

    Pic 1 is what I'm testing and writing code to now. Still working despite the VCC_IO being hooked directly to the Teensy 3.3VDC. Unfortunately I don't have a pic from before I added the TFT display. All circuits worked with test code. It just has a regular ethernet connection and a separate 9 to 29VDC motor power supply. In this one I'm using the TFT touch screen. Next one will use an OLED display with 4 keys for setting parameters. Ethernet is for getting the current time from the internet.

    Pic 2 is a 3D model of the latest proto PCB layout. I haven't put digital isolators in yet. This does have resistors on the IO lines to the TMC stepper motor drivers. I also need to swap around pin use, and finish routing it. This one has the stepper motors off one end of the Teensy, not along one side like the current proto I'm testing now. That changes the best pin selection around some. Proper #defines and #ifdefs in the software makes it easy to have multiple different boards using the same code base. POE power and IO are on one end, and the stepper motor connects are on the other. It will slip into a standard 160mm by 100mm Eurocard slot.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	IMG_20210228_042041--crop.jpg 
Views:	8 
Size:	222.5 KB 
ID:	23924   Click image for larger version. 

Name:	Ring-Stepper-Clock-new.jpg 
Views:	12 
Size:	94.8 KB 
ID:	23923  


Posting Permissions

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