Skip to content

Commit

Permalink
Add laser related docs (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
parachvte authored Sep 21, 2023
1 parent 6a0272f commit 1e66470
Show file tree
Hide file tree
Showing 4 changed files with 147 additions and 3 deletions.
97 changes: 97 additions & 0 deletions docs/Laser-Commands.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Laser Commands


## 0x12 0x01 Get Laser Module Info

| Command Set | Command ID |
|-------------|------------|
| 0x12 | 0x01 |

Request Payload:

| Payload | Data Type | Description |
|---------|-----------|-------------|
| key | UInt8 | module key |

ACK Payload:

| Payload | Data Type | Description |
|---------|-----------|-------------|
| Result | UInt8 | result = 0 received |
| Laser Tool Head Info | see `class LaserToolHeadInfo` | Current state of specified laser module |


Brief info of `class LaserToolHeadInfo`
```
LaserToolHeadInfo:
- key: UInt8
- headStatus: UInt8, TODO
- laserFocalLength: Float, focal length of the laser
- platformHeight: Float, z position when the laser head touches the platform
- axisCenterHeight: Float, z position of rotary module
- laserTubeState: Float * 2, current power and target power
```

Note: You probably don't need to know laser info.


## 0x12 0x02 Set Laser Power

| Command Set | Command ID |
|-------------|------------|
| 0x12 | 0x02 |

Request Payload:

| Payload | Data Type | Description |
|---------|-----------|-------------|
| key | UInt8 | module key |
| power | Float | target power value (0-100) |

ACK Payload:

| Payload | Data Type | Description |
|---------|-----------|-------------|
| Result | UInt8 | result = 0 received |


## 0x12 0x04 Set Laser Focal Length

| Command Set | Command ID |
|-------------|------------|
| 0x12 | 0x04 |

Request Payload:

| Payload | Data Type | Description |
|---------|-----------|-------------|
| key | UInt8 | module key |
| focal length| Float | Set focal length |

ACK Payload:

| Payload | Data Type | Description |
|---------|-----------|-------------|
| Result | UInt8 | result = 0 received |


## 0x12 0x08 Set Platform Height

| Command Set | Command ID |
|-------------|------------|
| 0x12 | 0x08 |

Request Payload:

| Payload | Data Type | Description |
|---------|-----------|-------------|
| key | UInt8 | module key |
| platform height | Float | Set platform height |

ACK Payload:

| Payload | Data Type | Description |
|---------|-----------|-------------|
| Result | UInt8 | result = 0 received |

16 changes: 16 additions & 0 deletions docs/Modules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Modules

List of available modules:

| Module ID | Module |
|-----------|--------|
| 0 | Printing Module |
| 1 | CNC Module |
| 2 | 1.6W Laser Module |
| 7 | Air Purifier Module |
| 13 | Dual Extrusion Printing Module |
| 14 | 10W Laser Module |
| 16 Snapmaker Artisan Enclosure |
| 19 | 20W Laser Module |
| 20 | 40W Laser Moudle |
| 518 | Snapmaker Ray Enclosure |
8 changes: 6 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,18 @@ SACP defines as follows:
- [Data Types](Types.md) defines basic data types.
- [SACP Packet](Packet.md) defines a SACP packet should look like.

Avaible commands (editing):
Available commands (editing):

- [System Commands](System-Commands.md)
- [File Commands](File-Commands.md)
- 3D printing commands (TODO)
- Laser commands (TODO)
- [Laser commands](Laser-Commands.md)
- CNC commands (TODO)

Available Modules:

- [Modules](./Modules.md)


## Switch to SACP (using serial port)

Expand Down
29 changes: 28 additions & 1 deletion docs/System-Commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,34 @@ ACK Payload:

## 0x01 0x20 Get Module Info List

TODO
| Command Set | Command ID |
|-------------|------------|
| 0x01 | 0x20 |

Request Payload:

| Payload | Data Type | Description |
|---------|-----------|-------------|
| - | - | - |

ACK Payload:

| Payload | Data Type | Description |
|---------|-----------|-------------|
| Result | UInt8 | result = 0 means success |
| module info list | Array<ModuleInfo> | an array of all modules |

Brief structure of `class ModuleInfo`:

- key: UInt8, unique module key
- moduleId: UInt16, Indicate which kind of module it is
- moduleIndex: UInt8
- moduleState: UInt8
- serialNumber: UInt32
- hardwareVersion: UInt8
- firmwareVersion: String

Checkout [Modules](./Modules) for all available module IDs.

## 0x01 0x21 Get Machine Info

Expand Down

0 comments on commit 1e66470

Please sign in to comment.