MCT U.I. Driver Reference Manual Motor Control Technologies; LLC

Similar documents
Arduino Microcontroller Processing for Everyone!: Third Edition / Steven F. Barrett

Activity 4: Due before the lab during the week of Feb

MD03-50Volt 20Amp H Bridge Motor Drive

MD04-24Volt 20Amp H Bridge Motor Drive

Stensat Transmitter Module

DeviceNet for Penning Gauges

Citrus Circuits Fall Workshop Series. Roborio and Sensors. Paul Ngo and Ellie Hass

GNSS 5 click PID: MIKROE Weight: 30 g

AC Current click PID: MIKROE Weight: 27 g

Training Schedule. Robotic System Design using Arduino Platform

DI-1100 USB Data Acquisition (DAQ) System Communication Protocol

LED Driver 5 click. PID: MIKROE 3297 Weight: 25 g

EVDP610 IXDP610 Digital PWM Controller IC Evaluation Board

RIGOL. User s Guide. DS6000 Digital Oscilloscope Demo Board. July RIGOL Technologies, Inc.

Designing with STM32F3x

Debugging a Boundary-Scan I 2 C Script Test with the BusPro - I and I2C Exerciser Software: A Case Study

ZKit-51-RD2, 8051 Development Kit

Trademarks & Copyright

Lab 3: Embedded Systems

RGB Driver click. PID: MIKROE 3078 Weight: 28 g

The PmodIA is an impedance analyzer built around the Analog Devices AD bit Impedance Converter Network Analyzer.

I 2 C RedBot & DC Motor Servo Motor Control

TC4 Shield Version 6.02

Overview. Figure 2. Figure 1. Doc: page 1 of 5. Revision: July 24, Henley Court Pullman, WA (509) Voice and Fax

µchameleon 2 User s Manual

Servo click. PID: MIKROE 3133 Weight: 32 g

CT435. PC Board Mount Temperature Controller

Catalogue

Brushless 5 click. PID: MIKROE 3032 Weight: 25 g

MICROWAVE FREQUENCY SYNTHESIZER QP-FSPLL USER MANUAL

SD Diff Channels ADC SOC with RTC and 24*4 LCD

MTY (81)

Application Note 160 Using the DS1808 in Audio Applications

3.3V regulator. JA H-bridge. Doc: page 1 of 7

Roland Kammerer. 13. October 2010

LoRa1276 Catalogue

The rangefinder can be configured using an I2C machine interface. Settings control the

DALI slave, one to four channels PWM and I2C output

EE 314 Spring 2003 Microprocessor Systems

2F. No.25, Industry E. 9 th Rd., Science-Based Industrial Park, Hsinchu, Taiwan Application Note of OGM220, AN001 V1.8

Hardware Platforms and Sensors

Jaguar Motor Controller (Stellaris Brushed DC Motor Control Module with CAN)

6. HARDWARE PROTOTYPE AND EXPERIMENTAL RESULTS

MTS2500 Synthesizer Pinout and Functions

Specifications.

ACPL Data Sheet. Three-Channel Digital Filter for Sigma-Delta Modulators. Description. Features. Specifications.

NF1011 Frequency Translator and Jitter Attenuator

QUICK START GUIDE FOR DEMONSTRATION CIRCUIT 1339 LOW NOISE, 500KSPS, 12-BIT ADC

USB4. Encoder Data Acquisition USB Device Page 1 of 8. Description. Features

DESCRIPTION DOCUMENT FOR WiFi <-> RS485 <-> LoRa DEVICE BOARD HARDWARE REVISION 0.1

Beyond-the-Rails 8 x SPST

Electronic Control Automotive for Proportional Valves 4 Solenoid

DRF1278F 20dBm LoRa Long Range RF Front-end Module V1.11

Castle Creations, INC.

LCC-10 Product manual

Embedded Test System. Design and Implementation of Digital to Analog Converter. TEAM BIG HERO 3 John Sopczynski Karim Shik-Khahil Yanzhe Zhao

Catalogue

AN1730. Digital Amplification Control of an Analog Signal Using the MC68HC705J1A. Introduction

LAX016 Series Logic Analyzer User Guide

GNSS 5 click PID: MIKROE-2670

Exercise 3: Sound volume robot

Variateur analogique courant continu série AZ et AZB

BV4112. Serial Micro stepping Motor Controller. Product specification. Dec V0.a. ByVac Page 1 of 18

Application Note Using MagAlpha Devices to Replace Optical Encoders

ILI2117 Capacitive Touch Controller

Single-wire Signal Aggregation Reference Design

RB-Dev-03 Devantech CMPS03 Magnetic Compass Module

SPEED CONTROL OF DC MOTOR USING PWM TECHNIQUE

Channels that are not occupied by temperature sensors, can take over alternative functions:

Lab 23 Microcomputer-Based Motor Controller

DYN2 Series D M M AC SERVO DRIVE LOW VOLTAGE TYPE A - GENERAL PURPOSE PULSE/ANALOG. Dynamic Motor Motion Technology Corporation

Development of a MATLAB Data Acquisition and Control Toolbox for BASIC Stamp Microcontrollers

EECS 192: Mechatronics Design Lab

Brushed DC Motor Control. Module with CAN (MDL-BDC24)

RW1026 Dot Matrix 48x4 LCD Controller / Driver

MTY (81)

Peripheral Link Driver for ADSP In Embedded Control Application

Carbon Dioxide (Tiny CO2) Gas Sensor. Rev TG400 User Manual

DNT24MCA DNT24MPA. Low Cost 2.4 GHz FHSS Transceiver Modules with I/O. DNT24MCA/MPA Absolute Maximum Ratings. DNT24MCA/MPA Electrical Characteristics

Green Electronics Library Documentation

Using Z8 Encore! XP MCU for RMS Calculation

EMG click PID: MIKROE-2621

DATASHEET. X-band Transmitter

Tarocco Closed Loop Motor Controller

DS1803 Addressable Dual Digital Potentiometer

Series SPPM2 Graphical User Interface Panel Meter. Specifications - Installation and Operating Instructions MINI USB PORT

SPI Slave to PWM Generation

2.017 DESIGN OF ELECTROMECHANICAL ROBOTIC SYSTEMS Fall 2009 Lab 4: Motor Control. October 5, 2009 Dr. Harrison H. Chin

Laser Marking Cards and Laser Marking Software

TABLE OF CONTENTS. FT5x06 DATASHEET 1 OVERVIEW TYPICAL APPLICATIONS FUNCTIONAL DESCRIPTION... 1

CHAPTER 7 HARDWARE IMPLEMENTATION

M051 Series BSP Directory

Pin Assignment SEG28 SEG29 SEG30 SEG31 SEG32 SEG33 SEG34 SEG35 SEG36 SEG37 SEG38 VDD SDA SCL COM0 COM1 COM2 COM3 COM4 COM5 COM6 COM

RoHS compliant 1310 nm Multi-mode Transceiver (2km) Small Form Pluggable (SFP), 3.3V 155 Mbps ATM/125 Mbps Fast Ethernet. Features.

PIC-SERVO SC (v.10) Servo Motion Control I.C.

Relay 3 Click. PID: MIKROE 3357 Weight: 42 g

Features: Phase A Phase B Phase C -DC_A -DC_B -DC_C

PC-based controller for Mechatronics System

CDR-915 Data Radio Module INTEGRATOR S GUIDE

F i n i s a r. Product Specification CWDM GBIC Transceiver with APD Receiver FTL-1619-XX

Transcription:

MCT U.I. Driver Reference Manual Motor Control Technologies; LLC www.mocontech.com 1. The MCTUI Driver...2 2. MCT Hardware Methods...2 2.1.1. BuildDataPacket()...2 3. Third Party Hardware Methods...5 3.1. LabJack Data Acquisition Hardware...5 3.1.1. LJAnalogOut()...5 3.1.2. LJComConfig()...5 3.1.3. LJConnect()...6 3.1.4. LJCurrent()...7 3.1.5. LJDigLine()...8 3.1.6. LJPWMConfig()...9 3.1.7. LJPWMUpdate()...10 3.1.8. LJSendData()...10 4. Utility Methods...11 4.1.1. Hex2Float()...11 4.1.2. Float2Hex()...12 5. Revision History...12 February, 2011 Rev 1.0 Page 1 of 12

1. The MCTUI Driver The MCTUI Driver is high-level interface built on Microsoft s.net framework. It is designed to ease software development by providing a standardized set of tools for interfacing with MCT hardware. The MCTUI handles all low-level function calls and formatting, exposing a simple set of methods for controlling our motor drives. Figure 1 depicts a block diagram for the MCTUI driver. 2. MCT Hardware Methods Figure 1. MCTUI.dll block diagram. 2.1.1. BuildDataPacket() Constructs data packets used to communicate with MCT hardware. BuildDataPacket converts double precision user data into a properly formatted multi-byte data packet. void BuildDataPacket(byte MCTDevice, ref byte ArraySize, double[ ] UserData, byte[ ] XmitData) MCTDevice MCT Hardware device descriptor. 0 = DCA-10 1 = IDCA-10 ArraySize Number of populated elements in the UserData array. UserData Double precision data array containing data for transmission. See below for various method formats. User data packets are further defined in section 2.1.1.1. XmitData Data array to store transmission packet. XmitData must be at least 50 elements to store all returned data. February, 2011 Rev 1.0 Page 2 of 12

ArraySize Number of populated elements in the XmitData array. XmitData n-element data array formatted for MCT hardware. The XmitDAta array is automatically formatted for the device specified in the MCTDevice variable. The data packet CRC value is automatically appended to the last two data elements. 2.1.1.1. User Data Packet Definitions Access Flash (3 Elements) Element 0 Device address (0-127) Element 3 Flash Option (see product documentation) Configure IDCA-10 (15 Elements) Element 0 Device address Element 2 Mode value Element 3 Bridge configuration value Element 4 Duty cycle Element 5 Frequency scale factor Element 6 PID period Element 7 Encoder resolution (counts / revolution) Element 8 Kp Element 9 Ki Element 10 Kd Element 11 Dead-band Element 12 Approach speed Element 13 Maximum speed Element 14 Encoder scale value Retrieve Log Data (3 Elements) Element 0 Device address (0-127) Element 2 Log data subset (see product documentation) Read Memory Registers(8) Element 0 Device address Element 2 Register Count (1-5) Element 3 Register 1 Address Element 4 Register 2 Address Element 5 Register 3 Address Element 6 Register 4 Address Element 7 Register 5 Address February, 2011 Rev 1.0 Page 3 of 12

Note: Set unused register addresses to zero. Software Reset (3 Elements) Element 0 Device address Element 2 Reset option (see product documentation) Write Memory Registers (13 Elements) Element 0 Device address Element 2 Register Count (1-5) Element 3 Register 1 address Element 4 Register 1 value Element 5 Register 2 address Element 6 Register 2 value Element 7 Register 3 address Element 8 Register 3 value Element 9 Register 4 address Element 10 Register 4 value Element 11 Register 5 address Element 12 Register 5 value Note: Set unused register addresses and values to zero. Write to Instruction Buffer (7 Elements) Element 0 Device address Element 2 MCT Op-code Element 3 Data Element 4 Date Element 5 Data Element 6 Data February, 2011 Rev 1.0 Page 4 of 12

3. Third Party Hardware Methods 3.1. LabJack Data Acquisition Hardware 3.1.1. LJAnalogOut() Sets an LJ DAC channel to the specified voltage. void LJAnalogOut(int LJHandle, byte Chan, double Volt) LJHandle Hardware handle assigned to the LJ device by the HOST PC when first opened. LJDevice LJ Device descriptor Chan LJ DAC channel number. Volt Output voltage measured in volts. NA 3.1.2. LJComConfig() Configures the LJ SPI and I 2 C buses. void LJComConfig(int LJHandle, bool SPI, byte[] ConArray) LJHandle Hardware handle assigned to the LJ device by the HOST PC when first opened. February, 2011 Rev 1.0 Page 5 of 12

LJDevice LJ Device descriptor Chan Bus configuration True = SPI False = I2C ConArray Configuration array used to specify bus speed and associated output channels. Elements 1 through 4 are used to map serial lines to specific digital output channels. Element SPI I2C 0 Clock Factor Clock Factor 1 MISO SCL 2 MOSI SDA 3 SCK Not used 4 NSS Not used 5 Mode Not used The U12 only supports SPI communications. The Clock Factor, MISO, MOSI, and SCK values in ConArray are all ignored when configuring the U12 for SPI. The U12 internally sets the bus speed to 10 khz and outputs the MOSI, MISO, and SCK lines on D13, D14, and D15, respectively. The NSS line may be configured on any one of the other available digital lines (D0-D12). Note: All MCT devices us Mode B for SPI communications. Always pass a 1 for Mode when communicating with MCT hardware. NA 3.1.3. LJConnect() Opens a connection to a specified LabJack device. Method Definition static void LJConnect(ref int LJHandle, bool USB, bool FirstFound, String Address) February, 2011 Rev 1.0 Page 6 of 12

LJHandle Variable used to store the LJ hardware handle assigned by the host PC. LJDevice LJDevice Descriptor ComMeth Communication method. Only used with the UE9. Set to true for all other devices. True = USB False = Ethernet Address Ethernet address if connecting via Ethernet (UE9). Device I.D. number if connecting with a specific device. The FirstFound option must be set to false if connecting by means of the device I.D. value. LJHandle - Hardware handle assigned to the LJ device by the HOST PC when first opened. 3.1.4. LJCurrent() Reads an analog input channle and converts the votlage to the equivalent current conducting through the bridge. LJCurrent is only used to read bridge on the DCA-10. void LJCurrent(int LJHandle, byte Chan, byte ChanN, bool Diff, ref double Current) LJHandle Hardware handle assigned to the LJ device by the host PC when first opened. February, 2011 Rev 1.0 Page 7 of 12

LJDevice LJ Device descriptor Chan Analog input channel to read. Chan is the positive input if a differential measurement is made. ChanN Negative input channel for differential measurements. Not used in single-ended mode. Diff Sets singled-ended or differential mode when reading an analog input. True = Differential False = Single-ended Current Reference to a variable used to store measured current. Current DCA-10 H-bridge current measured in amps. 3.1.5. LJDigLine() Reads or writes to a digital input/output channel. LJDigLine will only read/write to channels D0-D15 on the LabJack U12. void LJDigLine(int LJHandle, byte Chan, byte Dir, ref byte State) LJHandle Hardware handle assigned to the LJ device by the host PC when first opened. LJDevice LJ Device descriptor Chan Digital channel February, 2011 Rev 1.0 Page 8 of 12

Dir Channel direction 0 = Digital input nonzero = Digital output State Reference to a variable used to store channel state. State Digital line state for specified digital line. 3.1.6. LJPWMConfig() Configures PWM output channel on a specified channel. The digital channel is configured as 8-bit PWM (1000 Hz - 10,000 Hz). LJPWMConfig is only used with the DCA-10. void LJPWMConfig(int LJHandle, int Freq, byte IN2Chan, ref int ActFreq) LJHandle Hardware handle assigned to the LJ device by the host PC when first opened. LJDevice LJ Device descriptor Freq Command frequency for PWM output. IN2Chan Channel connected to the DCA-10 s IN2 pin. ActFreq Reference to a variable used to store PWM frequency set by hardware. ActFreq Variable used to store PWM frequency set by hardware. The actual PWM frequency may vary depending on how February, 2011 Rev 1.0 Page 9 of 12

the commanded frequency divides into the LabJack s internal clock. 3.1.7. LJPWMUpdate() Updates the duty cycle on the PWM output signal. Call LJPWMUpdate after using LJPWMConfig() to configure a PWM output channel. LJPWMConfig is only used with the DCA-10. void LJPWMUpdate(int LJHandle, ref byte DC) LJHandle Hardware handle assigned to the LJ device by the host PC when first opened. LJDevice LJ Device descriptor DC Command duty cycle for the PWM output. DC The actual duty cycle of the PWM output. Internal clock frequency and rounding may result in a PWM duty cycle different from the commanded value. The actual value used by hardware is returned in the DC variable. 3.1.8. LJSendData() Transmits a data packet to the MCT hardware using the SPI or I 2 C bus. LJSendData automatically retrieves the response packet from hardware. Use in conjunction with the BuildDataPacket() method to properly construct and format transmitted data packets. void LJSendData(int LJHandle, bool SPI, February, 2011 Rev 1.0 Page 10 of 12

byte[] DataArray, ref byte Bytes) LJHandle Hardware handle assigned to the LJ device by the host PC when first opened. LJDevice LJ Device descriptor ComType Serial bus protocol used to transmit data packet True = SPI False = I 2 C DataArray Data array to transmit to MCT hardware Bytes Number of bytes data array being transmitted. DataArray Data packet returned by the MCT hardware Bytes Number of bytes in the returned data packet. 4. Utility Methods 4.1.1. Hex2Float() Converts a 4-byte data array representing a floating-point value in IEEE-754 floating-point storage standard (32-bits). void Hex2Float(ref float FVal, byte[] ByteArray) inputs: FVal Reference to variable that will store the floating-point value. ByteArray = 4-byte IEEE-754 representation of the floating point number. Element 0 = SEEE EEEE Element 1 = EMMM MMMM Element 2 = MMMM MMMM February, 2011 Rev 1.0 Page 11 of 12

Element 3 = MMMM MMMM Note: Each bit in the 4-byte array corresponds to numbers sign, exponent, or mantissa as defined in the IEEE-754 floating-point storage standard. Fval Converted floating-point value. S = sign, E = Exponent, M = Mantissa 4.1.2. Float2Hex() Converts a floating-point number to a 4-byte representation, according to the IEEE-754 floating point storage standard (32-bits). void Float2Hex(float FVal, byte[] ByteArray) inputs: FVal - Floating point number to convert ByteArray = 4-byte IEEE-754 representation of the floating point number. Element 0 = SEEE EEEE Element 1 = EMMM MMMM Element 2 = MMMM MMMM Element 3 = MMMM MMMM Note: Each bit in the 4-byte array corresponds to numbers sign, exponent, or mantissa as defined in the IEEE-754 floating point storage standard. S = sign, E = Exponent, M = Mantissa 5. Revision History Revision 1.0 Initial Release February, 2011 Rev 1.0 Page 12 of 12