Author Topic: FSAE CAN Bus Implementation  (Read 9379 times)

0 Members and 1 Guest are viewing this topic.

Offline CalebMcNevinTopic starter

  • Newbie
  • Posts: 3
  • Country: ca
FSAE CAN Bus Implementation
« on: November 08, 2013, 05:07:17 pm »
Hey guys,

So, I'm designing the data-acquisition system for my university's FSAE team (we build a small formula style car mostly from scratch). I'm planning on implementing something called the CAN bus. My question is this: How do I actually implement a bus system with wire? Do I make a single terminal with multiple 3-way connections, or do I use multiple 3-way splice terminals along a main bus wires? I thought about just cutting the bus and twisting the wires together at any junctions, but then you get a big node sticking out of your wire and I'm pretty sure that's not good for data transmission. BTW, the CAN bus transmits at a maximum speed of 1Mbit/s, and the voltage level is usually 3.3V or 5V. I'm using an AT90CAN128 micro from Atmel but I couldn't find the CAN bus voltage level in the datasheet. Maybe it's just Vcc? (I hear that you usually use an opto-isolator anyway, so it probably doesn't matter). Any ideas on how I can practically do this? It always looks so simple on the schematic . . . :p

Thanks,

Caleb
 

Offline tszaboo

  • Super Contributor
  • ***
  • Posts: 8503
  • Country: nl
  • Current job: ATEX product design
Re: FSAE CAN Bus Implementation
« Reply #1 on: November 08, 2013, 06:05:40 pm »
You should not make "big" Y connections on CAN. It should be as reasonably small. One of the de facto connectors is DSUB-9. I'm sure, that you cannot connect any microcontroller directly to CAN. It has a separate physical layer chip, sometimes SO8 package. If you look carefully, you will see, that the MCU pins are named CAN_TX and CAN_RX (or similar) while the bus is CAN_H and CAN_L. Designing with CAN is simple, and you only need 3 wires. Softwer implementation is somewhat more complicated than serial port. The real problem is usually the architecture of the communication.

Read this: http://www.ti.com/general/docs/lit/getliterature.tsp?baseLiteratureNumber=slla270
And CAN debugging 101: Check termination resistors, check termination resistors, check termination resistors...
 

Offline xolott

  • Contributor
  • Posts: 10
  • Country: ve
Re: FSAE CAN Bus Implementation
« Reply #2 on: November 08, 2013, 06:58:31 pm »
I'm sure, that you cannot connect any microcontroller directly to CAN. It has a separate physical layer chip, sometimes SO8 package. If you look carefully, you will see, that the MCU pins are named CAN_TX and CAN_RX (or similar) while the bus is CAN_H and CAN_L.

That's true!

I did a implementation in my university of a custom bus protocol between 10 MCU. In some nodes group I used a PCB with just conectors to make the distribution in the next branch. This is much better that make wire splice, which look awful and is impractical.
 

Offline Baliszoft

  • Frequent Contributor
  • **
  • Posts: 277
  • Country: hu
Re: FSAE CAN Bus Implementation
« Reply #3 on: November 08, 2013, 10:24:04 pm »
As mentioned previously: use a dedicated CAN transceiver before/after each MCU (f.eg MCP2551), optionally a CAN choke before each transceiver (+extra ESD protection if needed). Then, use a pair of twised wire with both ends of this "chain" terminated and just simply attach your devices (to any point in between terminations). If there will be only two devices interconnected you may put the termination in these devices. This short appnote basically tells you everything you need to know about the can physical layer: http://ww1.microchip.com/downloads/en/appnotes/00228a.pdf
« Last Edit: November 08, 2013, 10:26:01 pm by Baliszoft »
 

Offline Baliszoft

  • Frequent Contributor
  • **
  • Posts: 277
  • Country: hu
Re: FSAE CAN Bus Implementation
« Reply #4 on: November 08, 2013, 10:34:13 pm »
you only need 3 wires.

2 wires only. In a car, these wires are also twisted together. Some transceivers can even work with a single wire only (with the other one open or short to ground/battery).
 

Offline kaz911

  • Super Contributor
  • ***
  • Posts: 1052
  • Country: gb
Re: FSAE CAN Bus Implementation
« Reply #5 on: November 09, 2013, 02:42:38 am »
I use the TI ISO1050 opto isolated can transceiver - One side isolated CAN signals - the other side RX/TX that interfaces directly with MCU's with RX/TX on 3.3-5V - dependent on what VCC1 you feed it.

You would normally use a twisted pair cable for the CAN signals to keep external noise impact equal on both channels. 

TI will send you a free sample kit of the ISO 1050. http://www.ti.com/product/iso1050. There is also a banana plug demo board available.

And since I'm using it for marine CAN (NMEA2000) I have an opto isolated power regulator in there as well - taking 12v from the NMEA 2000 and converting it to 5v isolated to the MCU side.
 

Offline tszaboo

  • Super Contributor
  • ***
  • Posts: 8503
  • Country: nl
  • Current job: ATEX product design
Re: FSAE CAN Bus Implementation
« Reply #6 on: November 09, 2013, 09:11:49 am »
I use the TI ISO1050 opto isolated can transceiver

FYI TI is using capacitive isolation in their stuff.

you only need 3 wires.

2 wires only. In a car, these wires are also twisted together. Some transceivers can even work with a single wire only (with the other one open or short to ground/battery).
The grounds needs to be connected together somehow. In a car sure, you can ground them with the chassis. And if something CAN work that way, it doesn't mean it should be used that way. Even the lack of termination resistors could mean your system doesn't go through EMI/RFI regulations.
 

Offline Baliszoft

  • Frequent Contributor
  • **
  • Posts: 277
  • Country: hu
Re: FSAE CAN Bus Implementation
« Reply #7 on: November 09, 2013, 10:09:31 am »
Quote
The grounds needs to be connected together somehow. In a car sure, you can ground them with the chassis. And if something CAN work that way, it doesn't mean it should be used that way. Even the lack of termination resistors could mean your system doesn't go through EMI/RFI regulations.

Well, erm, yes. You are right.

BUT,
1.: We are talking about a car in this case.
2.: As far as i know CAN has been developed by Bosch especially for automotive use. Why would you want to use it for something else if that needs an additional wire? (BTW: how about the fourth +ve then)
3.: Floating grounds are allowed (to some extent), just read the app note i linked above.
4.: Who said that termination may be omitted?
5.: Who cares about EMI/RFI regulations in a one piece school project? ;)
 

Offline kaz911

  • Super Contributor
  • ***
  • Posts: 1052
  • Country: gb
Re: FSAE CAN Bus Implementation
« Reply #8 on: November 09, 2013, 05:21:29 pm »
I use the TI ISO1050 opto isolated can transceiver

FYI TI is using capacitive isolation in their stuff.

you only need 3 wires.

2 wires only. In a car, these wires are also twisted together. Some transceivers can even work with a single wire only (with the other one open or short to ground/battery).
The grounds needs to be connected together somehow. In a car sure, you can ground them with the chassis. And if something CAN work that way, it doesn't mean it should be used that way. Even the lack of termination resistors could mean your system doesn't go through EMI/RFI regulations.

old habits die hard :) Yes I know it is capacitance isolation - sorry for the "opto" reference - but its is more than adequate for NMEA 2000 :) - and I like it much more than some of the other CAN transceivers.
 

Offline JonnyBoats

  • Regular Contributor
  • *
  • Posts: 141
  • Country: us
    • BitsConnect
Re: FSAE CAN Bus Implementation
« Reply #9 on: November 09, 2013, 05:59:27 pm »


And since I'm using it for marine CAN (NMEA2000) I have an opto isolated power regulator in there as well - taking 12v from the NMEA 2000 and converting it to 5v isolated to the MCU side.

Slightly off topic, but can you tell me if you are using the NMEA approved connectors and if so where do you source them?
 

Offline matkar

  • Regular Contributor
  • *
  • Posts: 153
  • Country: si
  • Sixty percent of the time it works EVERY time.
Re: FSAE CAN Bus Implementation
« Reply #10 on: November 09, 2013, 09:51:51 pm »
Look at https://www.phoenixcontact.com/assets/downloads_ed/global/web_dwl_technical_info/CANopen.pdf for different CAN connection solutions. I've seen most of them being used by many different producers/installers. I've used many of them in my designs as well. Whatever connection you choose respect CAN physical recommendations (trunk length, drop down length, termination, twisted pair...) and you'll be fine. The cheapest and quickest way is to use UTP cables. You can use the remaining twisted pairs to transfer power to the nodes.
I'm also interested in cheap source of NMEA 2000 (M12 aka Micro-C) connectors, terminators and Tee-s.
 

Offline LukeW

  • Frequent Contributor
  • **
  • Posts: 686
Re: FSAE CAN Bus Implementation
« Reply #11 on: November 13, 2013, 10:37:45 am »
CAN transceivers expect to see the balanced pair to have a characteristic impedance of 120 ohms, don't they?

Good old ubiquitous UTP Cat. 5 has a characteristic impedance of 100 ohms. Close enough or good enough for fast CAN?
I don't know, I've never tried it. But it would be a good choice if it works since it will cost nothing compared to proper 120 ohm cable marketed for CAN/RS485 etc. automation buses.

Regarding the grounding question... given that CAN is a balanced pair, if a proper transceiver chip is used it will tolerate a common-mode offset between the grounds of different nodes, within a certain limit, check the datasheet for that limit. So the integrity of low-resistance chassis ground between the network of different nodes isn't critical.
 

Offline kaz911

  • Super Contributor
  • ***
  • Posts: 1052
  • Country: gb
Re: FSAE CAN Bus Implementation
« Reply #12 on: November 13, 2013, 10:41:57 am »


And since I'm using it for marine CAN (NMEA2000) I have an opto isolated power regulator in there as well - taking 12v from the NMEA 2000 and converting it to 5v isolated to the MCU side.

Slightly off topic, but can you tell me if you are using the NMEA approved connectors and if so where do you source them?

They are not hard to source - they are just expensive. Molex makes them. They are also used on other devices like my SnakeEye "bore-scope" camera. I don't remember the part numbers on top of my head - but Maretron sells connectors at more or less the same price as molex (same connector)
 

Offline ju1ce

  • Regular Contributor
  • *
  • Posts: 96
  • Country: fi
Re: FSAE CAN Bus Implementation
« Reply #13 on: November 13, 2013, 11:09:40 am »
I'm sure, that you cannot connect any microcontroller directly to CAN.
How about LPC11C22?
 

Offline kaz911

  • Super Contributor
  • ***
  • Posts: 1052
  • Country: gb
Re: FSAE CAN Bus Implementation
« Reply #14 on: November 13, 2013, 11:21:43 am »
I'm sure, that you cannot connect any microcontroller directly to CAN.
How about LPC11C22?

yes that has can transceiver built in. Give-Away - is CAN RX/TX pins = Need transceiver -/ CANH/CANL = Has built in transceiver. But that is not so relevant for applications where you need isolation like marine or automotive.
 

Offline jerry507

  • Regular Contributor
  • *
  • Posts: 247
Re: FSAE CAN Bus Implementation
« Reply #15 on: November 14, 2013, 03:27:28 am »
Neat, never seen a micro with a can transceiver integrated.

Cat5 will work fine for CAN. Given that the overwhelming majority of RS485 use trash cable and a lot of off highway stuff doesn't use any particularly special cable at all, you'll see absolutely no problems.

Just don't forget that ground... Yea it may tolerate it but the best practice is having it. Every standard that uses CAN specifies a ground pin. It's not just for common mode, it helps with ground bounce and other integrity issues at higher baud rates. It's one extra wire, so the benefits don't exactly need to be large.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf