Can-Do Breadboarding

From TeamFrednetWiki

Jump to: navigation, search

Contents

CAN-Do introduction

Lunar Lander CAN Do System Diagram

This page and its subpages document the work done for the Can-Do Breadboarding task as described in the task specification.

The diagram at right presents the structure of the CAN-Do architecture in an example. PCB modules (called widgets) interconnect on lines shared with the bus master Internal Housekeeping Unit.

Analytical Investigation

This subtask is related to the analytical investigation of the CAN-Do capabilities and physical properties (mass, power, etc.) and comparison with other potential candidates, if any.

  • CAN-Do is compatible with the open space FREDNET philosophy because it has had an open architecture since 2003. You can build by your self. Last update was Oct 25, 06: Firmware v3.04 released ref.
  • CAN-Do is supported by two main sponsors: AMSAT DL and AMSAT NA, one in EU and one in USA which gives a good accessibility for our teams.
  • CAN-Do has the Accepted to fly on Satellites as a long term milestone. Could be a problem for our space certification? discussion.
  • CAN-Do is oriented to widgets.
  • CAN-Do use is justified when the system size is large or when the complexity is large.


CAN-Do details


These widgets (24 x 74 mm) provide a standard module interface to the spacecraft consisting of:

  • digital outputs/inputs.
  • analog inputs.
  • switched power.
  • current sensing.
  • temperature sensing.


CAN-Do widgets


There are three possible modes for which a widget can be configured that differ in the number of digital inputs/outputs and analog inputs and how these are presented to the module (the widget does not support the use of more than 63 outputs or 64 inputs). The three modes currently defined are:

  • Standard
  • Multiplexed (If you need 13 to 63 digital outputs or 9 to 64 digital inputs).
  • Byte-pipe (If Module contains a microprocessor that needs to exchange bulk data (download of pictures, upload of tables, etc.) with the IHU or if the microprocessor within the Module needs to have code loaded).


There are six pads for address (A0-A5 : 0x01-0x3F (NOTE: 0x00 must remain unused)) and two pads for mode (M0, M1).

Address&Mode pads
M1 M0 Mode
0 0 Reserved(not defined)
0 1 Byte-pipe(0x01)
1 0 Multiplexed(0x02)
1 1 Standar(0x03



Three of the eight analog sensor lines (AIN5 thru AIN7) have a dedicated purpose on the Widget. The remaining channels (AIN0 thru AIN4) are available for tasking by Module Designer. The three dedicated sensors are:

  • AIN7: the Widget switched-power current sensor (an LT1787HVHS8 device)
  • AIN6: the Widget temperature sensor (an LM60CIM device)

Linear 6.25 mV/ºC (174 mV to 1.205 V : -40 to +125 ºC)

  • AIN5: the Widget switched-power current measuring circuit bias

Note: The value of AIN5 combined with the value of AIN7 provide the single current sense value for the Widget.

Test Harness

This subtask is related to building a test harness that is representative for an on-board avionics architecture (breadboarding).


All info about bus CAN-Do build process has been extracted from CAN-Do developers web

Materials for bus CAN-Do widget



On a first approach, we decided to build two CAN-Do widgets. We include a bill of materials in Annexes. Definitive CAN-Do materials price for a single widget is around 50 €, including some mistakes ordering. There are some difficult materials to find and we had to do different orders. Finally we have a stock to build ten CAN-Do widgets.

Quantity Component PCB Footprint Provider link Cost
(Per unit)
2 0.1 uF Capacitors 1206-8 Digi-Key 0.4 $
8 0.1 uF Capacitors 0603 Digi-Key 0.65 $
1 33 uF/63 V Capacitor RC25X440+ Digi-Key 0.33 $
1 100 uF/25 V Capacitor RC25X440+ Digi-Key 0.52 $
1 0.1 uF Capacitor 1206 Digi-Key 0.38 $
1 10 uF/30 V Capacitor 7243 Digi-Key 0.19 $
2 22 pF Capacitors 0603 Digi-Key 0.06 $
1 1 uF Capacitor 1206 Digi-Key 0.13 $
1 B130L Diode SMA Digi-Key 0.81 $
1 BZX84C12 Diode SOT23 Digi-Key 0.54 $
4 BAT54TW SOT363 Digi-Key 0.77 $
1 2A Fuse 1206 Digi-Key 0.77 $
1 10 uH Coil CDRH125 Digi-Key 0.64 $
1 Bead Coil R300/150 Digi-Key 0.15 $
1 470 uH Coil DO3308 Digi-Key 0.77 $
1 MMBT3904 SOT23 Digi-Key 0.09 $
1 IRF9530 TO220-132V Digi-Key 0.77 $
2 Paralel resistors array 100 kOhms EXB-A Digi-Key 0.19 $
7 Series resistors array 1 kOhms 1206-8 Digi-Key 0.18 $
3 2k67 Ohms resistors 0603 Digi-Key 0.08 $
1 33k2 Ohms resistor 0603 Digi-Key 0.08 $
1 68k1 Ohms resistor 0603 Digi-Key 0.08 $
1 27k4 Ohms resistor 0603 Digi-Key 0.08 $
1 1M Ohms resistor 0603 Digi-Key 0.08 $
1 0R02 Ohms resistor 0603 Digi-Key 1.4 $
2 47k5 Ohms resistors 0603 Digi-Key 0.08 $
2 287k Ohms resistors 0603 Digi-Key 0.08 $
1 2k00 Ohms resistor 0603 Digi-Key 0.09 $
1 74HC165/SO SO16NB Digi-Key 0.5 $
1 S+M(specify) S+M Digi-Key 5.00$
1 PCA82C250T SO8NB Digi-Key 1.4 $
1 T89C51CC01-VQFP VQFP44 Digi-Key 10.4 $
1 LM385M3-2.5 SOT23 Digi-Key 1.4 $
1 LM2574HVM-5.0 SO14WB Digi-Key 5.12 $
1 LT1787HVHS8 SO8NB Linear Technology 5.00 $
1 QSBT40DICT SOT363 Digi-Key 1.00 $
1 LM60CIM SOT23 Digi-Key 0.5 $
1 8 MHz oscillator CM309S Digi-Key 1 $
Shipping cost 10 $
TOTAL 47.5 $


Electric Schematics


These are the electric schematics to be followed. Like all the info, have been extracted from bus CAN-Do developers, you can see it below:

Schematic 1
Schematic 2


PCB



The PCB have been extracted from bus CAN-Do developers and opened with "OrCAD 16.0" and particularly with "OrCAD Layout Engineer's Edition". They have an estimated cost of 110$ per PCB.

You can see prints screen below:

PCB 1
PCB 2
PCB 3
Current status of the CAN-Do boards



PC connection


We use a Lawicel CAN232 serial interface with and approximated cost of 160$ (shipping included). The test software will be running Windows obtained on CAN-Do developers website:

  • User Housekeeping Unit (UHU) software (one widget on a cable).
  • CAN Do Network Controller software (CDNC, designed to interact with one Widget on a cable to an entire satellites worth of Widgets on the cable).


CAN to RS232 converter for PC computer
File:CAN-Do RS232 front.jpg
CAN to RS232 frontside without cover
File:CAN-Do RS232 backside.jpg
CAN to RS232 backside without cover

CAN devices are wired to the bus in parallel. The D15P connector provides for two CAN-HI and CAN-LOW connections to simplify the creation of the wiring harness.

The typical wiring harness for a single CAN232 controller and a single widget consists of the following parts:

1 – DB15S
1 – DB9S
A length of cable to be used for power (2 conductor)
A length of cable to be used for the CAN communication (2 conductor)
2 – 120 Ohm resistors
1 – Power connector socket


Power routes to both the Widget and to the CAN232 Bus adapter.

Image:CAN-Do cable.jpg Note: The CAN232 device requires that PWR be 8-15 VDC.

The author uses a more complicated harness which connects 3 widgets, one test jig (IHU simulator), one CAN bus adapter for monitoring and another CAN bus adapter (the Lawicel CAN232). When using a cable built for more than one widget, shorting plugs were created out of D15P’s which allowed attaching a shorting plug at each D15S where a widget was not connected so the cable could be used as a 1, 2 or 3-widget cable(this part is on revision).

In our case we have builded a cable with a 15 pin male connector and 9 pin male/female connector.
For 15 pin male connector,

  • CAN HI: Yellow [10]
  • CAN LOW: Blue [11]
  • POWER: Red [8&15]
  • GROUND: Green [1&9]


For 9 pin male/female connector,

  • CAN HI: Yellow [7]
  • CAN LOW: Blue [2]
  • POWER: Red [9]
  • GROUND: Green [3]


Including a 120 ohms resistor between CAN HI and CAN LOW pins both sides.
Note: Our CAN-Do first board has been builded using a 15 pin female connector.

Testing CAN232



A manual for CAN232 configuring is available at CAN232 downloads.
After reading it we decide execute Windows Hyperterminal in order to stablish an initial connection configuring CAN232.
Below a print screen shows which commands are useful for our purpose. The test was successful.

CAN232 Hyperterminal



Valuable info:

  • CAN speed configured up to 125k
  • RS232 speed up to 57600 baud
  • Auto Poll/Send ON
  • Time Stamp ON



Reset


There are two reset types:

  • restart and jump back into the firmware.
  • restart jumping into the built-in CAN boot loader in order to accept new firmware.


The author created a simple slide switch and push-button combination device which allows switching between the two reset forms and then causing a reset by pressing the push-button. The push button shorts pins one (VCC) and two (RESET) when pressed. The slide switch connects a 100 ohm resistor between pins three (PSEN) and four (GND). If the resistor is in circuit at reset pushbutton release, the device jumps into the boot-loader (new firmware). If the resistor is not in circuit at release the device jumps into the current firmware. These parts are mounted on an 8-pin DIP socket with one row of pins cut off. We will build the same (or similar) device.

Original Reset pins
Original Reset Device



We have built a reset device without a switch. For that reason, this device only is able to reset a widget in order to be flashed with a new firmware. The other reset mode can be achieved disconnecting the widget from source and connecting it again.

Firmware Overview


We have the IHU to which is wired a number or payloads (Modules) all connected via the CAN bus. Each module contains a Widget which is its interface to the CAN bus. This is common to all three widget modes.

The IHU:

  • Write control values to all of these Modules.
  • Record the telemetry from each of these Modules (both analog channels and digital inputs).
  • Every 20 miliseconds (50 times a second).
  • Is effectivily sending a configure packet to each Widget on the bus, to all of the Widgets (within this 20 miliseconds period).
  • Each configure packet is addressed to one specific Widget.
  • The Widget intended to receive the configure packet is then expected to digitize all built-in analog channels and read all digital inputs returning both sets of values as one or more answer packets.


In conclusion, the IHU can send and receive data from all Widgets in each 20 miliseconds period.

Analog to Digital Conversion Process


There are 8 analog channels (provided by the T89C51CC01 microcontroller). The firmware, in response to a configure packet, will digitize all of the channels and report these values in response packets. Highlight details:

  • The firmware digitizes all eight channels in sequence.
  • It makes 16 digitizing passes over all eight channels accumulating a sum for each channel. When this process finish, divides each sum by 16, which produces the result reported in the answer packet.
  • Meanwhile the firmware digitizes, microcontroller is placed into a quiet mode (to reduce noise).
  • The procces to convert all eighy channels 16 times and divide each channel sum takes roughly 6.2 miliseconds.


In conclusion, there are 6.2 miliseconds delay between the widget receiving a configure packet and the widget starting to send the answer packets. This means that an IHU will be able to send a number of configure packet before any of the answer packets start arriving at the IHU.

Hardware Watchdog Recovery System


ATMEL T89C51CC01 microcontroller has a hardware implementation of a watchdog (WD) timer.

Watchdog schematic


WD timer is set to expire in roughly 3.12 seconds. In order to keep our watchdog from expiring we simply report to it that the firmware is running well each time the Widget sends a response to the IHU. The firmware maintains more than one copy of the last known good configure value in RAM. If WD expires:

  • The microcontroller resets itself.
  • Upon reset, all I/O pins are driven high.


The widget firmware implement a WD event log written to ERAM. This log tracks two kinds of WD events when the WD expired: (1): "no configure traffic heard, so resetting". (2): "firmware was locked in an infinite loop" (the firmware logs which loop the firmware was in at the time of expiration).
In summary then, Watchdog (WD) events can be useful during ground based testing and maybe even we are in space to monitoring the WD event log within our Widgets.

CAN Traffic Health Indication


The CAN controller within the ATMEL microcontroller tracks a set of transient errors or warnings during packet transmission and reception. The Widget firmware extends this tracking by adding counters of these event. The firmware implements:

  • "0x18MM Module Read Counters"----------------------->REQUEST message
  • "0x38MM Module Read Counters Response"------->RESPONSE message


These allow know the value of these counters by the IHU or by ground test software if desired. The request message can also be used to clear (reset to zero) these counters.

Flashing a widget (Flasher / Linux)


We must download flasher utility from developers website plus firmware. To flash a widget we must work with Linux (Ubuntu) and follow the examples provided by CAN-Do developers

Controlling a widget (CDNC / Windows)


We must download CDNC software available in CAN-Do website (web link only works with Internet Explorer). This software allows us to connect with more than a widget, but for the moment, we only have a cable ready to connect with a single widget.
To be finished

Standard Mode


Standard mode CAN-Do provides,

  • 12 Digital Output bits.
  • 8 Digital Output bits.
  • 5 Analog Input signals.
  • Module Power Control.
  • Current sensing and Temperature sensing.


No additional hardware is required.

Multiplex Mode


For multiplex mode the CAN-Do requires external latches and 3-to-8 latch-address decoding to complete the system. A hardware module is required.

Multiplex mode provides,

  • 63 Digital output signals.
  • 64 Digital input signals.
  • 5 Analog inputs.
  • Module Power Control.
  • Current and Temperature sensing.


Byte-pipe Mode


Byte-pipe mode has less generla I/O than other modes, but provides a byte-wide input port and a byte-wide output port. Both ports can send/receive info using free bandwidth obtaining 7 kbytes/sec data transfer. Builders comment we could obtain a maximun peak of 90 kbytes/sec data transfer modifying some capacitors from previous CAN-Do design.

In conclusion,

  • 8 output bits.
  • 8 input bits.
  • 3 analog input signals.
  • Module Power Control.
  • Current and temperature sensing.



Running tests and simulations



The first CAN-Do board has been built. Soldering some components was really difficult a beta version has now able to be wrote it firmware and test it. Some problems were present like difficulties finding some special components like series resistor arrays and soldering microcontrollers or SMD components. We have done a power test checking for short-cuts. The test was done by a current controlled Power Source and was very successful. The board has passed the first Quality Control.

Some photos below:

CAN-Do front view
CAN-Do back view
CAN-Do perspective view
CAN-Do side view



In order to install firmware inside our microcontroller flash memory, we must download code source provided by CAN-Do developers. Now we have problems with firmware installation, because we obtain an error during installation. After that, we must install software (running Linux) to be in contact with CAN-Do board, but some links are broken. We are in contact with them in order to obtain software required. Once we will solve those problems we will be able to stablish first contact connecting CAN-Do board with cable builded before and our CAN232 device. CAN232 must be connected by RS232 to our PC. Some photos are going to be included soon.

File:CAN-Do connecting PC.jpg
CAN-Do connecting PC
CAN-Do before connecting



CAN bus utilization



An excel file helps us to calculate which bandwidth we will use depending on widgets number and working mode. This excel is provided by CAN-Do developers. Ideally, up to 50 widgets can be connected at the time (any Widget need around 2% bandwidth).


Personal tools