Command Set
The PTHAT is controlled by sending simple serial commands.
-
- All commands are sent as Text (ASCII) format. This may mean sending more data in the communications, but it saves the end programmer having to do LongToByte calculations and keeps things simpler.
- All commands are sent as Text (ASCII) format. This may mean sending more data in the communications, but it saves the end programmer having to do LongToByte calculations and keeps things simpler.
-
- Each command has to be terminated with a * character and all letters must be in capitals. Replies from the PTHAT will also be returned with a * character.
-
- Also each command must have the full byte count. For example if you wanted to set a frequency of 1000Hz (1kHz), you can not just enter 1000 it must be formatted as 001000.000 in the Set Axis Command. Our software examples show the formatting.
-
- After every command is sent, you will receive a Received command reply back and also a Completed command reply back. The Received command lets you know that the PTHAT has received the command okay and the Completed command reply lets you know if was executed ok. You can turn these replies off if needed, but be aware that it does not turn off all Completed command replies such as when an Axis finishes its pulse count.
-
- All commands can be either sent as Instant commands that get executed straight away or a Buffered commands, where they get stored in the PTHAT memory and get executed one after the other.
We also have RAW Buffered commands which is useful if sending lots of small motor movements where the latency of the serial port communications could an issue.
We will cover this more in the examples page.
- All commands can be either sent as Instant commands that get executed straight away or a Buffered commands, where they get stored in the PTHAT memory and get executed one after the other.
-
- Multiple Set Axis Commands can be send before then sending a Start Command. This allows all four motors to be synchronized on start as well as keeping interpolation maintained if running a X’Y setup.
-
- All replies except the Raw buffer Commands are 7 characters in length or can be divided by 7, which makes filtering replies easier in your application code when more than one reply is returned at the same time.
- We also have messages that will come back from the limit switch inputs and Emergency Stop input it triggered when enabled. These are:
ESTrig*
XLTrig*
YLTrig*
ZLTrig*
ELTrig*
There is a jumper on board the PTHAT that will let you select either Standard Speed or High Speed.
Please note that the Raspberry Pi 2 will work with the High Speed setting fine, but you may have to drop down to Standard Speed for the Raspberry Pi 3 due to the change in the UART hardware now used in the Raspberry Pi3 and not supporting Non-Standard Baud rates.
Another option around this is that we will probably release a different firmware that has the High Speed set to Standard of 460800 or even 921600 baud, but with testing we found at the top speed of 921600 and the amount of packets we were sending, that crashes could occur.
The communication settings should be:
Standard Speed | High Speed |
BaudRate = 115200 Parity = None StopBits = One DataBits = 8 Handshake = None |
BaudRate = 806400 Parity = None StopBits = One DataBits = 8 Handshake = None |
Here is a quick list of the commands:
Instant Commands
Set Axis Command
Set Auto Direction
Set Auto Count Pulse Out Command
Start Axis Command
Stop Axis Command
Pause/Resume Axis Command
Request Current Pulse Count Command
Change Axis Speed on the fly Command
Enable/Disable Limit Switches
Request IO Port Status Command
Request ADC Reading Command
Set Aux Output Command
Set Wait Delay Command
Toggle Motor Enable Line
Turn On/Off Received Command Replies
Turn On/Off Completed Command Replies
Request Firmware Version
Reset PTHAT
Pulse Width Modulation Commands
Set PWM Channel Command
Set Both PWM Channels Command
Buffer Commands
H Initiate the buffer
Z Buffer Start command
Buffer Loop Start command
Below we will show each command and break it down to show what each byte of the command does.
⊗Standard Commands that can be used as Instant or Buffered.
If sending as Buffered commands, remember you will need to initiate the buffer first and also use a buffer start command. This will be covered further down the page.
⊗
Set Axis Command I00CX125000.000429496729511110001001*
This Command sets the properties of each Axis, but does not start the pulse train on that Axis.A Start Command must be used after to activate.
Byte1 | Byte 2-3 | Byte 4-5 | Byte 6-15 | Byte 16-25 | Byte 26 | Byte 27 | Byte 28 | Byte 29-31 | Byte 32-34 | Byte 35 | Byte 36 | Byte 37 |
---|---|---|---|---|---|---|---|---|---|---|---|---|
I | 00 | CX | 125000.000 | 4294967295 | 1 | 1 | 1 | 100 | 010 | 0 | 1 | * |
Set Axis Reply
The PTHAT will send back a reply when it receives a command and also when it has completed a command.If the Command sent ID number was set for bytes 2-3, then this will be returned in the reply.
These can be turned off if needed.
X set Received | Y set Received | Z set Received | E set Received | X set Completed | Y set Completed | Z set Completed | E set Completed |
---|---|---|---|---|---|---|---|
RI00CX* | RI00CY* | RI00CZ* | RI00CE* | CI00CX* | CI00CY* | CI00CZ* | CI00CE* |
Set Axis Command Breakdown
Byte | Setting | Description | |
---|---|---|---|
Byte 1 | I=Instant Command B=Buffer Command | Sets command to either Instant or Buffer. | |
Byte 2-3 | 0-99 | Optional Command ID | |
Byte 4-5 | CX= Set X-Axis CY= Set Y-Axis CZ= Set Z-Axis CE= Set E-Axis | Sets which Axis is to be set | |
Byte 6-15 | 000000.000-500000.000 | Sets the frequency of the pulse train | |
Byte 16-25 | 0000000000-4294967295 | Sets the required pulse count. | |
Byte 26 | 0-1 | Direction 0=CW 1=CCW | |
Byte 27 | 0-1 | Start Ramp 0=No ramp 1=Ramp | |
Byte 28 | 0-1 | Finish Ramp 0=No ramp 1=Ramp | |
Byte 29-31 | 0-255 | Ramp divide. This will divide the target frequency by this value for each ramp increment. | |
Byte 32-34 | 0-255 | Ramp pause between each ramp increment., | |
Byte 35 | 0-2 | Link to ADC 0=No ADC 1=Link to ADC1 2=Link to ADC2 | |
Byte 36 | 0-1 | Enable Line Polarity 0=Enable Line 0 Volts 1=Enable Line 5 Volts | |
Byte 37 | * | End of Command |
Set Auto Direction Change Command I00BX0000000100*
This Command sets the Auto Direction Change of each Axis, but does not start the pulse train on that Axis.A Start Command must be used after to activate.
Byte1 | Byte 2-3 | Byte 4-5 | Byte 6-15 | Byte 16 |
---|---|---|---|---|
I | 00 | BX | 0000000100 | * |
Set Auto Direction Change Reply
The PTHAT will send back a reply when it receives a command and also when it has completed a command.If the Command sent ID number was set for bytes 2-3, then this will be returned in the reply.
These can be turned off if needed.
X set Received | Y set Received | Z set Received | E set Received | X set Completed | Y set Completed | Z set Completed | E set Completed |
---|---|---|---|---|---|---|---|
RI00BX* | RI00BY* | RI00BZ* | RI00BE* | CI00BX* | CI00BY* | CI00BZ* | CI00BE* |
Set Auto Direction Change Command Breakdown
Byte | Setting | Description | |
---|---|---|---|
Byte 1 | I=Instant Command B=Buffer Command | Sets command to either Instant or Buffer. | |
Byte 2-3 | 0-99 | Optional Command ID | |
Byte 4-5 | BX= Set X-Axis BY= Set Y-Axis BZ= Set Z-Axis BE= Set E-Axis | Sets which Axis is to be set to auto change direction | |
Byte 6-15 | 0000000000-4294967295 | Sets the Pulse count to change direction on the fly | |
Byte 16 | * | End of Command |
Set Auto Count Pulse Out Command I00JX00000001001111*
This Command sets which Axis and at what pulse count it should send back the current pulse count of each axis.It also sends back direction of travel.
You can also choose what pulse replies are sent back X'Y'Z or E.
A Start Command must be used after to activate.
Be aware that this command can cause a lot of data being sent back over the serial port and if you try to send other commands while it is sending data back, there could be a clash.
Byte1 | Byte 2-3 | Byte 4-5 | Byte 6-15 | Byte 16 | Byte 17 | Byte 18 | Byte 19 | Byte 20 |
---|---|---|---|---|---|---|---|---|
I | 00 | JX | 0000000100 | 1 | 1 | 1 | 1 | * |
Set Auto Count Pulse Out Reply
The PTHAT will send back a reply when it receives a command and also when it has completed a command.The Pulse Count and direction that the motor is travelling will be sent back when pulse target is hit.
If the Command sent ID number was set for bytes 2-3, then this will be returned in the reply.
These can be turned off if needed.
X set Received | Y set Received | Z set Received | E set Received | X set Completed | Y set Completed | Z set Completed | E set Completed |
---|---|---|---|---|---|---|---|
RI00JX* | RI00JY* | RI00JZ* | RI00JE* | CI00JX* | CI00JY* | CI00JZ* | CI00JE* |
DI00JX* XP(D)XResult* YP(D)YResult* ZP(D)ZResult* EP(D)EResult* | DI00JY* XP(D)XResult* YP(D)YResult* ZP(D)ZResult* EP(D)EResult* | DI00JZ* XP(D)XResult* YP(D)YResult* ZP(D)ZResult* EP(D)EResult* | DI00JE* XP(D)XResult* YP(D)YResult* ZP(D)ZResult* EP(D)EResult* | ||||
(D)=Direction of motor travel | (D)=Direction of motor travel | (D)=Direction of motor travel | (D)=Direction of motor travel | ||||
Result=0000000000-4294967295 | Result=0000000000-4294967295 | Result=0000000000-4294967295 | Result=0000000000-4294967295 |
Set Auto Count Pulse Out Command Breakdown
Byte | Setting | Description | |
---|---|---|---|
Byte 1 | I=Instant Command B=Buffer Command | Sets command to either Instant or Buffer. | |
Byte 2-3 | 0-99 | Optional Command ID | |
Byte 4-5 | JX= Set X-Axis JY= Set Y-Axis JZ= Set Z-Axis JE= Set E-Axis | Sets which Axis is to be set to auto send pulse counts on | |
Byte 6-15 | 0000000000-4294967295 | Sets the Pulse count at which all Axis pulse counts will be sent back | |
Byte 16 | 0-1 | 0=Disable X Axis Pulse Replies 1=Enable X Axis Pulse Reply | |
Byte 17 | 0-1 | 0=Disable Y Axis Pulse Replies 1=Enable Y Axis Pulse Reply | |
Byte 18 | 0-1 | 0=Disable Z Axis Pulse Replies 1=Enable Z Axis Pulse Reply | |
Byte 19 | 0-1 | 0=Disable E Axis Pulse Replies 1=Enable E Axis Pulse Reply | |
Byte 20 | * | End of Command |
Start Axis Command I00SX*
Start one of the pulse trains going or start all.Byte1 | Byte 2-3 | Byte 4-5 | Byte 6 |
---|---|---|---|
I | 00 | SX | * |
Start Axis Reply
The PTHAT will send back a reply when it receives a command and also when it has completed a command.In this case the completed command will be sent back when the Axis that has been started completes the Pulse Count.
If the Command sent ID number was set for bytes 2-3, then this will be returned in the reply.
X Start Received | Y Start Received | Z Start Received | E Start Received | All Start Received | X Pulse Count Complete | Y Pulse Count Complete | Z Pulse Count Complete | E Pulse Count Complete |
---|---|---|---|---|---|---|---|---|
RI00SX* | RI00SY* | RI00SZ* | RI00SE* | RI00SA* | CI00SX* | CI00SY* | CI00SZ* | CI00SE* |
Start Axis Command Breakdown
Byte | Setting | Description | |
---|---|---|---|
Byte 1 | I=Instant Command B=Buffer Command | Sets command to either Instant or Buffer. | |
Byte 2-3 | 0-99 | Optional Command ID | |
Byte 4-5 | SX= Start X-Axis SY= Start Y-Axis SZ= Start Z-Axis SE= Start E-Axis SA= Start All | Sets which Axis is to be started | |
Byte 6 | * | End of Command |
Stop Axis Command I00TX*
Stop one or all of the pulse trains from running. This is a controlled stop, in that the Axis will ramp down and not just stop to protect the motors. If you want to use a sudden stop then we recommend a external Emergency Stop button that cuts the power or send a Reset command.Byte1 | Byte 2-3 | Byte 4-5 | Byte 6 |
---|---|---|---|
I | 00 | TX | * |
Stop Axis Reply
The PTHAT will send back a reply when it receives a command and also when it has completed a command.In this case the completed command will be sent back when the Axis that has came to a stop.
If the Command sent ID number was set for bytes 2-3, then this will be returned in the Received reply, but the completed command ID will be from the original ID used in the Start command..
X Stop Received | Y Stop Received | Z Stop Received | E Stop Received | Stop All Received | X Pulse Stopped | Y Pulse Stopped | Z Pulse Stopped | E Pulse Stopped |
---|---|---|---|---|---|---|---|---|
RI00TX* | RI00TY* | RI00TZ* | RI00TE* | RI00TA* | CI00SX* | CI00SY* | CI00SZ* | CI00SE* |
Stop Axis Command Breakdown
Byte | Setting | Description | |
---|---|---|---|
Byte 1 | I=Instant Command B=Buffer Command | Sets command to either Instant or Buffer. | |
Byte 2-3 | 0-99 | Optional Command ID | |
Byte 4-5 | TX= Stop X-Axis TY= Stop Y-Axis TZ= Stop Z-Axis TE= Stop E-Axis TA= Stop All | Sets which Axis is to be stopped | |
Byte 6 | * | End of Command |
Pause/Resume Axis Command I00PX1000*
Pause/Resume one or all of the pulse trains from running.Bytes 6-9 choose to send Pulse count back after pause for each Axis.
Byte1 | Byte 2-3 | Byte 4-5 | Byte 6 | Byte 7 | Byte 8 | Byte 9 | Byte 10 |
---|---|---|---|---|---|---|---|
I | 00 | PX | 1 | 0 | 0 | 0 | * |
Pause/Resume Axis Reply
The PTHAT will send back a reply when it receives a command and also when it has completed a command.If Pulse Count is selected then it will also send back the pulse count of chosen Axis.s.
In this case the completed command will be sent back when the Axis is resumed, after a Pause.
If the Command sent ID number was set for bytes 2-3, then this will be returned in the reply.
X Pause Received | Y Pause Received | Z Pause Received | E Pause Received | Pause All Received | X Resume Received | Y Resume Received | Z Resume Received | E Resume Received | All Resume Received |
---|---|---|---|---|---|---|---|---|---|
RI00PX* | RI00PY* | RI00PZ* | RI00PE* | RI00PA* | CI00PX* | CI00PY* | CI00PZ* | CI00PE* | CI00PA* |
DI00PX* XP(D)XResult* YP(D)YResult* ZP(D)ZResult* EP(D)EResult* | DI00PY* XP(D)XResult* YP(D)YResult* ZP(D)ZResult* EP(D)EResult* | DI00PZ* XP(D)XResult* YP(D)YResult* ZP(D)ZResult* EP(D)EResult* | DI00PE* XP(D)XResult* YP(D)YResult* ZP(D)ZResult* EP(D)EResult* | DI00PX to E* XP(D)XResult* YP(D)YResult* ZP(D)ZResult* EP(D)EResult* | |||||
(D)=Direction of motor travel | (D)=Direction of motor travel | (D)=Direction of motor travel | (D)=Direction of motor travel | (D)=Direction of motor travel | |||||
Result=0000000000-4294967295 | Result=0000000000-4294967295 | Result=0000000000-4294967295 | Result=0000000000-4294967295 | Result=0000000000-4294967295 |
Pause/Resume Axis Command Breakdown
Byte | Setting | Description | |
---|---|---|---|
Byte 1 | I=Instant Command B=Buffer Command | Sets command to either Instant or Buffer. | |
Byte 2-3 | 0-99 | Optional Command ID | |
Byte 4-5 | PX= Pause/Resume X-Axis PY= Pause/Resume Y-Axis PZ= Pause/Resume Z-Axis PE= Pause/Resume E-Axis PA= Pause/Resume All | Sets which Axis is to be Paused/Resumed | |
Byte 6 | 0-1 | Sends back pulse count from Axis if set to 1 with: PA=X-Axis PX=X-Axis PY=Y-Axis PZ=Z-Axis PE=E-Axis | |
Byte 7 | 0-1 | Sends back pulse count from Axis if set to 1 with: PA=Y-Axis Set to 0 for PX, PY,PZ,PE | |
Byte 8 | 0-1> | Sends back pulse count from Axis if set to 1 with: PA=Z-Axis Set to 0 for PX, PY,PZ,PE | |
Byte 9 | 0-1 | Sends back pulse count from Axis if set to 1 with: PA=E-Axis Set to 0 for PX, PY,PZ,PE | |
Byte 6 | * | End of Command |
Request Current Pulse Count Command I00XP*
When this request is sent, it will return of the current pulse count of the running Axis.Byte1 | Byte 2-3 | Byte 4-5 | Byte 6 |
---|---|---|---|
I | 00 | XP | * |
Request Current Pulse Count Reply
The PTHAT will send back a reply when it receives a command and also when it has completed a command.In this case the received command will be sent back along with the Pulse Count and direction that the motor is travelling, then completed command.
If the Command sent ID number was set for bytes 2-3, then this will be returned in the reply.
X Pulse Count Received *Result* | Y Pulse Count Received *Result* | Z Pulse Count Received *Result* | E Pulse Count Received *Result* | X Pulse Count Completed | Y Pulse Count Completed | Z Pulse Count Completed | E Pulse Count Completed |
---|---|---|---|---|---|---|---|
RI00XP* | RI00YP* | RI00ZP* | RI00EP* | CI00XP* | CI00YP* | CI00ZP* | CI00EP* |
XP(D)XResult | YP(D)YResult | ZP(D)ZResult | EP(D)EResult | ||||
(D)=Direction of X motor travel | (D)=Direction of Y motor travel | (D)=Direction of Z motor travel | (D)=Direction of E motor travel | ||||
XResult=0000000000-4294967295 | YResult=0000000000-4294967295 | ZResult=0000000000-4294967295 | EResult=0000000000-4294967295 |
Request Current Pulse Count Command Breakdown
Byte | Setting | Description | |
---|---|---|---|
Byte 1 | I=Instant Command B=Buffer Command | Sets command to either Instant or Buffer. | |
Byte 2-3 | 0-99 | Optional Command ID | |
Byte 4-5 | XP= Pulse Count X-Axis YP= Pulse Count Y-Axis ZP= Pulse Count Z-Axis EP= Pulse Count E-Axis | Request current pulse count for Axis specified | |
Byte 6 | * | End of Command |
Change Axis Speed on the fly Command I00QX001000.000*
This Command changes the speed of each Axis on the fly.A Set Axis Command and a Start Command must be used to set the Axis running before this command can be used.
Byte1 | Byte 2-3 | Byte 4-5 | Byte 6-15 | Byte 16 |
---|---|---|---|---|
I | 00 | QX | 001000.000 | * |
Change Axis Speed on the fly Reply
The PTHAT will send back a reply when it receives a command and also when it has completed a command.If the Command sent ID number was set for bytes 2-3, then this will be returned in the reply.
These can be turned off if needed.
X set Received | Y set Received | Z set Received | E set Received | X set Completed | Y set Completed | Z set Completed | E set Completed |
---|---|---|---|---|---|---|---|
RI00QX* | RI00QY* | RI00QZ* | RI00QE* | CI00QX* | CI00QY* | CI00QZ* | CI00QE* |
Change Axis Speed on the fly Command Breakdown
Byte | Setting | Description | |
---|---|---|---|
Byte 1 | I=Instant Command B=Buffer Command | Sets command to either Instant or Buffer. | |
Byte 2-3 | 0-99 | Optional Command ID | |
Byte 4-5 | QX= Set X-Axis QY= Set Y-Axis QZ= Set Z-Axis QE= Set E-Axis | Sets which Axis is to be set | |
Byte 6-15 | 000000.000-125000.000 | Sets the frequency of the pulse train | |
Byte 16 | * | End of Command |
Enable/Disable Limit Switches I00KX1*
When this request is sent, it will Disable/Enable Limit Switch or Emergency Stop inputs. A reset on the PTHAT will set them to default of DisableByte1 | Byte 2-3 | Byte 4-5 | Byte 6 | Byte 7 |
---|---|---|---|---|
I | 00 | KX | 1 | * |
Enable/Disable Limit Switches Reply
The PTHAT will send back a reply when it receives a command and also when it has completed a command.If the Command sent ID number was set for bytes 2-3, then this will be returned in the reply.
X Limit Received | Y Limit Received | Z Limit Received | E Limit Received | Emergency Stop Received | X Limit Completed | Y Limit Completed | Z Limit Completed | E Limit Completed | Emergency Stop Completed |
---|---|---|---|---|---|---|---|---|---|
R00KX* | R00KY* | R00KZ* | R00KE* | R00KS* | C00KX* | C00KY* | C00KZ* | C00KE* | C00KS* |
Enable/Disable Limit Switches Command Breakdown
Byte | Setting | Description | |
---|---|---|---|
Byte 1 | I=Instant Command B=Buffer Command | Sets command to either Instant or Buffer. | |
Byte 2-3 | 0-99 | Optional Command ID | |
Byte 4-5 | KX= Set Limit Switch X KY= Set Limit Switch Y KZ= Set Limit Switch Z KE= Set Limit Switch E KS= Set Emergency Stop | Set Limit Switch or Emergency Stop Enable/Disable | |
Byte 6 | 0=Disable 1=Enable | Switches selected Limit Switch to Enable/Disable | |
Byte 7 | * | End of Command |
Request IO Port Status Command I00LI*
***Available Firmware V5.3 upwards***When this request is sent, it will return the state of the Emergency Stop input port and each of the Limit Switch input ports. This allows them to be used as general inputs when limits disabled.
Byte1 | Byte 2-3 | Byte 4-5 | Byte 6 |
---|---|---|---|
I | 00 | LI | * |
Request IO Port Status Command Reply
The PTHAT will send back a reply when it receives a command and also when it has completed a command.In this case the received command will be sent back along with the state of the ES/Limit inputs and then completed command.
If the Command sent ID number was set for bytes 2-3, then this will be returned in the reply.
IO Port Status Received *Result* | IO Port Status Completed |
---|---|
RI00LI**Result* | CI00LI* |
*Result* will show as L11111* Bit5=ES input Bit4=X Limit input Bit3=Y Limit input Bit2=Z Limit input Bit1=E Limit input |
Request IO Port Status Command Breakdown
Byte | Setting | Description | |
---|---|---|---|
Byte 1 | I=Instant Command B=Buffer Command | Sets command to either Instant or Buffer. | |
Byte 2-3 | 0-99 | Optional Command ID | |
Byte 4-5 | LI= Port Status | Request current Port Status | |
Byte 6 | * | End of Command |
Request ADC Reading Command I00D1*
When this request is sent, it will return the value of the ADC requested.Byte1 | Byte 2-3 | Byte 4-5 | Byte 6 |
---|---|---|---|
I | 00 | D1 | * |
Request ADC Reading Reply
The PTHAT will send back a reply when it receives a command and also when it has completed a command.In this case the received command will be sent back along with the ADC result and then completed command.
If the Command sent ID number was set for bytes 2-3, then this will be returned in the reply.
ADC1 Received *Result* | ADC2 Received *Result* | ADC1 Completed | ADC2 Completed |
---|---|---|---|
RI00D1**Result* | RI00D2**Result* | CI00D1* | CI00D2* |
Request ADC Reading Command Breakdown
Byte | Setting | Description | |
---|---|---|---|
Byte 1 | I=Instant Command B=Buffer Command | Sets command to either Instant or Buffer. | |
Byte 2-3 | 0-99 | Optional Command ID | |
Byte 4-5 | D1= ADC1 Result D2= ADC2 Result | Request current ADC value | |
Byte 6 | * | End of Command |
Set Aux Output Command I00A10*
When this request is sent, it will switch on/off one of the Aux ports.Byte1 | Byte 2-3 | Byte 4-5 | Byte 6 | Byte 7 |
---|---|---|---|---|
I | 00 | A1 | 1 | * |
Set on/off Aux Output Reply
The PTHAT will send back a reply when it receives a command and also when it has completed a command.If the Command sent ID number was set for bytes 2-3, then this will be returned in the reply.
Aux1 Received | Aux2 Received | Aux3 Received | Aux1 Completed | Aux2 Completed | Aux3 Completed |
---|---|---|---|---|---|
R00A1* | R00A2* | R00A3* | C00A1* | C00A2* | C00A3* |
Set on/off Aux Output Command Breakdown
Byte | Setting | Description | |
---|---|---|---|
Byte 1 | I=Instant Command B=Buffer Command | Sets command to either Instant or Buffer. | |
Byte 2-3 | 0-99 | Optional Command ID | |
Byte 4-5 | A1= Set Aux1 A2= Set Aux2 A3= Set Aux3 | Set Aux port for switching | |
Byte 6 | 0=Off 1=On | Switches selected Aux On or Off | |
Byte 7 | * | End of Command |
Set Wait Delay between commands I00WW1000*
When this request is sent, it causes a wait delay between buffered commands.Typical use is when switching one of the AUX outputs and you want to wait a while for it to complete.
Note this is a wait and will pause the firmware routines, so do not use if a pulse train channel is running.
You can set the Wait period to be in Milliseconds or Microseconds.
Byte1 | Byte 2-3 | Byte 4-5 | Byte 6-9 | Byte 10 |
---|---|---|---|---|
I | 00 | WW | 1000 | * |
Set Wait Delay between commands Reply
The PTHAT will send back a reply when it receives a command and also when it has completed a command.If the Command sent ID number was set for bytes 2-3, then this will be returned in the reply.
Received | Completed |
---|---|
R00WW* | C00WW* |
Set Wait Delay between commands Command Breakdown
Byte | Setting | Description | |
---|---|---|---|
Byte 1 | I=Instant Command B=Buffer Command | Sets command to either Instant or Buffer. | |
Byte 2-3 | 0-99 | Optional Command ID | |
Byte 4-5 | WW=Milliseconds WM=Microseconds | Set Wait Delay in either Milliseconds or Microseconds | |
Byte 6-9 | 0-9999 | Delay in ms so 1000ms=1 second delay Delay is us so 1000us=0.001 of a second | |
Byte 10 | * | End of Command |
Toggle Motor Enable Line I00HT*
Toggles the Motor Enable LineByte1 | Byte 2-3 | Byte 4-5 | Byte 6 |
---|---|---|---|
I | 00 | HT | * |
Toggle Motor Enable Line Reply
The PTHAT will send back a reply when it receives a command and also when it has completed a command.If the Command sent ID number was set for bytes 2-3, then this will be returned in the reply.
Toggle Enable Command Received | Toggle Enable Command Completed |
---|---|
R00HT* | C00HT* |
Toggle Motor Enable Line Breakdown
Byte | Setting | Description | |
---|---|---|---|
Byte 1 | I=Instant Command B=Buffer Command | Sets command to either Instant or Buffer. | |
Byte 2-3 | 0-99 | Optional Command ID | |
Byte 4-5 | HT | Toggle Motor Enable Line On/Off | |
Byte 6 | * | End of Command |
Turn On/Off Received Command Replies I00R1*
Turns on/off the Received Replies.Byte1 | Byte 2-3 | Byte 4-5 | Byte 6 |
---|---|---|---|
I | 00 | R1 | * |
Turn On/Off Received Command Replies Reply
The PTHAT will send back a reply when it receives a command and also when it has completed a command.If the Command sent ID number was set for bytes 2-3, then this will be returned in the reply.
Received Command Replies Turned On Received | Received Command Replies Turned Off Received | Received Command Replies Turned On Completed | Received Command Replies Turned Off Completed |
---|---|---|---|
RI00R1* | RI00R0* | CI00R1* | CI00R0* |
Turn On/Off Received Command Replies Breakdown
Byte | Setting | Description | |
---|---|---|---|
Byte 1 | I=Instant Command B=Buffer Command | Sets command to either Instant or Buffer. | |
Byte 2-3 | 0-99 | Optional Command ID | |
Byte 4-5 | R1= Turn On R0= Turn Off | Turn on/off Received Command Replies | |
Byte 6 | * | End of Command |
Turn On/Off Completed Command Replies I00G1*
Turns on/off the Completed Replies.Byte1 | Byte 2-3 | Byte 4-5 | Byte 6 |
---|---|---|---|
I | 00 | G1 | * |
Turn On/Off Completed Command Replies Reply
The PTHAT will send back a reply when it receives a command and also when it has completed a command.If the Command sent ID number was set for bytes 2-3, then this will be returned in the reply.
Completed Replies Turned On Received | Completed Replies Turned Off Received | Completed Replies Turned On Completed | Completed Replies Turned Off Completed |
---|---|---|---|
RI00G1* | RI00G0* | CI00G1* | CI00G0* |
Turn On/Off Completed Command Replies Breakdown
Byte | Setting | Description | |
---|---|---|---|
Byte 1 | I=Instant Command B=Buffer Command | Sets command to either Instant or Buffer. | |
Byte 2-3 | 0-99 | Optional Command ID | |
Byte 4-5 | G1= Turn On G0= Turn Off | Turn on/off Completed Command Replies | |
Byte 6 | * | End of Command |
Request Firmware Version I00FW*
Requests the Firmware Version from the PTHATByte1 | Byte 2-3 | Byte 4-5 | Byte 6 |
---|---|---|---|
I | 00 | FW | * |
Request Firmware Version Reply
The PTHAT will send back a reply when it receives a command and also when it has completed a command.If the Command sent ID number was set for bytes 2-3, then this will be returned in the reply.
Firmware Command Received *Version* | Firmware Command Completed |
---|---|
RI00FW**Version* | CI00FW* |
Request Firmware Version Breakdown
Byte | Setting | Description | |
---|---|---|---|
Byte 1 | I=Instant Command B=Buffer Command | Sets command to either Instant or Buffer. | |
Byte 2-3 | 0-99 | Optional Command ID | |
Byte 4-5 | FW | Request Firmware | |
Byte 6 | * | End of Command |
Reset PTHAT N*
Resets the PTHAT back to turn on state and resets all pulse generators.Can be used in an emergency to close everything down and stop the pulse trains.
Byte1 | Byte 2 |
---|---|
N | * |
Reset PTHAT Reply
There is no reply when sending this command.Reset Command Received | Reset Command Completed |
---|---|
Nothing | Nothing |
Reset PTHAT Command Breakdown
Byte | Setting | Description | |
---|---|---|---|
Byte 1 | N | Sends a Reset to the PTHAT | |
Byte 2 | * | End of Command |
⊕Pulse Width Modulation Commands.
From Firmware V5.3 onwards we have added commands for controlling two dedicated PWM channels.
Feel free to check the Pulse Width Modulation page for an overview.
Set PWM Channel Command I00UX000005002500*
***Available Firmware V5.3 upwards***This Command sets the Frequency and Pulse Width for the desired channel.
It then also starts it.
Byte1 | Byte 2-3 | Byte 4-5 | Byte 6-12 | Byte 13-17 | Byte 18 |
---|---|---|---|---|---|
I | 00 | UX | 0000000 | 00000 | * |
Set PWM Channel Command Reply
The PTHAT will send back a reply when it receives a command and also when it has completed a command.If the Command sent ID number was set for bytes 2-3, then this will be returned in the reply.
These can be turned off if needed.
X set Received | Y set Received | X set Completed | Y set Completed |
---|---|---|---|
RI00UX* | RI00UY* | CI00UX* | CI00UY* |
Set PWM Channel Command Breakdown
Byte | Setting | Description | |
---|---|---|---|
Byte 1 | I=Instant Command B=Buffer Command | Sets command to either Instant or Buffer. | |
Byte 2-3 | 0-99 | Optional Command ID | |
Byte 4-5 | UX= Set X-Axis UY= Set Y-Axis | Sets which Axis is to be set | |
Byte 6-12 | 0000000-1000000 | Sets the Frequency for the channel in 1Hz steps | |
Byte 14-17 | 00000 | Sets the Duty Cycle 0-100% The last 2 digits are decimal places. So 08050 would be 80.5% | |
Byte 18 | * | End of Command |
Set Both PWM Channels Command I00UA000005002500000005002500*
***Available Firmware V5.3 upwards***This Command sets the Frequency and Pulse Width for both channels at the same time.
It then also starts both together.
Byte1 | Byte 2-3 | Byte 4-5 | Byte 6-12 | Byte 13-17 | Byte 18-24 | Byte 25-29 | Byte 30 |
---|---|---|---|---|---|---|---|
I | 00 | UX | 0000000 | 00000 | 0000000 | 00000 | * |
Set Both PWM Channels Command Reply
The PTHAT will send back a reply when it receives a command and also when it has completed a command.If the Command sent ID number was set for bytes 2-3, then this will be returned in the reply.
These can be turned off if needed.
Set both PWM channels Received | Set both PWM channels Completed |
---|---|
RI00UA* | CI00UA* |
Set Both PWM Channels Command Breakdown
Byte | Setting | Description | |
---|---|---|---|
Byte 1 | I=Instant Command B=Buffer Command | Sets command to either Instant or Buffer. | |
Byte 2-3 | 0-99 | Optional Command ID | |
Byte 4-5 | UA= Set X-Axis and Y-Axis | Sets both X-Axis and Y-Axis settings | |
Byte 6-12 | 0000000-1000000 | Sets the Frequency for the channel in 1Hz steps for X-Axis | |
Byte 14-17 | 00000 | Sets the Duty Cycle 0-100% for X-Axis The last 2 digits are decimal places. So 08050 would be 80.5% | |
Byte 18-24 | 0000000-1000000 | Sets the Frequency for the channel in 1Hz steps for Y-Axis | |
Byte 25-29 | 00000 | Sets the Duty Cycle 0-100% for Y-Axis The last 2 digits are decimal places. So 08050 would be 80.5% | |
Byte 30 | * | End of Command |
⊕Buffering Instant Commands.
With all the Instant commands you can also send as buffered commands, but you will need to use a couple of extra commands to initiate the buffer first using the H0000* command.
Next you would need to decide how many commands you would like to store in the buffer (up to a maximum of 100 commands) before sending a Buffer Start command Z0000*.
With the release of Firmware V5.3 upwards you can now store 2000 commands in the buffer.
Buffering commands allow you to queue up your commands, so they execute one after the other and reduce latency between commands being executed.
Instant commands apart from the Stop command cannot be sent while sending Buffered commands.
We recommend to buffer around 20 commands before sending a Buffer Start command and then to send a new command when you get the Complete Reply back, until all your commands have been sent.
When all commands have been executed from the buffer you will get a **Buffer Empty** Reply come back and you will have to Initiate the buffer again to start.
Initiate the buffer H0000*
Initiate the buffer before sending any buffered commands.Byte1 | Byte 2-5 | Byte 6 |
---|---|---|
H | 0000 | * |
Initiate Buffer Reply
The PTHAT will send back a reply when it receives this command.Initiate Buffer Command Received |
---|
RBH000* |
Initiate Buffer Breakdown
Byte | Setting | Description | |
---|---|---|---|
Byte 1 | H | ||
Byte 2-5 | 0000 | ||
Byte 6 | * | End of Command |
Buffer Start command Z0000*
Start executing buffered commands.Byte1 | Byte 2-5 | Byte 6 |
---|---|---|
Z | 0000 | * |
Buffer Start command Reply
The PTHAT will send back a reply when it receives a command.Initiate Buffer Command Received |
---|
RBZ000* |
Buffer Start command Breakdown
Byte | Setting | Description | |
---|---|---|---|
Byte 1 | Z | ||
Byte 2-5 | 0000 | ||
Byte 6 | * | End of Command |
Buffer Loop Start command W0000*
***Available Firmware V5.3 upwards***Start executing buffered commands.
With this command it will run through the buffered commands and when it gets to the last, it will go back to the first command and repeat all commands in a loop until a Stop command is sent.
Byte1 | Byte 2-5 | Byte 6 |
---|---|---|
W | 0000 | * |
Buffer Loop Start command Reply
The PTHAT will send back a reply when it receives a command.Initiate Buffer Command Received |
---|
RBW000* |
Buffer Loop Start command Breakdown
Byte | Setting | Description | |
---|---|---|---|
Byte 1 | W | ||
Byte 2-5 | 0000 | ||
Byte 6 | * | End of Command |
⊕RAW Buffered Commands
⊕ At the moment the Raw Buffered command mode is still being developed and we will release a new firmware and software examples when complete.
These commands and firmware routines are being designed to speed up communications and allow for higher speeds with no latency when sending thousands of small movement commands.
We did hope to have this finished before release, but it is taking much longer than anticipated.
If you are purchasing the PTHAT for this feature, then please wait until it is released before purchasing as we cannot put a time frame on the delivery of this feature at this point in time.
Closer look at the PCB's
PTHAT Mainboard
- Single Channel Main Board.
- JTAG Programmer.
- Set of Mounting Spacers and Bolts.
PTHAT Add on Board
- Expansion Add on Board.
- Increases the PTHAT to 4 channels.
- Extra I/O Functionality.
- Set of Mounting Spacers.
PTHAT Full Package
- Single Channel Main Board.
- Expansion Add on Board.
- Increases the PTHAT to 4 channels.
- Extra I/O Functionality.
- JTAG Programmer.
- Set of Mounting Spacers and Bolts.
- Save £10 with this Package