New RPI2040 board

Taylor from Twisted Fields has just released an open hardware RPI2040 board made in Kicad.

taylor-board
taylor-board1

Github
Altium
BOM

Would this board be suitable for SimpleFOC? Would the RPI2040 be capable of running both channels?

1 Like

Yes, a RP2040 should be able to run both channels with FOC control.

It’s hard to tell from the pics and the schematic PDF looks incomplete, but it looks like SPI might be routed out… you’d need a way to connect two sensors to do closed loop control.

1 Like

I think the intention is to support a range of encoders, including SPI

Comms inputs are TTL serial, I2C, and SPI, and it supports Hall Sensors, Quadrature Encoders, SPI Encoders, plus 1 analog input. via Twitter

A little more about this board: Custom RP2040 Motor Driver Paves Way for Raspberry Pi Robotics | Tom's Hardware

@Valentine If you have the time, I’d be particularly interested in your review of this board.

I’m on vacation until end of July. I can post short fun stuff but no real work.

1 Like

No problem, sorry to bother you on vacation!

Looks like these boards will be cheap: https://twitter.com/TLAlexander/status/1537179124761915393

Whether they’ll be good remains to be seen.

Hi Sam

Really love his farmbot, do you think this driver is meant for that?

It really is hard to rate any such driver without knowing the exact mosfet used. It is easy to claim 45 amp. Is that per motor? Like @Valentine experienced with the STM board, cooling is a somewhat fine art. It all depends on resistance, design considerations, connectors, passive/active cooling, PCB copper thickness. Is the 60v rating the absolute max of the FETs or is it the max allowed board voltage with some headroom for voltage spikes?

ENOB -Effective Number Of Bits, often dictate the price point and well analog to digital resolution (sensitivity), analog being the real world effect on eg. a shunt resistor. Having 16 bit degital perception on what’s going on is a major plus, especially if the board is set up to monitor 45 amp per motor, but you may just use 10amp. This is why those 16bit ADC MCUs are completely sold out, with the exemption of the Portenta.

Looking forward to follow the process on this MCU, definitely it has potential.

1 Like

Yes it’s meant to replace the Odrives in the farmbot.

The BOM is here: https://github.com/Twisted-Fields/rp2040-motor-controller/blob/main/RP2040_motor.csv

K, those are 60v mosfets.

It all depends on the specific needs for the farmbot. I guess he must be confident it can handle the load.

1 Like

Hello everyone! I’m the designer of this board. I finally have some time to show up and interact here.

I don’t know exactly how those FETs perform, but we only need 45A at 53V max, so hopefully there is enough headroom. And we only need 45A on one motor, where our second motor is actually a brushed motor that draws about 20A. I will want to test the limits of this board and these FETs and see how they behave. We can always stuff better FETs but I thought they would be worth a try. I just did a search and here is an example of a better FET that would fit:

As far as total current capacity, I will fab these boards with 2 ounce copper on all four layers, and test the actual current handling capacity.

Also I need some lower power boards for personal stuff, and this board fits the bill for those applications.

One important thing for me to communicate is that this board is designed to make it very easy for people in the community to fork and iterate on their own version. The entire BOM is designed with parts in stock at JLCPCB in high quantities. It uses mostly generic parts that can be replaced if stock changes. But the whole thing can be assembled by the JLCPCB assembly service in low (or high) quantities. I made a few changes last night but currently for 20 boards fabbed and assembled the total cost before shipping is $24.80 per board. It was about $2 more per board ($45 total) for shipping. Using the higher spec’d FETs linked above would add about $12 more, so they’d be $37 per board.

And I want people to get their own boards fabbed. My whole motivation is to get good dirt cheap mid power driver boards out there for robotics. I want a lot of different versions as I believe that the way open source organically changes over time can meet the needs of the community best and produce better designs. But to make that work, people need to be able to order assembled boards. Which can be done easily with this design.

All this to say, if there is something not quite right, I hope people will tell me, and if I’m not in a position to change the design (say, conflicting requirements, or too busy), then I hope others will produce and distribute/sell them. I actually want to work with aliexpress sellers to get these boards on there, etc.

I made some changes to the design yesterday to measure the motor phase current on two phase legs, instead of the whole bridge. I am also aware of the ADC issue on the RP2040. I was going to add an external ADC but this would raise the cost significantly. I think a low cost board will help get this out in people’s hands which is a good thing, and I fully expect someone will come along and throw on a nice high end ADC and produce some of those. In the end a $10 cost increase isn’t a big deal. Maybe someone will want to make a version with both the better FETs and better ADCs to make a really nice board. They could make it larger too, to better handle high currents.

Based on the RP2040 ADC issue, we can expect about 0.13A of usable current resolution with 55A full scale current sense setup (when updating current sense resistors I found 55A is a better maximum). But of course it would be easy to fab these boards with different amplifier gain resistors to set full scale at 10A or something. The RP2040 ADC with the known issues has 8.7 effective bits of resolution, or 415 steps.

I haven’t completed the layout but I do have the new schematic changes finalized I think. Please review the updated schematic and provide your feedback. It would be appreciated!

That’s all for now. I am excited to finish this and get some boards ordered!

Taylor (by the way I am nonbinary and use they/them pronouns :smiling_face_with_three_hearts:)

4 Likes

Thou art binary, must be a plus when doing digital stuff :slight_smile:

Anyways, Lots of stuff to consider. I think you are on the right track. I would throw in a busbar, but that is maybe overkill. Take a look at those square copper rods used in welding. I’m not able to dive into your design, but do hope you nail it.

1 Like

Welcome to the forum.

JLC won’t fab with 2oz copper. You need to find someone else and the price will be exorbitant. Probably minimum $30 per PCB only. When you add the SMD and sourcing, you are probably looking at $60 per board for a small batch.

As @Juan-Antonio_Soren_E pointed out, you probably need external bus bars or redesign the power section to allow for solder pour. Pushing 45A per phase will need minimum 20mm copper areas, I don’t see them being that wide. You may want to simulate the copper else if you push 50A max it will literally crack and smoke. Simulate I mean run current/voltage/heat dissipation simulation. I know you say 45A max but the motor will create over 50A peaks easily on a phase when pushed. Heat dissipation internally for the two layers is very different from the outside, so you need some kind of heat release between the tracks, too. When you go over 10A, many other things happen that constrain the board size. Liquid cooling is an option but fluorinert is diabolical.

Also at that power you will need large heat sinks, and you need external mounting holes for the heat sinks and the board mount itself. And the phase wire holes are not large enough to support such high current. They need to match the input wire holes.

As far as RPi MCU, I’ve never used it so I cannot comment. I should probably try it out, but time is short.

It’s is definitely an interesting design, thank you for sharing. It’s always nice to see people doing hardware.

Cheers,
Valentine

Yes they will. My quoted price included 2 ounce copper on all four layers. At 20 pieces they are $7 per board. Things are getting cheaper these days it seems! Please see here:
https://jlcpcb.com/capabilities/Capabilities

“Finished Outer Layer Copper: 1 oz/2 oz (35um/70um) Finished copper weight of outer layer is 1oz or 2oz.”

“Finished Inner Layer Copper: Finished copper weight of inner layer is 0.5oz by default. 2 oz inner copper weight is available for 4-layer PCBs with 1.6mm thickness/JLC2313 stackup/2oz outer copper weight.”

Okay good to know. I’ve stretched the motor power carrying plane to be 13mm wide, which helps a bit. It sounds like realistically I have made a lower power board, and if we want higher power it should be made larger. I love my compact little credit card sized design, and I think it may work for my intended application. We can prove basic functionality with the current design and if that all goes well it would probably be worth it to make a larger version to handle more current than this design.

The phase lead holes are sized for 14 gauge wire, power inputs are sized for 12 gauge. So yeah, maybe a bit small. Really I will be happy if I can drive one motor at 45A with this, and if I need to make it bigger I am happy to do it. I will make sure that motor is the one right next to the power input. My second motor is for steering and while it should support 20A max, normally it will be less than 5 amps and a low duty cycle. Any other ideas about current handling capability are just speculation. Anyway I appreciate the suggestions to be mindful of this!

EDIT: Looking at my layout, I can add a second motor power bus on the bottom layer, giving me effectively a 26mm wide power bus at 2 ounce copper. Seems worth moving a few traces to do that! Probably my ground plane is the weaker of the two.

1 Like

I just tried to order and it didn’t allow me to select 2oz inner layers with SMD. I’m familiar with the JLC’s capabilities, I’ve been using them for years. Anyways, if you manage to trick them into accepting 2oz inner SMD order, please post here how you did it. I’ll be very interested to know.

You will need 6 AWG (4mm solid wire, 5mm multi-stranded) for 45A. Those holes must be a lot larger. Also at that current, solid copper screw mounts are required, not solder.

True, for a proof of concept as long as you don’t try to push over 5A, you will be fine. Please use appropriate protection and work safely.

Cheers,
Valentine

1 Like

For JLCPCB, 4 layer with 2 oz inner copper, the UI was a bit confusing. You have to select “Impedance: Yes” and then select JLC2313. Then the 2oz inner copper will become available.

You will need 6 AWG (4mm solid wire, 5mm multi-stranded) for 45A.

Well I’ve been using 12 gauge chassis wiring on our robot and at various times I’ve pulled over 100A through it. Seems fine so far.

Looking at this chart, it suggests 11 gauge wire will do 45A for chassis wiring.

There is another column for power transmission, which is more in line with your suggestion, but the text above the chart says "The Maximum Amps for Power Transmission uses the 700 circular mils per amp rule, which is very very conservative. " Based on my recollection, most brushless motor leads do not follow this conservative wire specification.

I will put it through its paces and try not to stick my eyeballs above the FETs when powering it on. :rofl:
I want to look at buying a used digital load from ebay so I can more easily test these things. I don’t mind melting a few boards to see what they can do.

I made the changes to my board to fit a second power plane on the bottom of the board. Thanks for the suggestion! I suspect my ground return plane is the weakest point now. I will see if I can beef it up a bit.

EDIT: I went through and eliminated many of the vias that were punching through the ground plane on the high power side, so it is in much better shape now too.

1 Like

I see, you are using the 2313 stackup. But then you need to do impedance control and very carefully split your tracks into signal and power and set the DRC to whatever JLC needs for that thickness. Make sure the RPi MCU footprint supports the track width and spacing of the 2313 2oz copper. As I said I’ve never done anything with the 2040 chip. According to the 2040 specs, the tracks are under the 2oz minimum width, so you may want to consider opening a 1oz mezzanine for the entire MCU signal portion. Looking at your PCB, you also pull tracks equal to the chip pitch. Mixing signal and power is always very tricky.

Thank you for your contribution. Please post your results and pics/videos of the end product here, we are very curious to see the board fabbed and working.

Cheers,
Valentine

1 Like

I have set my DRC to the necessary settings for that stackup, which is 0.2mm traces and 0.2mm spacing (among other things). It worked out fine after making some adjustments to the RP2040 layout.

I am not worried about impedance control for most of what is happening. I did just go back and fix the USB lines so they are proper differential pairs, but other than that I think things will be fine. I don’t think I’m doing anything in the MHZ range aside from USB, which has always been forgiving for me. I mean to be honest I am not very familiar with doing impedance control but I’ve been successful with my boards without it. I know it becomes important at higher speeds. My last board has 15MHZ SPI going through a header connection that works great, so I must be doing something right.

Given the price breaks I will order 10 boards (only a bit more than ordering 5) and after I have confirmed basic functionality I will send out boards to anyone that wants to help with firmware bring up.

1 Like

I would totally love to use these in the openERV, www.openerv.org, but it’s more expensive and higher current capacity than I have a use for. I only need like 2 amps, 12 volt, max, and that’s leaving plenty of headroom. I haven’t looked that closely, but I hope you will make sure the pins of the RPI2040 are available for general use, because that way the variety of possible and practical uses can increase substantially, as you can use the chip for other stuff at the same time. If the software is compatible with that, which I know perhaps it can’t be. There are two cores, and the pio things, although it bothers me a lot that they only gave us 32 instructions to work with for the pio programs, memory is cheap these days, after all…

1 Like

@Anthony_Douglas

For 12v 2A max you will be fully covered by the Mosquito. Not to highjack this thread, you may head over to the Mosquito threads, it’s about $10 per board. Fully tested.

1 Like