3

I have tried to make this question acceptable for StackExchange, I am not looking for buying advice, just either examples of hardware that could have been used or the name of types of devices I should be researching.

I am very interested in automation and robotics but so far everything has been over my head in regards to my basic electronics knowledge.

I see in many places online like in this video on YouTube Link that often in the cases where vision is used the processing is done on a PC and that controls the hardware.

What is the name of the hardware that interfaces between the motor drivers and limit switches etc and the PC? I'm assuming for speed the interface would be USB or ethernet.

What are some examples of hardware that could have been used or what is the collective name of such hardware?

What is the name of the topic/category of technology I should be researching?

B.Baker
  • 75
  • 3
  • 11
  • Many inexpensive and simple to use microcontrollers have USB interfaces and can be easily setup to provide a serial port device. From there you can program the MCU to take commands and do things. Even something as simple and cheap as a "blue pill" STM32 controller board will do what you are asking about. – jwh20 Jan 12 '21 at 14:16
  • If you are just looking at trying it out a raspberry pi 4 and an Intel Neural Compute unit (https://store.intelrealsense.com/buy-intel-neural-compute-stick-2.html) can be an easy, cheap, and size efficient way to add computer vision to a project. – Parker Jan 12 '21 at 14:17
  • 2
    Realize that PCs are poor at real-time control. So for many applications, the PC would interface to a microcontroller which would control the motor. – Mattman944 Jan 12 '21 at 14:31
  • It will be USB, UART, CAN or Ethernet. These are all quite different serial buses, which one that is used depends on the application. – Lundin Jan 12 '21 at 15:30
  • For high-performance motion control, the actual control may be done in a DSP or FPGA and the interface operates at a higher level just sending instructions with loose timing demands on the PC side. PCs are fast but they don't necessarily have low latency, depending on various factors such as O/S. – Spehro Pefhany Jan 12 '21 at 17:02
  • I see a real terminology issue here: You are asking about "interface to the PC" but at the same time "assuming USB or Ethernet". From the **PC** side, if you are using USB or Ethernet, that interface is likely built-in to the motherboard of the PC. So I think the real question is: "How do I interface motors/switches/camera/etc. **to USB or Etherenet**?" – manassehkatz-Moving 2 Codidact Jan 12 '21 at 22:53

2 Answers2

5

A USB-UART bridge (the most common brand name one is made by FTDI) is probably the easiest way.

On your custom hardware you use the regular UART port on the microcontroller and feeds it into the USB-UART bridge cable or chip which in turn plugs into your computer with a USB plug. On your PC you install USB drivers that make the computer think it is talking to a UART and write software on your computer as if it were a UART.

Before USB ports existed what you would have done is run the microcontroller UART through an RS-232 transceiver which converts the UART voltages to voltage levels appropriate for RS-232 signals and plug that into the computer with a dsub9 cable. The USB-UART bridge simulates the same thing, but with USB.

This is fast enough to do things like control but probably not fast enough to do things with streaming data (like machine vision).

RS-422 is extremely similar to RS-232. It is basically just UART but run through transceivers with different electrical signalling for longer distances. Can be used to have one transmitter drop the same message to multiple receivers that only listen and do not transmit back.

RS-485 is fairly similar because it is basically RS-422, but instead of being full-duplex it is half-duplex. That means no simultaneous two-way transmission which means you have to change up your protocol to account for this (the devices on both ends of the line can't just start transmitting whenever they want), however it is more suited for having more than 2 devices on the same line where all devices can transmit.

CAN is somewhat similar to RS-485 in that it is half-duplex but the signalling is quite different and it has a predefined message format. Namely, the pre-defined message format and different electrical signalling compared to RS-485 provide a standard addressing, error checking, and collision detection scheme (higher priority messages are able to transmit over top of lower priority messages transparently which leaves the higher priority message uninterrupted and stops the lower priority message, rather than interrupting both messages). RS-485 is incapable of this message override and requires interruption of both messages, and since there is no predefined addressing or protocol you need to cook up your own if you want more than two devices on the line (needs addressing) or more than one device to try transmitting whenever it wants (no master-slave relationships to coordinate communication on the line).

Beyond this you have native USB, ethernet, and all the fast but complicated stuff.

DKNguyen
  • 54,733
  • 4
  • 67
  • 153
2

CANBUS is one of the most popular protocol for motor control. So, basic USB/CANBUS converters can be usefull to send commands to motor driver.

https://www.kanda.com/products/Lawicel/CANUSB.html

Image From: https://www.kanda.com/products/Lawicel/CANUSB.htm

https://canbuskits.com/what.php

Image From:https://canbuskits.com/what.php