Serial Interface

Introduction

Fenix Autopilot can be connected to a Laptop/PC via USB port. This provides access to all user functions available to calibrate compass and linear actuator. Also provides full capabilities to customize installation settings and pilot gain.

Requirements

Checksum

In order to generate $PEMC messages to be accepted by Fenix Autopilot, a checksum code shall be annexed after * symbol.

Serial I/F examples in this User Guide represent Checksum code as xx. To use these examples you should substitute xx by the calculated Checksum value.

Serial I/F Example: $PEMC,00*xx

Serial I/F Valid Sentence: $PEMC,00*37

In this link you will find an online Checksum calculator

Set messages: 04 and 06

To keep same value of a parameter while changing others, omit any value while keeping the commas in place.

To set Ki value while keeping Kp and Kd: $PEMC,06,,0.3,,,m*xx

Fenix V0.1 bug: Message 06, always include m, M or A deadband value or system will change to M.

$PEMC Message

Field

Value

Function

Additional Field

Sentence

1

00

Switch working mode from STAND BY to AUTO

N/A

$PEMC,00*37

1

01

Change Current Rudder

2: Change rate

$PEMC,01,r*68

1

02

Change CTS (Current Target Steering)

2: Change rate

$PEMC,02,i*70

1

03

Get Installation Parameters

2: Installation Parameters

$PEMC,03,2,45,5,S,2,-3.2,-32.9,10*xx

1

04

Set Installation Parameters

2: Installation Parameters

$PEMC,04,2,40,4,S,3,4.1,33.9,9*xx

1

05

Get PID gain (incl. sample time and deadband)

2: PID Gain

$PEMC,05,2,0.01,0.5,100,A*xx

1

06

Set PID gain (inc. sample time and deadband)

2: PID Gain

$PEMC,06,3,0.11,0.7,100,m*xx

1

07

Get Autopilot information

2: APinfo

$PEMC,07,S,12,35.60,30.02,2,-0.50*65

1

08

Request information

2: 'I' Request Installation Parameters (message $PEMC,03)

2: 'G' Request Gain (message $PEMC,05)

2: 'A' Request Autopilot info. (message $PEMC,07)

$PEMC,08,I*5A

$PEMC,08,G*54

$PEMC,08,A*52

1

09

Enter/ Exit into IMU Calibration mode

N/A

$PEMC,09*3E

1

10

Enter/ Exit Feedback Calibration mode

N/A

$PEMC,10*36

1

11

Save values

2: 'I' Save Installation and current Feedback Parameters

2: 'G' Save current PID Gain parameters

2: 'C' Save current IMU Offsets

2: 'R' Restore Inst.Param, Feedback and PID Gain to hardcoded values

$PEMC,11,I*52

$PEMC,11,G*5C

$PEMC,11,C*58

$PEMC,11,R*49

1

12

IMU Cal.Mode values

Cal.Mode values

$PEMC,12,

Additional Field: Change rate

Field

Value

Function

Additional Field

n

'i'

Increment Current by 1 Position Unit

N/A

n

'I'

Increment Current by 10 Position Unit

N/A

n

'r'

Reduce Current by 1 Position Unit

N/A

n

'R'

Reduce Current by 10 Position Uni

N/A

Additional Field: Installation Parameters

Field

Value

Function

Additional Field

n

Integer

Centered Tiller Position

N/A

n+1

Positive Int

Maximum rudder angle

N/A

n+2

Positive Int

Average Cruise Speed

N/A

n+3

'S'

Installation Side: Starboard

N/A

n+3

'P'

Installation Side: Portboard

N/A

n+4

Positive Int

Rudder Damping

N/A

n+5

Float

Magnetic Variation

N/A

n+6

Float

Heading Alignment

N/A

n+7

Positive Int

Off course alarm angle

N/A

Additional Field: PID Gain

Field

Value

Function

Additional Field

n

Float

Kp

N/A

n+1

Float

Ki

N/A

n+2

Float

Kd

N/A

n+3

unsigned long

Sample Time (mSec)

N/A

n+4

'm'

Deadband: Min

N/A

n+4

'M'

Deadband: Max

N/A

n+4

'A'

Deadband: Auto

N/A

Additional Field: APinfo

Field

Value

Function

Additional Field

n

'S'

STAND-BY Mode

N/A

n

'A'

AUTO Mode

N/A

n

'T'

TRACK Mode

N/A

n

'C'

Calibration Mode (IMU or Feedback)

N/A

n+1

Integer

Current Rudder

N/A

n+2

Float

Heading Magnetic (HDM) - Magnitude (M)

N/A

n+3

Float

Course To Steer (CTS) - Magnitude (M)

N/A

n+4

Positive int

Deadband value

N/A

n+5

Float

Trimming value

N/A

Additional Field: IMU Cal. values

Field

Value

Function

Additional Field

n

'-'

Calib. Not started

N/A

n

'O'

Calib. Ongoing

N/A

n

'R'

Recalibrated

N/A

n

'N'

Not calibrated

N/A

n

'C'

Check ongoing

N/A

n+1

1:OK/ 0:NOK

Sys status. Ony valid when Calib is ongoing

N/A

n+2

1:OK/ 0:NOK

Gyro status. Ony valid when Calib is ongoing

N/A

n+3

1:OK/ 0:NOK

Accel status. Ony valid when Calib is ongoing

N/A

n+4

1:OK/ 0:NOK

Magn status. Ony valid when Calib is ongoing

N/A

n+5

Int (0, 360)

X euler angle.

Ony valid when Check is ongoing

N/A

n+6

Int (-180, 180)

Y euler angle.

Ony valid when Check is ongoing

N/A

n+7

Int (0, 90)

Z euler angle.

Ony valid when Check is ongoing

N/A

Additional Field: IMU Cal. values

Field

Value

Function

Additional Field

n

'-'

Calib. Not started

N/A

n

OpenCPN NMEA I/F

OpenCPN integrates GPS and plotter capabilities to provide user with all required means to define a route and send it to Fenix Autopilot. OpenCPN is required for Nav mode.

Fenix and OpenCPN implements NMEA I/F in both directions

Data sent by OpenCPN to Fenix Autopilot in ALL working modes from different sources:

  • External Compass (only in External Compass mode):

Message: $HDM - Heading Magnetic

Features below are not available in V2.x

  • Windvane and calculations

  • GPS Fix

  • Speed Log

Data sent by OpenCPN to Fenix Autopilot in NAV Mode:

Message: $APB - Autopilot Sentence "B"

  • Route

    • Waypoint ID

    • Course To Steer to Next Waypoint (CTS) - Magnetic angle

    • Cross Track Error (XTE)

    • Arrival Circle Alarm

    • Perpendicular Circle Alarm

Feature available with limitations in V0.1: Only APB message decoded.

Data sent from Fenix Autopilot to OpenCPN in ALL working modes:

Internal compass (in Internal Compass Mode only):

Message: $HDM - Heading Magnetic

Message: $HDT - Heading True

Rudder position

Message: $RSA - Rudder Sensor Angle