EtherDrive Motor Control System V2.0

Written by Pascal Stang | Updated: Friday March 17, 2006

Overview:

The EtherDrive Motor Controller is a multi-axis ethernet-based motor controller and driver system. It consists of controller and driver PCBs which operate together. A single controller may drive up to 6 motors (3 dual-channel driver cards, or 1 six-channel driver card).

System Level Features for V2.0:


EtherDrive Controller V2.0
(Click for larger image)


EtherDrive Dual Driver V2.0 (two channel)
(click for larger image)

Harware Features

  • LPC2214 32-bit ARM processor @ 60MHz
  • 10/100Mb/s ethernet interface
  • Dual RS-232 serial communication interface
  • 6-axis motor control
    • 6 Quadrature encoder counters
    • 6 Programmable motor control PWM outputs (sign-magnitude or locked-antiphase mode)
    • 6 Differential current-sensing inputs
      -12-bit A/D, up to 10KHz per channel
  • Encoder connectors support std. Agilent HEDS 5-pin pinout or US Digital mini 4-pin pinout.
  • Emergency stop connector (4-pin molex)
  • 8-channel 10-bit A/D general-purpose inputs
  • EEPROM for non-volatile storage of system, network, and motor control parameters.
  • Power input via DC jack or from driver boards.
  • LED indicators
    • Ethernet Link and Activity Status
    • 4 System Status LEDs
    • Power LED.
  • Board Size: 5.0" x 3.0" x 0.7" (LxWxH)

Hardware Features

  • Dual-channel high-current motor driver
    (drives 2 DC motors).
  • Discrete MOSFET driver stage
    • 50V max motor voltage.
    • 20A/channel rated current.
    • 40A/channel peak current.
    • Integrated surge and spike protection
  • 4-quadrant differential current-sensing outputs
  • Digital Logic Inputs:
    • 3 digital control signals per motor.
    • May be configured for sign-magnitude or locked-antiphase (four-quadrant) drive.
    • PWM frequencies up to 250KHz
    • 5V and 3.3V logic compatible.
  • LED indicators:
    • Bi-color motor drive LEDs.
    • Power LED.
  • On-board 12V regulator for drive electronics.
  • Auto-shutdown when controller is turned off.
  • Board Size: 5.0" x 3.0" x 1.1" (LxWxH)

Software/Firmware Features and Operation:

Network Protocol Information:

Information as of 7/14/2006.

Network Addressing and Support Details

Notes
Supported protocols UDP, ICMP (ping), IP, ARP Unit will respond to pings to IP address. No TCP support at this time. ARP table currently limited to 8 entries.
IP Address (default) 192.168.1.12 User-changable via serial port interactive terminal. User set value is non-volatile, stored in EEPROM.
Netmask (fixed) 255.255.255.0 User-changable, non-volatile setting.
Gateway (fixed) 192.168.1.1 User-changable, non-volatile setting.

Network Active Port Details

Notes

Echo

7/UDP

UDP Echo port. Packets sent to this port will be echoed to sender, payload unmodified.
Motor Control port 4900/UDP

Motor drive and feedback values passed via UDP packets on this port. See protocol info below.

EtherDrive Command port

4950/UDP Configuration and instruction packets should be sent to this port. See protocol info below.

EtherDrive UART0 port

4960/UDP Packets sent here will be relayed via UART0.

EtherDrive UART1 port

4961/UDP Packets sent here will be relayed via UART1.

 

Motor Drive Command Format (send to Motor Control port)

Notes

Description

Byte Offset

Byte Length

Data Type
This packet is sent by the controlling host
Motor 1 Drive
0
4
signed int32

Drive command of zero indicates no net power to motor. Valid range and units of drive command depends upon control mode. If using direct PWM:

  • In Locked-Antiphase mode, range is +/-(PWM period/2)
  • In Sign-Magnitude mode, range is +/-PWM period

Drive levels in excess of the linear range will be clamped at the extreme.

Motor 2 Drive
4
4
signed int32
Motor 3 Drive
8
4
signed int32
Motor 4 Drive
12
4
signed int32
Motor 5 Drive
16
4
signed int32
Motor 6 Drive
20
4
signed int32

Motor Feedback Format (received from Motor Control port)

Notes

Description

Byte Offset

Byte Length

Data Type
This packet is sent back to the host in response to a Motor Drive Command
Encoder 1 Position
0
4
signed int32
Encoder position feedback is read and refreshed for each motor feedback packet sent. Value indicated number of tics counted since last reset. Value will overflow in standard 2's-complement form upon reaching +/-2^31.
Encoder 2 Position
4
4
signed int32
Encoder 3 Position
8
4
signed int32
Encoder 4 Position

12

4
signed int32
Encoder 5 Position
16
4
signed int32
Encoder 6 Position
20
4
signed int32
Motor 1 Current
24
4
signed int32

Motor current values represent the latest available values at time of packet transmission. Value range is +/-2048. Current readings may only be accurate in locked-antiphase mode.

Value = (Imotor*Rsense*Gain*2048) / Vref

Imotor = (Value*Vref) / (Rsense*Gain*2048)

where Gain is the A/D converter Gain setting = 1,2,4,5,8,10,20x
and Vref is the A/D converter reference = 2.048V default
and Imotor is in [AMPS]
and Rsense is in [OHMS]

Motor 2 Current
28
4
signed int32
Motor 3 Current
32
4
signed int32
Motor 4 Current
36
4
signed int32
Motor 5 Current
40
4
signed int32
Motor 6 Current
44
4
signed int32
Motor 1 PWM
48
4
signed int32

Motor PWM values are those applied to the motor by the control algorithm that is currently in use.

Motor 2 PWM
52
4
signed int32
Motor 3 PWM
56
4
signed int32
Motor 4 PWM
60
4
signed int32
Motor 5 PWM
64
4
signed int32
Motor 6 PWM
68
4
signed int32

 

EtherDrive Command/Reply Format (sent to/from ED Command port)

Notes

Description

Byte Offset

Byte Length

Data Type
 
Command
0
4
signed int32

An EtherDrive command can be issued to change the way the EtherDrive system is configured or operating. A reply is returned for each command issued. The reply will be identical the command, but may have argument values changed to reflect the response or result of the command.

NOTE: Processing of commands may interrupt closed-loop motor operation and should not be issued during critical motion control. It is recommended that motors be stopped before sending most commands.

Argument 0
4
4
signed int32
Argument 1
8
4
signed int32
Argument 2
12
4
signed int32
...
...
Argument N
4*N
4
signed int32

 

EtherDrive Motor Controller Commands

Notes

General and Test Commands

 

Description

Cmd

Arg0

Arg1
 
Help
'?'
.
.

Print commands to terminal

Encoder Monitor Test
'e'
.
.

Prints encoder values to terminal.

Current Monitor Test
'a'
.
.

Prints current-feedback values to terminal.

Config Commands

 
List Config
'l'
.
.

Prints currently active configuration to terminal.

Read Config
'r'
.
.

Loads the configuration stored in EEPROM and makes it current.

Write Config
'w'
.
.

Writes the current configuration to EEPROM.

Revert Config
'R'
.
.

Reverts all settings to factory defaults.

Network Commands

 
Ethernet MAC Status
'd'
.
.

Prints Ethernet MAC state for debug.

Ethernet PHY Status
'q'
.
.

Prints Ethernet PHY state for debug.

Send UDP packet
'u'
string
.

Sends broadcast UDP packet on command port with user-entered string as payload.

Set IP address
'n'
IP
.

Set EtherDrive Controller IP address, IP=XXX.XXX.XXX.XXX

Set IP address
's'
IP
.

Set EtherDrive Controller subnet mask.

Set IP address
'o'
IP
.

Set ErherDrive Controller gateway address.

Generate MAC addr
'H'
.
.

Auto-generates semi-random ethernet MAC address. Each controller must have a unique MAC address to function together on a network.

Set network motor-drive timeout
'T'
time [ms]
.

Sets the timeout between loss of motor drive communication and automatic disabling of the motors. If network-based motor drive communication begins but is interrupted for more than <time> milliseconds, the motors will be automatically disabled.

Motor Commands

 
Drive Motor
'g'
motor#
P

Drives the selected motor to drive power P. If a control mode is enbles, this input is passed as the input to the control law.

Enable/Disable Motors
'm'
mode
.

mode=0: Motor drivers OFF (open-circuit)
mode=1: Motor dirvers ON

PWM Mode
'p'
mode
.
mode=0: Locked-Antiphase PWM
mode=1: Sign-Mangitude PWM
PWM Period
't'
period [tics]
.
Period is specified in tics (1 tic = 20ns*2^N). Maximum period is 4095 tics. Periods less than 10us may not function correctly in current-control mode.
PWM Prescaler
'v'
N
.
Divides the PWM rate by 2^N. Default is N=0, or no division.
Current-Sense ADC Mode
'B'
mode
.

Set the motor current-sense ADC to the proper mode for the type of feedback:
mode=0: Current feedback signal is bipolar
mode=1: Current feedback signal is unipolar

Current-Sense ADC Gain

'G'
gain-idx
.

Set the motor current-sense ADC gain:
gainidx=0: ADC gain = 1x (recommended for 6-ch driver)
gainidx=1: ADC gain = 2x
gainidx=2: ADC gain = 4x
gainidx=3: ADC gain = 5x
gainidx=4: ADC gain = 8x
gainidx=5: ADC gain = 10x (recommended for 2-ch driver)
gainidx=6: ADC gain = 16x
gainidx=7: ADC gain = 20x

Control Mode
'i'
mode
.
mode=0: Disable, command voltage directly
mode=1: Enable, command motor current
mode=2: Enable, command motor position

PID Controller Settings

 
Set Proportional Gain
'P'
motor#
Kp
Sets the Proportional gain for the selected motor [units TBD]
Set Integral Gain
'I'

motor#

Ki

Sets the Integral gain for the selected motor [units TBD]

Set Derivative Gain
'D'
motor#
Kd
Sets the Derivative gain for the selected motor [units TBD]
Integral Windup Max
'W'
motor#
k
Sets the value limit on the PID integral error term [units TBD]
PID Output Max/Clamp
'M'

motor#

k

Sets the maximum output magnitude of the PID controller. Outputs greater than this will be clamped.

PID Output Deadzone
'Z'
motor#
k
Sets the PWM output magnitude below which the PID output will be clamped to zero.

I/O Commands

 
Read Aux ADC
'A'
ch#
.
Reads the voltage on the requested channel of the aux ADC (JP19). Results are 0-1023 over a range of 0-3.3V.
Set Aux I/O Port Dir
'C'
bitval
.
Sets the in/out direction of the aux I/O port pins (JP19). Each of the 8 pins are individually configurable, and correspond to the 8-bits in the bitval argument. For each pin, a '0' bit indicates input and a '1' bit indicates output.
Set Aux I/O Port Out
'O'
bitval
.
Sets the output value of the aux I/O port pins (JP19). Each of the 8 pins are individually set by the corresponding bit of the 8-bit bitval argument. For each pin, a '0' bit indicates output 0V and a '1' bit indicates output 3.3V.
This command list is subject to change.

 

Available to current customers via support site:


Written by Pascal Stang | Updated: Friday March 17, 2006