User Tools

Site Tools


cbus:cangc6-firmware-en

Differences

This shows you the differences between two versions of the page.


cbus:cangc6-firmware-en [2024/08/11 18:05] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +====== CAN-GC6 mergCBUS 4 Chanel Servo Controller ======
 +[[:english|{{  :rocrail-logo-35.png}}]]
 +[[:english|Content]] -> [[:english#hardware|Hardware]] -> [[:english#merg_cbus|mergCBUS]]
 +  * [[:cbus:overview-en|CAN-GC Overview]]
 +  * [[:can-gca1-en|CAN-GC1]] | [[:can-gca1e-en|CAN-GC1e]] | [[:can-gca2-en|CAN-GC2]] | [[:can-gc3-en|CAN-GC3]] | [[:can-gc4-en|CAN-GC4]] | [[:can-gca5-en|CAN-GC5]] | **[[:can-gc6-en|CAN-GC6]]** | [[:can-gc7-en| CAN-GC7]] 
 +    * **[[:cbus:cangc6-firmware-en|Firmware]]**
 +
 + \\
 +This page documents the HEAD revision of the firmware.\\
 +
 +
 + \\
 +
 +===== Firmware =====
 +| Firmware version: **1.a** rev.: 305, resonator: **8MHz**, Rocrail: **3181+** | \\
 +
 +The firmware is based on CAN-GC2.\\
 +Boot mode is not supported.\\
 +
 +
 +==== Copyrights ====
 +(c) [[http://www.merg.org.uk/|MERG]]\\
 +(c) [[http://www.rocrail.net|Rob Versluis, rocrail.net]]\\
 +
 +
 +==== Features ====
 +  * All variables and events are configurable. (FLiM)
 +  * Servo speed.
 +  * Switch commands are processed.
 +  * Servo end positions are reported. (GCA136 compatible.)
 +  * "Start Of Day" support.
 +  * LED4 for 1 or more servo position pending.
 +  * Relay control. (GCA137, Tx 480 baud)
 +  * External switch position sensors processing.
 +  * Save servo positions at power off.
 +  * Restore servo position and relays state. 
 +  * Stop servo pulse after reaching the wanted position + 2 seconds.
 +  * 1000 steps in pulse width from 0.5 to 2.5ms.
 +  * Max. speed 20.
 +  * Separate speed for left and right move.
 +  * Bounce option.
 +
 +  
 + \\
 +==== IDs ====
 +| NMRA Manufacturer ID |  70 |
 +| Product ID |  6 |\\
 +
 +
 +==== HEX ====
 +  * https://gitlab.com/rocrail/GCA/-/tree/master/cbus/cangc6/dist/default/production
 + \\
 +
 +==== Sources ====
 +  * https://gitlab.com/rocrail/GCA/-/tree/master/cbus
 +=== Development Tools ===
 +  * MPLAB X v1.00
 +  * C18 v3.40
 +  * PICKit 3
 +
 +
 +
 +
 + \\
 +
 +===== Node Variables =====
 +^ # ^ Description ^
 +|  1 | node configuration |
 +|  2 | CAN-ID |
 +| 3-22 | 4 x 5 Servo settings |
 +
 + \\
 +
 +==== Node configuration byte ====
 +^ Bit ^  Function  ^ Remark ^
 +|  0 | save servo positions at power off command | |
 +|  1 | use short events | |
 +
 + \\
 +
 +
 +==== Servo settings====
 +^ Byte ^  Function  ^ Remark/Range ^
 +|  0 | config | |
 +|  1 | left | 50...250 |
 +|  2 | right | 50...250 |
 +|  3 | speed left | 1...20 |
 +|  4 | speed right | 1...20 |
 +
 + \\
 +
 +=== Servo configuration byte ===
 +^ Bit ^  Function  ^ Remark ^
 +|  0 | Relay polarisation | Swap polarization. |
 +|  1 | External switch sensors | |
 +|  2 | Bounce | |
 +
 + \\
 +
 +===== Node Events =====
 +  * Sensors will generate OPC_ACON/OPC_ACOF events.
 +  * Servos will change position on OPC_ACON/OPC_ACOF.
 +
 +^ Event# ^ Description ^ Variable ^
 +|  0-3 | servo switch 1...4 | not used |
 +|  4-7 | servo sensor 1...4 | not used |
 +|  8 | SOD | not used |
 +
 + \\
 +=====Servo control=====
 +The servo pulse width must be between 0.5 and 2.5 ms for 180° range:\\
 +| {{:cbus:servo-signal.jpg?300}}|{{:cbus:gc6-servo-outputwave.jpg?300}}|
 +| Theoretically. | First real time result. | \\
 +Every 5 ms a pulse is started for one of the 4 servos. The refresh rate for each servo is 20ms: 50Hz.\\
 +Timer0 is used for the 5ms interval and Timer2 for the pulse width which is re-programmed for each servo in every 5ms cycle.\\
 + \\
 +
 +=====External Sensors=====
 +Optional every servo can use two sensor inputs, on connectors Fb1...Fb4, for signalling the switch position.\\
 +^ Straight ^ Thrown ^ Status ^
 +|  0  |  0  | The switch stand is pending. |
 +|  1  |  0  | Straight position. |
 +|  0  |  1  | Thrown position. |
 +|  1  |  1  | Invalid. | \\
 +A position change is only reported on the CBUS if only one of the inputs is high.\\
 + 
 +
 +