the new year resolutions start early and I am currently planning the new garden system of my parents. I already have the requirements and a concept of the different modules (watering, light concept, some sensors, pool, temperatures, waterlevels, ...). Some of the modules need some logic and will get either an Nano or Micro.
For the communication I have chosen the CAN-Bus, since I have experience in implementing CAN protocols, but apparently no understanding of the correct hardware setup. I will need a star topology and below is a rough schematic
Path II: Some Slaves S3\S4\S5 and S6\S7 are physical behind each other (there is only one empty tube for the cables).
Path III: S11 is in a small chamber where two empty tubes need to connect to S12 and S13
I plan to connect the slaves using a D-Sub(9) connector and for S3, S4, S6 a second D-Sub which just distributes the bus line to the next slave.
Comparing Path II: Are the schematics equal logically?
The busline is only distributed on the node
If the S3 is removed the connection still would be a direct line to the master
Comparing Path III: S11 acts as a node for two new lines. Individually each line connects directly to the master and includes the same problem from "Path II". Here S12 and S13 are not directly connected via a direct lone over the master. This configuration is not possible?
Can I use Star topology at least with Path II?
Is Path III just an extended Version of Path II and also applicable?
Having several ends look strange. Usually one long bus cable is used and terminated in the end. Your plan gives several ends. How to terminate several ends in a proper way, if there is any?
From the entry entry it should be possible at lower speeds.
ISO 11898-3, also called low-speed or fault-tolerant CAN (up to 125 kbit/s), uses a linear bus, star bus or multiple star buses connected by a linear bus and is terminated at each node by a fraction of the overall termination resistance. The overall termination resistance should be close to, but not less than, 100 Ω.
Low-speed CAN signaling. ISO 11898-3
Low-speed fault-tolerant CAN signaling operates similarly to high-speed CAN, but with larger voltage swings. The dominant state is transmitted by driving CANH towards the device power supply voltage (5 V or 3.3 V), and CANL towards 0 V when transmitting a dominant (0), while the termination resistors pull the bus to a recessive state with CANH at 0 V and CANL at 5 V. This allows a simpler receiver which just considers the sign of CANH−CANL. Both wires must be able to handle −27 to +40 V without damage.
It looks like every end of the star is terminated and at least Path II should be possible. Looking at my simplified schematic (bottom half of my original image) Path III S12 can communicate with S13 via the line to and from the master OR directly via S11 since S12 and S13 need to be terminated.
I agree that especially Path III looks very odd, but I can not find a good reason not to do it. I also have a small CAN-network running on my desk (just simple send\receive telegrams @ 125kbit\s; ~25cm between devices). It consists of a Master, S1, S3-S4, S11-S12|S13. The network is now terminated at all endpoints. At first glance there were no false or not received telegrams.
The devices I helped built (only hardware review) are quite small in distance. The requirements are given either from an architect or the requirement engineer. I manly design the end parts of the device that needs communicating (measurement system, sensors, more physics stuff). The interface and the protocol is given and therefore I only need to program the telegrams. Since the hardware engineer seem to know what they are doing, I trust them with design choices and never questioned it.
Poor choice since it is not intended for the topology that you want. Since it's a garden thing and you are probably not going to need high speed communication, i would go for using DALI, rather slow, but does not require twisted pair or termination, can work in any topology and the cables can be chucked in with the mains if need be. DALI is what is used in big buildings to centrally control lighting, but it is a 2-way protocol and can be implemented on pretty much any MCU (no UART required at 1200bps ) and is self-clocking. Cable length can easily be up to 100 meters.
The whole point of using RS-485 is that by using twisted pair cable you counteract the capacitance of the cable by creating a magnetic effect in the cable. But with the terminator, the cable will start to act as an antenna.
Still if you terminate each end of the Star with a slightly bigger resistor you will probably get it working properly. Just make sure that the total resistance of the terminators does not drop (much) below 60 Ohm ( 2 x120 in parallel) or you may damage the transceivers.
It is possible to do what you want. The box in the center is called a HUB and allows several systems to be connected in a star configuration. I have not seen any above 8 ports but I was not looking that hard.
The master sends telegrams in varying intervals to the 5 devices. The longest arm of the line (Device2 <-> Device3) is ~10m. The telegram from the Master will get a response from the slave with the correct address (mask and filters are also implemented -> separate question). Each slave sends a telegram to the master without a query from the master.
Network specs:
6 x Arduino Nano with MCP2515-CAN shield
CAN-Bus sniffer with cangaroo CAN-analyzer
unshielded\ untwisted copper cables
Tested speeds 125, 250, 500, 1000kbit\s
MCP2515 library from coryjfowler
For now I analyzed the telegrams manually using the delta times and not one telegram was misinterpreted or lost. My next step will be to add a counter in the datapackage of the telegram for easier parsing.
I found quite a discussion only regarding the star-topology. Most people advise against it, but at lower speeds it should be possible (see post #4).
One of the remaining problems is the correct calculation and position of the terminating resistor. Currently the master (center) and the farthest device has a terminating resistor, since more resistors in parallel would drop the resistance across the line. This needs to be adjusted if other devices are located far away also.
Hi,
Good to see some serious experimentation in the real world.
How are the connections made at the circled junctions.
Do you have units with straight through CanBus?
So really low speeds, and no twisted pairs, why do you bother with can-bus at all when you don't make use of the benefits ? I would lose the terminator at the the sniffer for one on device 3, and increase the size to 180R, then use twisted pair, and i think you can go up to 250000bps without much issue.
This is just the prototype setup in my workshop. My thinking: when it is working with bad wiring, bad/ no shielding then it will work in the real application. There, new cables will be put in. My limitations are the small empty pipes in the ground.
I overlooked the termination at the sniffer. Did you mean adding a terminator at D3 and removing the terminator on D5 OR just on D3?
@TomGeorge I use this shields. The schematic shows, that the chip and the two connectors are put straight through. Even if a device in the middle is not running (e.g. D2) the other devices receive messages.
How can I calculate the impedance of such a complex setup?
You have a mixture of topologies, so low speed is helping you here.
Having Y or T joints in your network moves it away from star topology.
Interesting how it all goes in the field.
Unterminated lengths like the sniffer and Device 3 may cause reflections.
CanBus can be forgiving up to a point.
It looks to me like a line bus starting at the Sniffer and ending at device 5.
All others have stub length's between 0-7.5m .
Max recommended stub length is generally ~1m.
Your redrawing is correct. I have to mark the throughlines better for clear visibility.
My application will probably only have Y-Joints. Device_5 is just there for testing how worse the network must get in order to get consistent failures.
How can I calculate the impedance across the line in a star network? Does the signal only consider Start-to-End point => 60\Ohm between stubs
OR
The whole network: Master is parallel to the parallel network of D3 and D5 => 40\Ohm