Dual Teensy 4.0 Board for Sensor Input and Motor Control - Review

Status
Not open for further replies.

ctadlock

Active member
Hello all, I'm looking for feedback on the below design. We are more software people than electronics/hardware people and this is our first board. Hopefully there is enough detail here. I have a set of questions Id like to get answered, plus if anyone sees anything else that should be fixed and/or improved. I can answer any specific questions as needed. Thank you in advance!!

A $50 Amazon gift card to anyone that digs in deep and provides really useful guidance.

The product we are building is a PC - Teensy based system to encode RFID tags. You can see the prototype (breadboard based, only one Teensy) in action at the video link below. It is a next generation of our previous smaller "analog" based system (that we did not design the electronics for). The PC and Teensy(s) are connected via USB/serial, with the PC telling the Teensy what to do and the Teensy reporting back when certain events happen. In general the PC is responsible for the RFID side and the Teensy is responsible for motor control, speed, LEDs, LCDs and tag counting.

Video
https://www.youtube.com/watch?v=a01vmJqBavk

The PCB board we are building is an integration board in that it integrates several other boards and sensors; there are no standalone ICs. The other boards are mounted as daughter boards on headers, the sensors are attached with connectors and there is an external stepper motor driver that is not on the PCB.

Computer/USB
The PC is connected to an industrial USB 3.0 hub. The USB hub is then connected to the 2 Teensy 4.0 on the PCB, the RFID hardware and the barcode scanner. The USB hub is powered via the 24V power supply and is connected with PWR and GND. (will be important later). The USB hub specs states it can provide 2.4A to each device, although since Teensy is USB 2 Im not totally sure if its 2.4A or the standard 500ma; there seems to be a negotiation process for this built into USB. Since the PC is connected via USB to the USB hub and the USB hub is connected to DC ground, the PC is also then connected to DC GND.

Power
AC: Power starts as AC at the wall and comes into a power strip (with breaker). From there the following components are connected via AC; PC via an AC/DC power brick (no earth), a 12v AC/DC power supply and an 24v AC/DC power supply. The earth pins of the DC power supplies are connected to the power plug from the wall as well as the table frame.
DC: The 12V runs to the two DC motors; via the motor driver on the PCB and to the screw terminals on the board. The tag counter uses 12V which is why it runs to the PCB. The 24V is connected the stepper motor driver (not on PCB) and to the PCB; the LED driver (24 channel) uses 24V.
GND: The DC GND of the two DC power supplies are connected. A wire runs from the DC power supply grounds to the PCB screw terminal. The bottom layer of the PCB is filled with GND as possible (ground plane, see below)
BUCK: On the PCB there is a need for both 3.3V and 5V power in addition to the 12V and 24V. Several components use the 3.3V (3 pots and the optical switches (EOR)) and the LCD uses 5V. Im using two Pololu buck converters (switched) to go from 12V to 3.3V and 24V to 5V. Im not using the 3.3V or VUSB from the Teensy at all.

Teensys
2x Teensy 4.0s are connected via I2C. One is the master and the other is a slave; the slave handles the DC and stepper motor control. We had to use two as some of the libraries we are using have delays and we use serial communication between PC and Teensy and this was causing stuttering in the stepper motor. The two Teensy use the alternate I2C pins (17, 16) as the LCD library is hardcoded to the primary pins (19, 18). We have a 4.7ohm pull up resistor from the 3.3V rail (from buck, not Teensy) to both the SDA and SCL traces. The Teensy is powered via USB.

Motors
The table has three motors; 2x 24V brushed DC motors (powered with 12V) (these are big motors) and one stepper motor controlled via a stepper motor driver off the PCB. I have replaced the motor cables with high-quality twisted and shielded cables and connected the shield to the table frame (which is connected to AC earth). The shield is not connected to the PCB.

LEDs
We are using the Adafruit LED driver (I2C). It is connected to the master Teensy via the standard I2C pins; this means it is on a separate I2C bus than the Teensy to Teensy I2C bus. The LED driver has a 100uF capacitor on it.

Optical Switches (EOR)
These are two slotted optical switches we use to detect when the labels have unrolled all the way to stop the motors so they dont keep spinning. We work with both opaque and clear tags and it is not clear what the best resistor setting to detect all types is just yet, so we added a trim pot to allow for tweaking. Were using the trim pot as a variable resistor, not a pot; the 3rd unused pin is connected to the wiper (pin 2). The signal from the optical switches is read as analog, but we convert to digital in software as we have a long debounce to ensure accuracy (500ms). Each connection uses through hole optocoupler to deal with the 12V <> 3V.

Noise
With all the motors and long wires there is a good potential for interference. The analog components are the 3 pots (which control motor speed/torque) and the optical switches. We see a bit of variance in the inputs from the pots and we are using software to filter these out, but Id like to use hardware as appropriate to keep them clean.

Capacitors
There are lots of capacitors on the PCB. There are two big 100uF electrolytic connected to 12V and 24V near the screw terminal; this is to act as a power bank for the 2ft wires back to the DC power supplies. On the various power rails (3.3V, 5V, 12V and 24V) I have smaller ceramic capacitors (0.1uF?) right before the connection/pin to further stabilize the voltage and hopefully remove any noise in the system. Most of the capacitors are mounted on the bottom; this isn't an issue as the board is be mounted on posts.

Traces
The board is fairly big, so Im using fairly big trace widths. The signal traces are 40 and the power are 100/80/60. There are only two places I needed to use vias, for the counter warning and output signals. Im using two small vias each to improve performance (read this somewhere).

PCB
Im using Eagle Standard edition, so this is the max size board I can use without having to upgrade to enterprise which Id prefer not to do. $$$
The current plan is to use OSH Park (After Dark) for manufacturing; we dont need high volumes as this product is pretty $$$.

Questions?
1. How should I power the Teensys? USB (which is already connected) or the 5V buck converter on the PCB? I know I can cut the trace on the Teensys, but that is only the PWR not GND. right now I have the Teensys powered via USB. Looking at the Teensy schematic, there is an on-board small capacitor between USB VIn and chip VINs; I assume I would also need capacitor near the VIN pin of the Teensys. Any reason to not use USB power for Teensys?
2. Should I connect the Teensy GND pins to the PCB GND? Right now the Teensy are not connected to GND of the PCB. Would this create a ground loop? The Teensys are already are connected to the DC GND via the Teensy USB > USB hub > DC power supply > cable to PCB. I could remove the GND cable from the DC power supply to the PCB, but then ALL return current would be going through the USB GNDs. I have two USB connections for the 2 Teensys, so I have no way around at least a small ground loop there.
3. Should I step up to a 4 layer PCB? Right now everything fits well on a two layer, but the bottom GND is pretty cut up by the long 3.3V and 5V power traces. I could "stitch" over them with vias to the top, but Ive heard this causes issues. This is sort of related to question #2.
4. Does the I2C setup look accurate?
5. Are the trim pots for the optical switches wired correctly? Specifically with the 3rd pin connected to the wiper.
6. Is the capacitor design correct?
7. Is the layout of the traces and capacitors correct? Right now I have the + capacitor pad half sticking intro the traces.
8. Is there anything else I should be doing to remove interference? Im already using small caps and shielded wires on motor cables.
9. Any general feedback on the PCB design?
10. Should I connect a momentary switch to the PROGRAM pins on the Teensys so I can more easily reset the Teensys? How often is this needed to be used in practice? All of this will be mounted under the table in a clear acrylic enclosure which isnt easy to access. How would I go about connecting one switch to both Teensys? I think the PROGRAS pin needs to be connected to GND.
11. Any guidance on manufacturing?



PCB Layout
View attachment EncodingTable_Board.pdf


Table with Labels
table.jpg

PCB Top
EncodingTable_Top.jpg

PCB Bottom
EncodingTable_Bottom.jpg
 
Status
Not open for further replies.
Back
Top