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

Thread: Teensy 4.1 restarting by itself

  1. #1

    Teensy 4.1 restarting by itself

    I have two Teensys 4.1 and both are powered using the same 5V source. They communicate together via RX/TX/GND.

    Main Teensy has a 128x32 OLED display connected to 3.3V and two Sparksfun loadcell amplifiers also connected to the 3.3v pin.

    The second Teensy(stepper motor Teensy) has a DM556T stepper driver connected to it with Steps, Dir and Ena are connected to 3.3Vpin

    My machine was working very good before I added the two load cell amps, now when I run the machine, the Main Teensy reboots by itself after a while.

    So my questions are:

    1- Is this normal?, maybe there's a limitation on how many devices we can power on the 3.3V and that would cause a reboot?

    2- Could the motor Teensy crash and make the main teensy reboot?

    If it turns out to be #1, would installing a little 3.3v regulator on the main 5V source and hooking up the load cell amps fix the overload?

    Thanks very much for reading this.

  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    16,014
    The 3.3V current is limited - not seen trouble with common 128x32 OLEDS taking too much, and the linked SFun item shows: "Operation Current: < 1.5mA"

    Teensy restarting is not at all common - sounds like something is shorting out the power?

    Are the load cells in use, i.e. changing - being touched/affected, when the Teensy restarts?

    Perhaps, try to repeat with connecting just one of the load cells each in turn - maybe one is defective?

  3. #3
    Quote Originally Posted by defragster View Post
    The 3.3V current is limited - not seen trouble with common 128x32 OLEDS taking too much, and the linked SFun item shows: "Operation Current: < 1.5mA"

    Teensy restarting is not at all common - sounds like something is shorting out the power?

    Are the load cells in use, i.e. changing - being touched/affected, when the Teensy restarts?

    Perhaps, try to repeat with connecting just one of the load cells each in turn - maybe one is defective?

    I disconnected both load cells and the machine runs normal..

    I then disconnected only the power from the loadcell amps from the Teensy (digital pin 2,3,4,5 and ground still connected) and the teensy was rebooting as well.

    The load cells are bolted on the aluminum frame, the amps are velcro'd underneath so nothing shorts there. I checked with my multi meter and the load cells are not touching the frame.

    I will try eliminating one at a time as you suggested, but also maybe it's the code that could make it reboot? It's only polling the weight every 2000 milliseconds though.

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    26,398
    Both code and power drain could do it.

    The default fault handler waits 8 seconds before rebooting. At startup, your program can use CrashReport to check if reboot was caused by a crash.

    The MKL02 chip monitors the 3.3V power. It will reboot the hardware if the voltage falls below approx 2.9 volts. Reboot happens quickly, and CrashReport doesn't have any info because it appears to be as if power was shut off and then returned.

  5. #5
    EDIT: It was not the load cell amps - because it still reboots without the amps connected..

    Quote Originally Posted by PaulStoffregen View Post
    Both code and power drain could do it.

    The default fault handler waits 8 seconds before rebooting. At startup, your program can use CrashReport to check if reboot was caused by a crash.

    The MKL02 chip monitors the 3.3V power. It will reboot the hardware if the voltage falls below approx 2.9 volts. Reboot happens quickly, and CrashReport doesn't have any info because it appears to be as if power was shut off and then returned.
    I ran a crash report but it was normal, I have a feeling it's happening very quickly. Hooked up oscilloscope to 5v/gnd of each teensy's and these are the spikes/voltage drop when the reboot occur:

    Click image for larger version. 

Name:	Voltage-Issues4.jpg 
Views:	23 
Size:	152.8 KB 
ID:	28162



    So I'm thinking of adding a 5V PSU only for Teensys - to isolate them from the main 24V PSU that feeds the stepper motor and the odrive controller with 3 phase motors.

    Not sure How to do it.. so I made this diagram, let me know if this could work?

    Click image for larger version. 

Name:	Screen Shot 2022-04-22 at 11.15.43 AM.jpg 
Views:	18 
Size:	68.7 KB 
ID:	28161

    PowerDiag.pdf

  6. #6
    Senior Member
    Join Date
    Dec 2015
    Location
    LA
    Posts
    242
    Can't read the oscilloscope settings to tell but looks likely. As far as the schematic all the grounds should be terminated together. Also, I wouldn't trust any power lines (except GND) going to or coming from any motor driver and a Teensy. For the digital i/o to motor drivers, optical isolators are preferred, otherwise really look at the specs for the devices. When motor drivers mess up they tend to send high voltages and currents everywhere, especially power connections.

    edit:
    Looked at a DM556T.pdf and the proposed schematic looks ok for it, though it says TTL which is 5V. Assuming the DM556T schematic is correct and the 3.3V doesn't go anywhere else but to the opt driver led its probably ok.
    Last edited by bicycleguy; 04-25-2022 at 12:39 AM. Reason: more info

  7. #7
    Quote Originally Posted by bicycleguy View Post

    Looked at a DM556T.pdf and the proposed schematic looks ok for it, though it says TTL which is 5V. Assuming the DM556T schematic is correct and the 3.3V doesn't go anywhere else but to the opt driver led its probably ok.
    What about the TX/RX/GND lines from Odrive controller and Teensy? Could this mess things up? I was thinking of isolating these with a board like this: https://www.ti.com/tool/ISO7762DBQEVM

  8. #8
    Senior Member
    Join Date
    Jul 2020
    Posts
    1,748
    Maybe use star-grounding for the various power supplies? I see several loops in the ground including high-current paths, which isn't a
    great plan. Try to ensure any signal wire only runs alongside low-current ground wires. High current paths will have IR and LdI/dt
    voltages across them which can be substantial and directly inject noise spikes into signal wires using that ground wire as a return.

    Looking at the existing circuit you have a 5V supply that's only for T4.1's, but its connected to 24V ground in two ways - my first
    suggestion is lose the direct connection and only have the Rx/Tx/GND cable from the Odrive to the T4's and 5V supply - this is the
    only place you need to link grounds between controllers and the 24V subsystem - the other signal paths are opto-isolated.

  9. #9
    Quote Originally Posted by MarkT View Post
    Maybe use star-grounding for the various power supplies? I see several loops in the ground including high-current paths, which isn't a
    great plan. Try to ensure any signal wire only runs alongside low-current ground wires. High current paths will have IR and LdI/dt
    voltages across them which can be substantial and directly inject noise spikes into signal wires using that ground wire as a return.

    Looking at the existing circuit you have a 5V supply that's only for T4.1's, but its connected to 24V ground in two ways - my first
    suggestion is lose the direct connection and only have the Rx/Tx/GND cable from the Odrive to the T4's and 5V supply - this is the
    only place you need to link grounds between controllers and the 24V subsystem - the other signal paths are opto-isolated.

    Thanks Mark - I went back to the original wiring and removed the second supply. See diagram below. I may try star grounding as well, have to look into this but in your opinion do you see issues with the wiring below? I could add a 5v to 3.3v regulator and move the stepper 3.3v to this reg to free sucking out voltages from the teensy.. and still could add logic isolators for Odrive and Stepper.

    Click image for larger version. 

Name:	Screen Shot 2022-04-25 at 2.40.45 PM.jpg 
Views:	14 
Size:	71.4 KB 
ID:	28182
    Last edited by defragster; 04-25-2022 at 09:57 PM. Reason: pic relink p#10

  10. #10
    Can't edit previous post, correcting the diagram. I forgot to plug the ground from 5V Vreg to the teensy.

    Click image for larger version. 

Name:	Screen Shot 2022-04-25 at 2.40.45 PM.jpg 
Views:	14 
Size:	71.4 KB 
ID:	28182

  11. #11
    I ordered two logic isolators, will be used on Odrive and Stepper and also a good Isolated DC-DC 24v to 12V converter.

    Logic Isolators:
    https://www.mouser.com/ProductDetail...bVHlhK0Q%3D%3D

    Isolated DC DC converter:
    https://www.mouser.com/ProductDetail...rrencycode=USD

    These should help break my ground loops.

  12. #12
    I just figured out the issue and it's a VERY weird one. ( for me at least)

    The restart is caused when bringing the 2 load cell cables close to the Teenys on the PCB. It's totally repeatable.
    If I move the cables out of the way, the machine runs perfect, no restarts. If I bring them back closer to the Teensys, the main Teensy restarts.

    Each load cell amplifier is connected to rollers on top of the machine, film roll through those. The weird thing is the load cell makes zero contact with the aluminum chassis (top plate) nor the metal roller. And the screws holding the module to the top plate are going through PLA plastic, no contact with the load cell itself. This is verified with my multimeter continuity tests.

    Here's a pic of a roller module. (there are one on each side)

    Click image for larger version. 

Name:	LoadcellMod.jpg 
Views:	9 
Size:	132.6 KB 
ID:	28229

    And here's a pic of under the machine where you can see the left hand side load cell amplifier. It is velcro'd under the top plate with the cable moved out of the way.

    Click image for larger version. 

Name:	underneath.jpg 
Views:	7 
Size:	134.0 KB 
ID:	28230

    No problem running the machine like this - everything is perfect. BUT if I bring the cables in over the Teensy's, not even plugged in the PCB, the main Teensy crashes after a couple seconds.

    This is showing the cables over the Teensys.

    Click image for larger version. 

Name:	deathcables.jpg 
Views:	6 
Size:	172.5 KB 
ID:	28231

    So I got some Belden 2 twisted and shielded pairs cable and will install that, grounding the cable on the PCB ground and hopefully that will fix the issue.

    NOW I would love to understand the phenomenon, it was very difficult to diagnose because I was only disconnecting the cables, not moving them out of the way and I thought "They're not connected" and it still restart so they are not the problem... AND ALSO if there was no film on the machine, I could run the machine indefinitely, without any restart.

    So my guess is when there's film passing through the roller, and the roller spins at high velocity, it must create some electricity, static or something else.. and this is passed through the cables (I don't get it because as I said, the load cell bar nor the roller touch the aluminum plate)
    and when the cables are near the Teensys, it restarts. Why only the main teensy restart and the motor one doesn't is still a mystery...

    In any case I am VERY relieved, what a crazy 3 weeks it has been, hopefully shielded cables will solve this for good. So stressful.

    If anyone understand what's going on here, I Would love to learn why it is happening.

    Here's the prototype machine in full.

    Click image for larger version. 

Name:	rs.jpg 
Views:	9 
Size:	166.4 KB 
ID:	28232

  13. #13
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    16,014
    So, the load cells measure the tension of the passing film?

    Is the aluminum plate structure grounded?

    Passing plastic strips over aluminum plate makes me think of how unhappy my cat is when I take off wool or microfiber and don't discharge into a house switch plate screw before cat contact - there is a good snapping discharge to the house when I do remember.

  14. #14
    Quote Originally Posted by defragster View Post
    So, the load cells measure the tension of the passing film?

    Is the aluminum plate structure grounded?

    Passing plastic strips over aluminum plate makes me think of how unhappy my cat is when I take off wool or microfiber and don't discharge into a house switch plate screw before cat contact - there is a good snapping discharge to the house when I do remember.
    Correct, load cells measure tension and torque is adjusted accordingly.

    Weirdly, grounding the aluminum plate made no difference in this case, with or without chassis grounding the teensy restarts when the cables are close to it. I tell you last night I thought I was having a Poltergeist and I don't believe in that stuff haha!

    Your cat analogy make sense. Also I saw this article about rubber rollers and wheels - it has to be that.

    https://www.linearmotiontips.com/dis...rs-and-wheels/

  15. #15
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    16,014
    Quote Originally Posted by jonesyro View Post
    Correct, load cells measure tension and torque is adjusted accordingly.

    Weirdly, grounding the aluminum plate made no difference in this case, with or without chassis grounding the teensy restarts when the cables are close to it. I tell you last night I thought I was having a Poltergeist and I don't believe in that stuff haha!

    Your cat analogy make sense. Also I saw this article about rubber rollers and wheels - it has to be that.

    https://www.linearmotiontips.com/dis...rs-and-wheels/
    There are two other plates of aluminum under the spools and indeed the passing rollers. I was assuming the spindles on them hit the main aluminum plate - but it seems they may be insulated as well by bearings?

    Glad my cat analogy seems appropriate - since I'm not an EE or Physicist I had to keep it to something close to home

    Might be good to get those electrons in line, wouldn't want to zap that camera.

  16. #16
    Quote Originally Posted by defragster View Post
    There are two other plates of aluminum under the spools and indeed the passing rollers. I was assuming the spindles on them hit the main aluminum plate - but it seems they may be insulated as well by bearings?

    Glad my cat analogy seems appropriate - since I'm not an EE or Physicist I had to keep it to something close to home

    Might be good to get those electrons in line, wouldn't want to zap that camera.
    I will tame them electrons! That would be an expensive zap. The camera survived many restart though it's been unplugged for a while while I diagnosed this. The load cell rollers don't touch the main aluminum plate but the main reel platter are direct drive to the 3 phase motors, I will be revising the design, maybe adding rubber belts would create some isolation.

  17. #17
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    16,014
    Quote Originally Posted by jonesyro View Post
    I will tame them electrons! That would be an expensive zap. The camera survived many restart though it's been unplugged for a while while I diagnosed this. The load cell rollers don't touch the main aluminum plate but the main reel platter are direct drive to the 3 phase motors, I will be revising the design, maybe adding rubber belts would create some isolation.
    Doesn't a Van DeGraff generator use a belt

  18. #18
    Junior Member
    Join Date
    Jan 2021
    Location
    USA
    Posts
    5
    I'm guessing the Teensy doesn't reset when the stepper drive is not powered. Mount PSU and drive to the plate, keep the wires from PSU <> Drive <> motor as short as possible and as far away from the rest of the stuff as possible. All that switching and long wires tends to broadcast chaos. Any unused pins should be set as input and tied to 0 or 3v3 or unconnected and set as output.
    Belts, Rubber rollers, and plastic film, can all generate static. Even if you had steel gears and rollers, the film will still make static just from the unwinding and rewinding. Cover the load cell and wire with a metal shield. All metal parts should be connected to the plate, avoid plastic spacers where possible.

    I once pointed at a defect while slitting a 50" wide roll of thin plastic, I will not make that mistake again. The machine is all metal frame and rollers but the static in the dry weather is amazing.

  19. #19
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    16,014
    Quote Originally Posted by chaos View Post
    I'm guessing the Teensy doesn't reset when the stepper drive is not powered. Mount PSU and drive to the plate, keep the wires from PSU <> Drive <> motor as short as possible and as far away from the rest of the stuff as possible. All that switching and long wires tends to broadcast chaos. Any unused pins should be set as input and tied to 0 or 3v3 or unconnected and set as output.
    Belts, Rubber rollers, and plastic film, can all generate static. Even if you had steel gears and rollers, the film will still make static just from the unwinding and rewinding. Cover the load cell and wire with a metal shield. All metal parts should be connected to the plate, avoid plastic spacers where possible.

    I once pointed at a defect while slitting a 50" wide roll of thin plastic, I will not make that mistake again. The machine is all metal frame and rollers but the static in the dry weather is amazing.
    Just bringing this from p#12:
    ... AND ALSO if there was no film on the machine, I could run the machine indefinitely, without any restart.
    ...
    Not sure if this 'no film ... run' would be exercising the stepper the same without the spool tensioner feedback.

  20. #20
    Quote Originally Posted by chaos View Post
    I'm guessing the Teensy doesn't reset when the stepper drive is not powered. Mount PSU and drive to the plate, keep the wires from PSU <> Drive <> motor as short as possible and as far away from the rest of the stuff as possible. All that switching and long wires tends to broadcast chaos. Any unused pins should be set as input and tied to 0 or 3v3 or unconnected and set as output.
    Belts, Rubber rollers, and plastic film, can all generate static. Even if you had steel gears and rollers, the film will still make static just from the unwinding and rewinding. Cover the load cell and wire with a metal shield. All metal parts should be connected to the plate, avoid plastic spacers where possible.

    I once pointed at a defect while slitting a 50" wide roll of thin plastic, I will not make that mistake again. The machine is all metal frame and rollers but the static in the dry weather is amazing.
    The teensys were not restarting with stepper and torque motors going full speed without film threaded on the machine.

    I just made an experiment and it explains a lot. I plugged in a cable in the load cell and ran the machine, it crashed after 30~40sec. Then I left the setup as is and added an Ionizing fan blowing on the load cell (that the cable is hooked up to) and started the machine. The roll unspooled to the end at regular playback speed and the I rewinded it full speed, no crash. This is impossible to achieve without the Ionizing fan and this cable (Same cables I was using for the last 30 days...)

    So what's happening is as the film pass through the rollers attached to the load cells(note that the load cell bars have no continuity with the aluminum top plate), the load cells are receiving static electricity from the film and this is passed through the 4 wires to the amp, amp has the cable connected going to PCB / near the Teensys and ignite transient voltage spikes. And I've seen really massive ones.

    So now will try shielded cables and also mount the load cell bars UNDER the top plate and see what happens. And maybe for additional protection in final design I can 2 small Ionizing fans, at beginning and end of film path.

    Here's a picture of the setup:

    Click image for larger version. 

Name:	IMG_4924-2.jpg 
Views:	4 
Size:	178.4 KB 
ID:	28236

    Click image for larger version. 

Name:	IMG_4926.jpg 
Views:	2 
Size:	104.3 KB 
ID:	28237

  21. #21
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    16,014
    Would a grounded wiper 'brush' (desolder braid?) contacting on the back side of the metal tension rollers bleed off enough to aid in electron control?

    Here's a pic of a roller module. (there are one on each side)

    Click image for larger version. 

Name:	LoadcellMod.jpg 
Views:	9 
Size:	132.6 KB 
ID:	28229
    That roller makes full height contact on one side with the film to metal on each side entering or exiting a spool. Still motion to recharge on either side - but might reduce the highest potential field where the load cells reside - and not add any chance of injuring the film itself. Though the copper might transfer to the roller/film if brushing too hard - so maybe just the roller guide top?

  22. #22
    Junior Member
    Join Date
    Jan 2021
    Location
    USA
    Posts
    5
    Load cell under plate is great. Ionizer may help with dust too (need filter though). Just be sure to keep all the metal bits like the load cell body and the roller connected to the plate which is grounded or use something like this https://www.mcmaster.com/static-cont...ntrol-brushes/ for some of the moving parts.

  23. #23
    Thanks very much @defragster and @chaos for helping me with this. Belden 8723 shielded 4 connectors (grounded to plate) helped a little but still crashed - so now moving the load cells under the plate for next test.

    The brushes are really good idea, I have seen brushes on film cleaning machines before.

    EDIT: will also modify the PCB and place the connectors on the edge of the board... not near the teensys as they are now.

  24. #24
    Quote Originally Posted by chaos View Post
    Load cell under plate is great. Ionizer may help with dust too (need filter though). Just be sure to keep all the metal bits like the load cell body and the roller connected to the plate which is grounded or use something like this https://www.mcmaster.com/static-cont...ntrol-brushes/ for some of the moving parts.
    Load cells underneath appear to have fixed it, and I tested using the original cables (non shielded).

    Now I'm thinking I'll add ionizing fans on top as well, I can only see benefit because as you said it will loosen dust and the particle transfer rollers will grab more of it.

    Good lord what I went through for the last 3 weeks. Agonizing but so relieved now

Posting Permissions

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