Teensy 4.1 restarting by itself

jonesyro

Active member
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.
 
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?
 
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.
 
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.
 
EDIT: It was not the load cell amps - because it still reboots without the amps connected..

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:

Voltage-Issues4.jpg

z4qjXXk


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?

Screen Shot 2022-04-22 at 11.15.43 AM.jpg

View attachment PowerDiag.pdf
 
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:
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.
 
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.

View attachment 28182
 
Last edited by a moderator:
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)

LoadcellMod.jpg

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.

underneath.jpg

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.

deathcables.jpg

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.

rs.jpg
 
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.
 
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/dissipating-static-electricity-in-urethane-rollers-and-wheels/
 
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/dissipating-static-electricity-in-urethane-rollers-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.
 
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.
 
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 :)
 
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.
 
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.
 
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:

IMG_4924-2.jpg

IMG_4926.jpg
 
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)

View attachment 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?
 
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.
 
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-controls/static-control-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
 
Back
Top