1

I am trying to design a compact robotic actuator. My main focus with this project is to reduce the amount of external wiring needed to do with robots. With that in mind, I have thought of the following high-level overview for my robot:

Broad Overview of System

I found that using the CAN protocol to communicate between each of the Joint controllers would make sense, since the CAN protocol can be daisy-chained. I would like to use something simpler like an I2C/SPI since I have zero experience with the CAN bus.

My first question would be: If I want to daisy-chain my actuators like this, can I still use SPI/I2C? Since SPI takes a SS pin per node, I am worried that I would not be able to do so. I would really like to use I2C, since it is a very simple protocol.

If we now come take a look at what happens inside each joint controller as follows:

Individual Joint Controller

Here I have imagined that I would have no other way but to use CAN, however I would like to use I2C if possible.

My second question to you guys would be: Is this diagram valid? Can I start designing a schematic around this block diagram?

My final question would be to know how it is done in the industry - especially the cable management. I could not figure out a way to have no wires coming out at all, yet the robots I work with all have their wiring managed internally.

JYelton
  • 32,302
  • 33
  • 134
  • 249
ssarkar
  • 13
  • 4
  • SPI is going to be problematic, vulnerable and potentially noisy. I would use RS-485 and simple UART comms. – Andy aka Dec 01 '22 at 12:34
  • You might want to consider how you ground everything down, since the motor ground and supply will likely be noisy and it's not ideal to drag that into the rest of the circuit. – Lundin Dec 01 '22 at 13:48
  • 1
    @Andyaka CAN is ideal, rugged and modern. Why would you ever use old RS-485 over CAN? I ran out of arguments for using UART well over a decade ago. PC:s do not come with a DB9 UART any longer and CAN FD provides faster baudrates than 1MHz if that's the reason. – Lundin Dec 01 '22 at 13:50
  • @Lundin read the question and ask yourself whether it's feasible to use SPI (more so than RS-485). The op is proposing to use SPI not CAN. – Andy aka Dec 01 '22 at 15:10
  • @Andyaka I did: "Here I have imagined that I would have no other way but to use CAN, however I would like to use I2C if possible." I just wondered why your answer to that would be to RS-485... – Lundin Dec 01 '22 at 15:27
  • Because, if the op wants simplicity and something that will work, RS485 is that. I'm not suggesting CAN because clearly, from the OP's question he is doubting his own ability to deal with CAN bus. @Lundin – Andy aka Dec 01 '22 at 15:50
  • CAN means two things, the physical electrical interface, and the protocol for data transmission. RS-485 means the physical interface, and the protocol is not defined. So you could use UART protocol with either RS-485 or CAN PHY. – Justme Dec 01 '22 at 18:15

1 Answers1

1

My first question would be : If I want to daisy-chain my actuators like this, can I still use SPI/I2C?

I would not recommend it, since SPI and I2C are both meant to be local to your PCB or board-to-board, not to get dragged around for longer distances and particularly not around noisy things like motors. They have poor immunity. CAN is ideal for this kind of application.

Is this diagram valid? Can I start designing a schematic around this block diagram?

There's no mentioning of a ground in your connectors. Ideally you should have both a supply ground and a signal ground. Motors are notoriously noisy and should be kept away from the rest of the application. Ideally ground them where the supply ground enters your product and keep the rest of your PCB out of their way. Either way you obviously need to have at least one ground in the connector.

Also consider details like transient handling or common mode filtering on the CAN bus. Such EMC measures are going to be important here.

Assuming LDO means linear regulator, it will be quite inefficient when going from 9V to 3.3V. If low current consumption is of value, then consider a switching buck regulator instead.

You also need to consider how to handle CAN termination in an application like this, because as you add nodes to the bus, you have to move one of the terminating resistors as well. It's not really correct to say that CAN is "daisy chained" in the manner of SPI.

When using STM32 you absolutely need to check if the part you are using is available for purchase in the real world. If not, pick a MCU from a more reliable vendor. ST is a company with major logistics problems.

My final question would be to know how it is done in the industry - especially the cable management.

It depends on what mechanics you use and what IP class you need if any. There's all manner of standardized 5 pin CAN connectors, for example M12 (rugged) or terminal blocks (cheap). Same here, be careful with which vendor you pick.

Lundin
  • 17,577
  • 1
  • 24
  • 67
  • Hi @Lundin, thanks for your answer. Yes, I forgot to draw the ground connection in my block diagram. I'll keep the info about having a signal ground and a power ground. My main idea was to have some sort of a 4-pin JST connection with 9V, CANH, CANL, and GND pass in the daisy-chain fashion, and then I would use this as a supply for my regulator. You are right, the LDO is a linear regulator. I know they are not the best, I will look around for a simple buck regulator. I kept them in because I have used (designed PCB around) LDOs previously, and I could simply salvage my old designs. – ssarkar Dec 01 '22 at 19:11
  • CAN termination is something that I have been thinking about as well, in regard to my implementation. The current idea I have is to simply have the 6 nodes and terminate the network at the 6th joint controller. I am not too happy about this idea, since I would want the gripper also to be a part of the CAN bus. But, I will try and figure that out once I have something a bit more concrete. This was also why I was considering SPI, but that would mean having a SS pin per node. Thanks for letting me know about M12 connectors, I took a look and them and I might be going forward with this. :) – ssarkar Dec 01 '22 at 19:17