cube updates: downloading eagle and figuring out comms [updates]
OKAY SO! We've been looking into this motor controller design. And there's some things right off the bat. If we use arduino. Then what will happen is we're going to need an interface to communicate with the arduino over serial or ethernet, and something to have the individual motor controllers communicate with each other. It is possible to have one device as the master communicator and the rest of the devices only talk over CANBUS but that's not really what we want right, that's just easy not good design. So we found these things:
https://canable.io --> lets CAN BUS talk to computers over USB.
http://henrysbench.capnfatz.com/henrys-bench/arduino-projects-tips-and-more/arduino-can-bus-module-pin-outs-and-schematics/ --> arduino CAN bus stuff so that lets the Arduinos talk over CAN Bus.
Also I want all the ports on the system to be USB-C just so in the future we can integrate the ports into two output ports either can be used for flashing the arduino or used for being a CAN BUS.
So here's the idea, you get the motor controller as-is, and it's in serial mode. You connect the controller to the computer and you can put it in "MASTER" mode which enables it to communicate with the host over USB serial, or you can put it in "SLAVE" mode meaning it only receives things from the CAN BUS.
I also downloaded the student version of Eagle and am going to learn how to do schematics in that so that we can actually start making this thing starting with the Arduino HAT.
But before we do all that - here's a curious though exercise. How do we make the USB both the CAN interface and the USB interface. We use the USB's 5V to power transistors to switch that USB from CAN H/L to USB D+/D-!
"An NPN transistor, therefore, is normally open as it does not conduct when the base is held at 0 V."
And apparently DEPLETION MOSFETS "https://www.google.com/search?client=safari&rls=en&q=depletion+mosfet&ie=UTF-8&oe=UTF-8" are MOSFET transistors that are normally closed.
So I don't know if this is exactly how this would work - but let's get some ideas down.
So normally, when the USB is connected to another CAN device, there USB does not supply 5V. All the transistors connecting the CANH/CANL lines are closed, and the rest are open. The OUT1 voltage is 0v (so the analog/digital in pin reading out1 also knows the board is not connected to USB).
***OUT1 --> the USB's 5v, connects to all of the transistor gates AND an Arduino digital read pin.
***USB GND is always connected to the ground plane.
Now when the USB is plugged in OUT1 gets pulled to 5V right? What that means is the CANH/CANL lines are disconnected from the USB (both of them). And the Data+/- lines are then connected. The other thing that gets connected is the 120ohm termination resistor so that controller can serve as a CANBUS termination node. Here's the full schematic. With two USBs.
So as you can see if we employ a total of 10 transistors we make make either of these USB ports data/serial or CAN Bus for the system. I don't know if this is a good idea I want to run it by my friend Quang or Francis or Cece because they know EE much better than I do, this is just and idea.
We'd also need to figure out how to update the CANIDs or if we can just set (hardcode) a CANID and make sure no two controllers have the same ID. Or something. Note the jumper pins for the 120ohm termination resistor are still there mostly because on the other end of the CANBUS line (how ever many controllers down) the 5V will not be powering the closing of the termination resistor, it'll have to be physically jumped.
That's really the only part I'm concerned about, do we want to take USB power to jumping that termination resistor and how much can a transistor handle. I don't know enough about transistors to answer these questions but we'll learn eventually. (like I only know about N-Channel MOSFETs and even then not much).