Friday, June 6, 2008

CAN Bus And System Control

I like CAN (Controller Area Network) Bus for control systems. It has moderate speed (1 Mbs), it is deterministic., it has priority control for multi-master operation, and because of its use in autos it is robust and low cost. In addition it has been on the market for about 10 years so it is well established with lots of vendors to choose from. In addition there are a number of MCUs with built in CAN.

For test reactor operation I see a hierarchy of CAN buses, each devoted to a given function and then all melded into a master bus. Let me start with the sub nets.

1. Vacuum Gauge/Vacuum Pump Control Bus
2. HV Power Supply Internal Buses
3. Instrumentation Buses (Temp Monitoring, Flow Monitoring, Master Clock, Neutron Counter, Electrical Power Measurement and Control, etc.)
4. Auxiliary Control (Electrical Power Measurement and Control, etc.)

And then a master bus to send messages to/from the sub buses.

I haven't decided on an MCU yet. One of the requirements would be that it is FLASH programmable and have a built in CAN bus. I have been thinking about pressure measurement lately so I'd like to lay out what a CAN bus interface would look like.

The pressure transducers I have in mind (MKS 722 and MKS 626A) have a 0 to 10 V output. I haven't picked any other components yet. So we will just look at functions.

1. Pressure (dependent on transducer - from 1000 torr to .1 torr full scale, 17 bits)
2. Board temperature (0 to 100 deg C, nominal 30 deg C 10 bits nominal - 8 actual)
3. Board power bus voltage (20 to 60V, nominal 48VDC, 10 bits nominal - 8 actual)
4. Board power bus current (0 to 255 mA, nominal TBD, 10 bits nominal - 8 actual)
5. Various internal power supplies (TBD, TBD, 10 bits nominal - 8 actual)
6. Isolated CAN supply, Isolated Pressure transducer supply, Isolated MCU supplies.

Lets start with the transducer front end. It should have an op-amp (fully differential).

For the 24 bit converter I like the AD7767 it has an accuracy of 17 bits which matches the one part in 1e5 resolution of the pressure transducer.

The ADA4941-1 is a nice companion amplifier. And the ADR425 looks like a nice reference. Good specs, not too expensive.

That covers the main parts of the analog side. What about the computing side? I have been looking around and I think I like the Fujitsu CAN bus microprocessors the best. Its architecture is a mixture of a FORTH engine and a Z8 register bank.


Fujitsu 16 bit microcontrollers

Fujitsu 32 bit microcontrollers

Fujitsu microcontrollers

I haven't addressed the CAN interface yet. It is pretty simple: a few high speed optocouplers, a bus driver chip, a separate isolated power supply, some protection components and away we go.

Let me add that Fujitsu has 8 bitters that I have yet to take a serious look at. I'll probably remedy that in the next few days.

The Atmel CAN processors would be a good second choice. The reason I like the Fujitsu stuff better is that it has a very good migration path and I'd like to use one software model for as many of the process tasks as possible.


I also like the Infineon TC1166 32 bit processor with CAN. Digikey sells them for about $39 ea. Quantity one. Since programming and hardware design is going to be the big cost for the initial units I'm going to do what Chuck Moore suggests. Get the biggest fastest processor you can afford to start. Then reduce the foot print if volumes warrant.

The Fujitsu part is more open ended and has a very simple CALL structure. However, there are no automatic register saves with calls. Thus every CALL must have at least one PUSH and one POP if you expect nested calls. The Infineon has a more definite programming model with user space registers and system space registers. They each save registers on a CALL (but different sets). The cost is 2 to 5 clocks. Not a big hit (but they could have done better). The Infineon part also seems like it might be harder to learn due to instruction pipeline flushing requirements in some situations that require an instruction to finish before the following instruction(s) are executed. I do like the floating point and some other features of the Infineon, but I will set it aside for now. Well I read on and find that the Fujitsu Part also has a 5 deep pipeline. I guess when you need to flush it you just do a bunch of no-ops.

The Fujitsu also is more deterministic and can do tail end recursion since the pipeline is only one level deep (actually it is five deep also but it can do tail end recursion.). However the divide routines are not as mechanized as they are in the Infineon. Since I hardly ever use them except with user input to precalculate multiply constants that is not such a big hit.

Update 09 Jun 1534z

I have been looking at the Freescale MPC551x MPUs. I like them. Plus Freescale gives away an assembler good enough to get a FORTH up on the chip.

I like the Atmel ATA6660 CAN bus physical interface. There are later and greater chips out with more functionality , however I like to keep the interface simple and electrically isolated. You can do that with three high speed optocouplers and an isolation supply. A 48 V to 5 V job at about 1 W would be good.

2 comments:

Myrddin Wen said...

The Parallax propeller chip has 8 cpus, a bit like a ps3 cell chip.

http://www.parallax.com/tabid/254/Default.aspx

would this be of any use to you?

regards

M. Simon said...

I actually like the SEAForth chip in the respect of multiple processors. And a processor/line kind of arrangement.

Right now I've kind of settled on the ARM family. It has a good peripheral selection. The instruction set is very handy and it is well supported with low cost (and some free) tools. I will write an update on all this as soon as I'm a little farther along.