Skip to content

Commit

Permalink
Merge pull request #5 from akkoyun/04.00.05
Browse files Browse the repository at this point in the history
04.00.05 - Readme update
  • Loading branch information
akkoyun authored Feb 10, 2022
2 parents 4599dbb + 4a4951e commit 58ce069
Showing 1 changed file with 24 additions and 77 deletions.
101 changes: 24 additions & 77 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,80 +3,27 @@ The MAX78630 is an energy measurement processor for polyphase power-monitoring s

In this Arduino Library we can read all data of energy parameters.


















## Communication Protocol

**Request**

Library is connected to **MAX78630** with serial connection (but also we connect I2C and SPI). MAX78630 has a addressed UART protocol.

When want to get a measurement from **MAX78630**, library send a request command to IC. The request command structure is below.

| ID | Name | Data | Description |
|--------|--------------------------|------|-------------------------------------------------------------------------------------------|
| Byte 1 | Header | 0xAA | This byte is named HEADER byte to connect the MAX78630 IC. This address is fixed to 0xAA |
| Byte 2 | Total Sended Byte Count | 0x07 | Total send byte count with the pack. This byte is fixed to 0x07 (7) to send command. |
| Byte 3 | Command Byte Count | 0xA3 | Total send byte count to send command. In measurement command this byte is 0xA3 (2 bytes) |
| Byte 4 | Command Byte 1 | | This bytes are the core bytes of request. In this 2 bytes we determine requested data. |
| Byte 5 | Command Byte 2 | | This bytes are the core bytes of request. In this 2 bytes we determine requested data. |
| Byte 6 | Requested Byte | 0xE3 | This byte is requested byte count. 0xE3 is means request 3 byte. |
| Byte 7 | Checksum Correction | CHK | This byte is Checksum byte for command. (MOD256) |

***

**Response**

When we send request data command, we receive answer. The recieved answer is 6 byte long data packege, RAW data is 3 byte long as we set sended command (byte 6)

| ID | Name | Description |
|--------|---------------------------|-------------|
| Byte 1 | Header | 0xAA |
| Byte 2 | Total Recieved Byte Count | 6 Byte |
| Byte 3 | Recieved Data 1 | ? |
| Byte 4 | Recieved Data 2 | ? |
| Byte 5 | Recieved Data 3 | ? |
| Byte 6 | Checksum Correction | MOD 256 |

Raw Data = (Byte 3) + (Byte 4 x 256) + (Byte 5 x 65536)

***

According the Byte1 we determine the answer type such as;

The type of slave packet depends upon the type of command from the master device and the successful execution by the slave device. Standard replies include “Acknowledge” and “Acknowledge with Data”.

| Acknowledge without data. |
|---------------------------|
| 0xAD |

| Acknowledge with data | Byte Count | Read Data | Check Sum |
|-----------------------|------------|----------------|-----------|
| 0xAA | 0x06 | 0x15 0xB8 0x2C | 0x57 |

If no data is expected from the slave or there is a fail code, a single byte reply is sent. If a successfully decoded command is expected to reply with data, the slave sends a packet format similar to the master packet where the header is replaced with a Reply Code and the payload contains the read data.

| Reply Code | Definition |
|------------|-------------------------------------- |
| 0xAA | Acknowledge with data |
| 0xAB | Acknowledge with data (half duplex) |
| 0xAD | Acknowledge without data. |
| 0xB0 | Negative Acknowledge (NACK). |
| 0xBC | Command not implemented. |
| 0xBD | Checksum failed. |
| 0xBF | Buffer overflow (or packet too long). |
## Measured Parameters

* Instant voltage for specified phase (R,S,T)
* RMS voltage for specified phase (R,S,T)
* Fundamental voltage for specified phase (R,S,T)
* Harmonic voltage for specified phase (R,S,T) and specified harmonic
* Line frequency
* Instant current for specified phase (R,S,T)
* RMS current for specified phase (R,S,T)
* Peak current for specified phase (R,S,T)
* Fundamental current for specified phase (R,S,T)
* Harmonic current for specified phase (R,S,T) and specified harmonic
* Active power for specified phase (R,S,T)
* ReActive power for specified phase (R,S,T)
* Apparent power for specified phase (R,S,T)
* Fundamental power for specified phase (R,S,T)
* Harmonic power for specified phase (R,S,T) and specified harmonic.
* Power factor for specified phase (R,S,T)
* Fundamental ReActive power for specified phase (R,S,T)
* Harmonic ReActive power for specified phase (R,S,T)
* Fundamental VA power for specified phase (R,S,T)
* IC Temperature

Also set limits for alarm monitoring.

0 comments on commit 58ce069

Please sign in to comment.