Difference between revisions of "FixmeBus"

From Fixme.ch
Jump to: navigation, search
(Overview)
 
(18 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
==Overview==
 
==Overview==
  
[[File:20140412 190054t.jpg|thumb|260px]]
+
[[File:len.png|thumb|500px]]
FixmeBus is a field bus based on the half duplex RS485 famous hardware protocol. It is a master / slave architecture, with every slave chained together.  
+
[[File:RS-485.gif|thumb|500px]]
 +
[[File:20140412 190054t.jpg|thumb|500px]]
 +
FixmeBus is a field bus based on the half duplex [http://en.wikipedia.org/wiki/RS-485 RS485] famous hardware protocol. It is a master / slave architecture, with every slave chained together.  
  
The communication protocol has following parameters:
+
===The communication protocol is a standard UART...===
 +
... which has these following parameters:
  
 
*38,400 bauds
 
*38,400 bauds
Line 14: Line 17:
 
*no flow control
 
*no flow control
  
Each end of the bus is terminated with a 1% 120R resistor.
+
Each end of the bus is terminated with a 1% 120R resistor. The A/B lines are biased once at the gateway with 2x 1kOhms resistors.
  
Every data frame on the bus is like this (byte on the left = first byte):
+
The maximum length @38,400 bauds is 4 kFt = 1.2 km (see the graphic on the right).
  
*2 bytes of slave adress (ID_HIGH and ID_LOW) => 65536 slave adress
+
===Every data frame contain chronologically:===
 +
 
 +
*2 bytes of slave adress (ID_HIGH and ID_LOW) => 65536 slave adress at all
 
**ID = 0 => Master
 
**ID = 0 => Master
 
**ID = 65535 => order to all slaves (no ack)
 
**ID = 65535 => order to all slaves (no ack)
 
**ID = 65000 to 65499 => order to a group of slave (no ack)
 
**ID = 65000 to 65499 => order to a group of slave (no ack)
**ID = 1000 to 64999 => order to an unique slave (ack)  
+
**ID = 1000 to 64999 => order to a unique slave (ack)  
 
*2 bytes for the function (FCT_HIGH and FCT_LOW)
 
*2 bytes for the function (FCT_HIGH and FCT_LOW)
 
*1 byte for the number of data bytes to transmit (N_BYTE)  
 
*1 byte for the number of data bytes to transmit (N_BYTE)  
 
*n byte(s) of data (DATA) bytes (max. 200 bytes per frame)
 
*n byte(s) of data (DATA) bytes (max. 200 bytes per frame)
*2 bytes for the CRC (CRC_HIGH and CRC_LOW)
+
*2 bytes for the [http://en.wikipedia.org/wiki/Cyclic_redundancy_check CRC] [http://en.wikipedia.org/wiki/Modbus Modbus] (CRC_HIGH and CRC_LOW)
  
 
{| class="wikitable" style="text-align: center; color: green;"
 
{| class="wikitable" style="text-align: center; color: green;"
Line 52: Line 57:
 
|}
 
|}
  
==Technical information==
+
The CRC Modbus can be calculated [http://www.lammertbies.nl/comm/info/crc-calculation.html here]
 +
 
 +
==White board #2 - 3 mai electrojam #3==
 +
[[File:Wb2.jpg|thumb|500px]]
 +
 
 +
*Y aura 1 board slave avec du 3v3, 1 board avec du 5v !
 +
 
 +
*Les esclaves pourront parler sur le bus, mais seulement pour faire du reporting d'événements,  pas pour faire des requêtes. Les esclaves n'ont AUCUNE intelligence. (Ce n'est que pure coïncidence avec mon semblant de segregationiste !).
 +
 
 +
*Version 1 : seul le maître peut parler
 +
*Version 2 : les esclaves peuvent parler mais sans donner d'ordre.
 +
*Version 3 : les esclaves peuvent se donner des ordres parmi et se livrent une bataille de pouvoir (long Power sur 32 bits = pouvoir).... le maître peut être réduit à l'esclavage !!! ... un peu comme la reine d'Angleterre...
 +
 
 +
*Les esclaves seront alimentés par un POE "fait maison" 24VDC 5A, avec alim industrielle sur rail DIN Schneider Electric. Chaque esclave doit comsommer max 50 mA sous 24VDC (= 1.2 W max) => 100 Esclaves par Fixme bus
 +
 
 +
*La règle pour parler, c'est premièrement d'écouter 50 ms sur le Bus, y compris le master. En cas de collision, c'est à dire de CRC faux, le maître reprend le contrôle du bus, et commande aux slaves qui ont parlé, mais qui n'ont pas reçu de ack (les 2 slave émetteurs malchanceux) de rejouer leur partie après un delay de n [ms] prix aléatoirement. Pour cela le firmware de la roue de la fortune pourra être repris.
 +
 
 +
*But financier :
 +
**Prix de revient du hardware : 33.- CHF
 +
**Développement C pour la gestion du bus bas niveau, développement python des parties gestion des droits, data frame output, base de donnée et APIs + développement PHP pour service client, packaging : 33.-
 +
**Bénéfice pour réserve développements projets FIXME : 33.- CHF
 +
**Total : 99.- le module tout public = slave 3v3 ou slave 5v ou FBG (FixmeBus Gateway)... prix spéciaux...
 +
 
 +
*J'ai oublié : DANS LE SERIAL FRAME IL FAUT RAJOUTER L'EXPEDITEUR (2 BYTES).
 +
 
 +
==Technical Documents==
 
#[[Hardware]]
 
#[[Hardware]]
#[[Software]]
+
#[[...]]

Latest revision as of 07:04, 4 May 2014

Overview

Len.png
RS-485.gif
20140412 190054t.jpg

FixmeBus is a field bus based on the half duplex RS485 famous hardware protocol. It is a master / slave architecture, with every slave chained together.

The communication protocol is a standard UART...

... which has these following parameters:

  • 38,400 bauds
  • 8 data bits
  • 1 start and 1 stop bit
  • no parity
  • no flow control

Each end of the bus is terminated with a 1% 120R resistor. The A/B lines are biased once at the gateway with 2x 1kOhms resistors.

The maximum length @38,400 bauds is 4 kFt = 1.2 km (see the graphic on the right).

Every data frame contain chronologically:

  • 2 bytes of slave adress (ID_HIGH and ID_LOW) => 65536 slave adress at all
    • ID = 0 => Master
    • ID = 65535 => order to all slaves (no ack)
    • ID = 65000 to 65499 => order to a group of slave (no ack)
    • ID = 1000 to 64999 => order to a unique slave (ack)
  • 2 bytes for the function (FCT_HIGH and FCT_LOW)
  • 1 byte for the number of data bytes to transmit (N_BYTE)
  • n byte(s) of data (DATA) bytes (max. 200 bytes per frame)
  • 2 bytes for the CRC Modbus (CRC_HIGH and CRC_LOW)
b0 b1 b2 b3 b4 b5 ... bn+4 bn+5 bn+6
ID_HIGH ID_LOW FCT_HIGH FCT_LOW N_BYTE DATA[0] ... DATA[n-1] CRC_HIGH CRC_LOW

The CRC Modbus can be calculated here

White board #2 - 3 mai electrojam #3

Wb2.jpg
  • Y aura 1 board slave avec du 3v3, 1 board avec du 5v !
  • Les esclaves pourront parler sur le bus, mais seulement pour faire du reporting d'événements, pas pour faire des requêtes. Les esclaves n'ont AUCUNE intelligence. (Ce n'est que pure coïncidence avec mon semblant de segregationiste !).
  • Version 1 : seul le maître peut parler
  • Version 2 : les esclaves peuvent parler mais sans donner d'ordre.
  • Version 3 : les esclaves peuvent se donner des ordres parmi et se livrent une bataille de pouvoir (long Power sur 32 bits = pouvoir).... le maître peut être réduit à l'esclavage !!! ... un peu comme la reine d'Angleterre...
  • Les esclaves seront alimentés par un POE "fait maison" 24VDC 5A, avec alim industrielle sur rail DIN Schneider Electric. Chaque esclave doit comsommer max 50 mA sous 24VDC (= 1.2 W max) => 100 Esclaves par Fixme bus
  • La règle pour parler, c'est premièrement d'écouter 50 ms sur le Bus, y compris le master. En cas de collision, c'est à dire de CRC faux, le maître reprend le contrôle du bus, et commande aux slaves qui ont parlé, mais qui n'ont pas reçu de ack (les 2 slave émetteurs malchanceux) de rejouer leur partie après un delay de n [ms] prix aléatoirement. Pour cela le firmware de la roue de la fortune pourra être repris.
  • But financier :
    • Prix de revient du hardware : 33.- CHF
    • Développement C pour la gestion du bus bas niveau, développement python des parties gestion des droits, data frame output, base de donnée et APIs + développement PHP pour service client, packaging : 33.-
    • Bénéfice pour réserve développements projets FIXME : 33.- CHF
    • Total : 99.- le module tout public = slave 3v3 ou slave 5v ou FBG (FixmeBus Gateway)... prix spéciaux...
  • J'ai oublié : DANS LE SERIAL FRAME IL FAUT RAJOUTER L'EXPEDITEUR (2 BYTES).

Technical Documents

  1. Hardware
  2. ...