Thoughts on designing a new controller

Very interesting! We are planing to use WiFi so those will need to be moved around accordingly

1 Like

@blurfl Thanks again for that link. I was absolutly going to use some pins wrong. There’s quite a lot of land mines out there, but that write-up was excellent

It looks like we should still have enough pins for what we need, although not way too many.

3 Likes

I’m looking at the TLC5947 and it appears to be controlled over a standard serial connection instead of SPI (datasheet: http://www.ti.com/lit/ds/symlink/tlc5947.pdf)

That’s not necessarily an issue, but for the sake of keeping things simple it might be nice to use SPI for everything. Does anyone know of an SPI controlled LED driver which looks promising?

I am also having a little bit of a concern about the idea of using a separate chip which generates the PWM signals continuously. If we were to loose communication to the with the micro-controller we could end up in a position where we continue driving the motors in some random direction while the processor reboots. We could get away with driving the motors directly…we have enough GPIO pins…but with only one pin to spare which is cutting things pretty close.

What does everyone think?

So after looking at the data sheet again I think my concerns are misplaced. The interface IS SPI, but the chip has no chip select pin which means that it will have to be connected to a different SPI line than the encoders, but since it frees up so many pins that isn’t really an issue.

I think safety in the event of an unexpected reboot also does not work in the way I was thinking. It appears there is a built in safety feature. From the TLC59711 datasheet:

Which in the DRV8873 datasheet we can see corresponds to the motors powering down:

I’m leaning towards the TLC59711 which is the little version of the TLC4947 (basically fewer outputs is the difference). Conveniently Adafruit sells a break out board which is nice for testing and they have an Arduino library which should make things smooth.

but you can daisy-chain them together to drive multiple of them from a single
SPI line.

David Lang

1 Like

True, but I believe they use a pass through system instead of a chip select so the serial line runs into one chip and then out into the next chip up to 64 in a row. Unfortunately this system doesn’t work with chips from other manufacturers in the chain. It really shouldn’t be a problem to have two separate SPI lines. The ESP32 has three so we have plenty of room there.

I put together a new controller board PCB which drives five motors with current feedback and an ESP32 as the driver. Check it out here:

https://easyeda.com/editor#id=|b0f142c571f64e3fb4d01ad7853b6744|bebd02b1dde34a9093b4e1d87d0ebcbf

Hopefully I will be able to test one in person reasonably soon. Let me know if you see any glaring mistakes :stuck_out_tongue:

2 Likes

Please forgive me if I’m way off here, but you said ‘drives five motors’ as in, the plan is a motor on all 4 corners plus z-axis? Or am I misunderstanding the entire concept?

1 Like

that’s an idea he is pursuing, but it will also drive the classic 3 motor
maslow.

@bar does it have the ability to drive a stepper for the Z axis?

David Lang

2 Likes

I think that would be amazing, and I’m definitely interested in watching this develop!

1 Like

It does not have the ability to drive a stepper motor. The driver chips I am using are specifically made for driving a DC motor so they don’t have the ability to control a stepper. Basically it would end up being a different architecture if we wanted to do that. I would really like to be able to do bit length probing without a contact plate by monitoring the motor current on the z-axis which these chips can do. When the bit comes into contact with the wood (with the router turned off) the current draw will go up, so hopefully we can automate the zero z-axis step. If that doesn’t work the way I imagining we can switch to a setup which can drive a stepper motor. This is just a prototype and we can make changes later as we need

3 Likes

the ones that can do sensorless homing talk via SPI or serial, but to drive the
others, they just need an enable, step, and direction signal available

I would be a bit worried about sensorless homing, will the orange button stand
up to the stress of trying to stall the stepper?

David Lang

1 Like

How sensitive is the current measurement? Not to be a Negative Nancy, but one area of concern would be homing on engraving bits… how far into the wood would the bit penetrate before the controller detected an increase in current… or any bit for that matter?

1 Like

Exciting development! Here are some thoughts:

  • Do the nSleep pins need an external pull-up to overcome the internal pull down? (Datasheet section 7.2, figure 8, page 11)
  • The linear voltage regulator for the 5v supply will get very hot, maybe use something non-linear? At least move it out from under the ESP to where it can have a nice, very big heat sink.
  • Maybe keep the area beneath the ESP antenna clear of circuitry?
  • Do the DRV8873 need more room for heat sinks? Can the electrolytic caps move a little farther away to make room?
  • Will DC1 handle 5 motors worth of current?
1 Like

Thanks @blurfl for the review, I am VERY much obliged.

Yes, absolutely. Great catch. Can you think of any way to pull those high without running 5volts to each chip? The way they are hooked up they don’t need a 5v supply line which keeps the routing cleaner.

Do you think heat dissipation will be a significant issue even at low current draw? My thinking was that since it is only powering the ESP32 we wouldn’t need to worry about it getting too hot. It’s not that much more expensive to go for a nicer voltage regulator, but it does add cost.

The plan for cooling the DRV8873s is to push the heat through the vias to the other side of the board which is mounted to a big bent metal cover like this:

image

(Hence the focus on ONLY surface mount parts because the board needs to mount flush on the back side with the board) .

I feel like clearing board space under the ESP32 for signals is probably not worth it since it will be attached to a piece of metal. I am hoping that we can get enough signal out the sides and through the sled (which will be HDPE) for it to not be an issue, but FM is magic so we’ll have to test to see.

The datasheet seems to indicate that cooling from the back side of the board is allowed if not preferred (they do it in the DRV test board).

A different (earlier?) version of the datasheet I was working off of showed a bottom ground plane instead of a top ground plane and they just had vias running through to the bottom.

Here’s the current data sheet’s recommendation:

Again, I’m hoping that we don’t need to push these very hard (they are specked for 6.5A each and I’m thinking of a 10A power supply overall so we can’t really push them too hard).

Great point. The part spec’d now is mostly a place holder for a final choice which will match whatever power supply turns out to be the final one. Its a good point that we need to make sure it’s not the weak link in the system.

One could do a resistor voltage divider off the VM motor power, the logic level needs to be between 2.7v and 5.3v, but that’s not good practice. There’s a lovely 5v pad at the motor connector near each DRV8873… Too, I suspect the ‘Mode’ pin should be pulled up as well (section 7.3.3.1) to assure the PWM mode gets chosen at power-up.

The massive under-board heat sink looks like it will take care of the heat generated by the DRV8873s. :+1:t2:

The ESP is pretty thirsty when it’s transmitting, and each motor has a position sensor that wants some 5v as well. The regulator’s position will reduce air flow and it will also be affected by the big metal heat sink under the board. This might be something to watch on the prototype, but fixing it proactively could eliminate a group of headaches in the future.

1 Like

Reading further, it looks like the Mode pin can be defaulted without the 5v…

7.3.1 Bridge Control …During the device power-up sequence, the DVDD pin is enabled first, and then the MODE pin latches. Tying the MODE pin directly to ground sets the mode to phase and enable. Tying the MODE pin to the DVDD pin, or an external 5 V rail, sets the mode to PWM.

Maybe the same thing would work for ‘nSleep’ with a pull-up resistor against its internal 100k pull-down?

1 Like

And… reading further further, the SPI version of the DRV8873 doesn’t have a ‘Mode’ pin :expressionless:

1 Like

I was planning to use the non-SPI version of the so that is a compelling reason to use the SPI version. Do the other defaults like current limiting at 6.5A come up the same on the SPI version of the chip? Basically if we don’t connect to the SPI inputs will it work OK? Thank you so much for the second look at all of this.