Document title: LEGO Power Functions RC. Init: GMu. Version: Date: Version 1.20

Similar documents
B Robo Claw 2 Channel 5A Motor Controller Data Sheet

CHAPTER 11: Flip Flops

Event counters in NOVA

Electric Landing Gear controllers and sequencer LGC12 / LGC 13C

Chapter 4: Pulse Width Modulation

The Programming Interface

User and installation manual

HD44780U (LCD-II) (Dot Matrix Liquid Crystal Display Controller/Driver)

Evo Laser Firmware Developer s Manual

Using the Siemens S65 Display

RC Camera Control. User Guide v /20/2012

Data Acquisition Module with I2C interface «I2C-FLEXEL» User s Guide

Single channel data transceiver module WIZ2-434

The Answer to the 14 Most Frequently Asked Modbus Questions

Bluetooth + USB 16 Servo Controller [RKI-1005 & RKI-1205]

IR Communication a learn.sparkfun.com tutorial

Dr Robot C# Advance Sputnik Demo Program

Midi Fighter Twister. User Guide. Ver 1.01 DJTECHTOOLS.COM

HT1632C 32 8 &24 16 LED Driver

NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter

Interfacing Analog to Digital Data Converters

1. Learn about the 555 timer integrated circuit and applications 2. Apply the 555 timer to build an infrared (IR) transmitter and receiver

Technical Support Bulletin Nr.18 Modbus Tips

Timer A (0 and 1) and PWM EE3376

Adding Heart to Your Technology

BLUETOOTH SERIAL PORT PROFILE. iwrap APPLICATION NOTE

Bluetooth HID Profile

ACR122 NFC Contactless Smart Card Reader

MILE Encoder for EC 90 flat

Modern Robotics, Inc Core Device Discovery Utility. Modern Robotics Inc, 2015

USER GUIDE. Publication AP7080. Allen & Heath 1 XONE:1D User Guide

Ocean Controls RC Servo Motor Controller

Crazy Alarm Clock L A K S H M I M E Y Y A P P A N J A M E S K A Y E W I L L I A M D I E H L C O N G C H E N

PCM Encoding and Decoding:

computer radio control system

Table 1 below is a complete list of MPTH commands with descriptions. Table 1 : MPTH Commands. Command Name Code Setting Value Description

HDTV Anywhere USER MANUAL / HDTV Anywhere ALL RIGHTS RESERVED MARMITEK

SYSTEM 4C. C R H Electronics Design

Creating a Project with PSoC Designer

Lab 5 Getting started with analog-digital conversion

PowerBox PBX 180. Installation and Users Guide

PROGRAMMABLE LOGIC CONTROLLERS Unit code: A/601/1625 QCF level: 4 Credit value: 15 TUTORIAL OUTCOME 2 Part 1

Description. Features. Applications

USING I2C WITH PICAXE

UPS PIco. to be used with. Raspberry Pi B+, A+, B, and A. HAT Compliant. Raspberry Pi is a trademark of the Raspberry Pi Foundation

M25P05-A. 512-Kbit, serial flash memory, 50 MHz SPI bus interface. Features

Omron I/O Driver (Series 2) Programmable Serial Interface Card

8-bit Microcontroller. Application Note. AVR415: RC5 IR Remote Control Transmitter. Features. Introduction. Figure 1.

DS1621 Digital Thermometer and Thermostat

1.Eastron SDM220Modbus Smart Meter Modbus Protocol Implementation V1.0

Video Keyboard Mouse Audio automatic Switch CAS-241, CAS-441, CAS-441-PM

Small 7-key User-definable Remote Control User s Guide

What is Easy-Radio? Devices Covered. Frequency Hopping Transceiver. Where x00 denotes frequency of operation. E.g. 400 = 433MHz

Lab 6 Introduction to Serial and Wireless Communication

D-MAX WEB GUIDE CONTROLLER WITH OPERATOR INTERFACE PANEL QUICK START SETUP MANUAL

RS485 & Modbus Protocol Guide

Microcontroller Based Low Cost Portable PC Mouse and Keyboard Tester

Designing an Induction Cooker Using the S08PT Family

100BASE-TX Decoding Instructions

Develop a Dallas 1-Wire Master Using the Z8F1680 Series of MCUs

IP Phone 1140E User Guide. BCM Business Communications Manager

MANUAL FOR RX700 LR and NR

Software Manual RS232 Laser Merge Module. Document # SU Rev A

DMX2PWM 9 Channel Dimmer Setup Manual

How To Set Up A Modbus Cda On A Pc Or Maca (Powerline) With A Powerline (Powergen) And A Powergen (Powerbee) (Powernet) (Operating System) (Control Microsci

Byonics Micro Trak 1000 High Altitude Balloon Tracker

DMX-K-DRV. Integrated Step Motor Driver + (Basic Controller) Manual

Technical Manual. FAN COIL CONTROLLER COOLING or HEATING ANALOG or PWM Art A

User Manual. September 18, Copyright Thomson. All rights reserved.

Datasheet of the Easy Servo Drive ES-D VDC, 8.2A Peak, Close-loop, No Tuning. Version

Communications Protocol for Akai APC40 Controller

Current plugin version: V2.145

SDN INSTRUCTIONS 07/10, Ver 1.2. Somfy Digital Network (SDN) Installation and Programming

ROCK BAND 3 WIRELESS KEYBOARD:

Decimal Number (base 10) Binary Number (base 2)

METROLOGIC INSTRUMENTS, INC. Area Imaging Bar Code Supplemental Configuration Guide

EDK 350 (868 MHz) EDK 350U (902 MHz) EnOcean Developer Kit

Evaluation Board for the AAT1275 Boost Converter with USB Power Switch

TBS Dominator 5G8 Receiver

Congratulations on purchasing Molten MIDI B by Molten Voltage

irobot Create OPEN INTERFACE

GTS-4E Hardware User Manual. Version: V1.1.0 Date:

Massachusetts Institute of Technology

Signature and ISX CM870 Electronics

ABB i-bus EIB Universal Interfaces US/U 4.2 US/U 2.2

FlyingDream AAT Driver Quick Guide V1.1

Pololu DRV8835 Dual Motor Driver Shield for Arduino

PCAN-MicroMod Universal I/O Module with CAN Interface. User Manual. Document version ( )

Neonixie 6 Digit Nixie Clock Controller Introduction and Assembly

AN588 ENERGY HARVESTING REFERENCE DESIGN USER S GUIDE. 1. Kit Contents. 2. Introduction. Figure 1. Energy Harvesting Sensor Node

GPS/GLONASS SiRFstarV Evaluation Kit EVA5100-A

Pulse Width Modulation Applications

ABB Drives. User s Manual. Pulse Encoder Interface Module RTAC-01

SUDT AccessPort TM Advanced Terminal / Monitor / Debugger Version 1.37 User Manual

Hardware Keylogger Detection. Andy Davis. Research and Development Manager

7 OUT1 8 OUT2 9 OUT3 10 OUT4 11 OUT5 12 OUT6 13 OUT7 14 OUT8 15 OUT9 16 OUT10 17 OUT11 18 OUT12 19 OUT13 20 OUT14 21 OUT15 22 OUT16 OUT17 23 OUT18

Chapter 2 Lab 2-2, Configuring EtherChannel Instructor Version

IS31FL3731 AUDIO MODULATED MATRIX LED DRIVER. May 2013

Manual. VE.Bus to NMEA 2000 interface

DS1621 Digital Thermometer and Thermostat

Transcription:

Version 1

Introduction The purpose of this document is to describe the RC protocol supported by the LEGO Power Functions RC Receiver. Attention! Please feel free to use any information from this document for personal, non-commercial use only, provided you keep intact copyright, trademark and other proprietary rights of the The LEGO Group have fun. The LEGO Group 02/2010 2

Table of content Introduction... 2 Table of content... 3... 4 Receiver... 4 Application Schematics... 4 Description... 5 Protocol... 6 Extended mode... 7 Combo direct mode... 8 Single output mode... 9 Combo PWM mode... 10 Encoding... 11 Transmitting Messages... 12 Decoding... 13 Receiving Messages... 13 3

Receiver The receiver has input for IR data and channel switch and output for two LPF plugs and one LED. Motor driver IR Receiver Data Receiver LED Motor driver Channel 1-4 Application Schematics Channel 1 2 3 4 Vcc Vcc Vcc ON IR Receiver A0 A1 S1 A2 S2 A3 B0 D0 B1 D1 B2 D2 B3 D3 Dual Motor Driver 4

Description This receiver firmware is capable of executing all commands in the LPF RC Protocol acting in a variety of RC modes. Each mode implements a certain type of RC functionality. When applying supply voltage the LED will give a short blink and then light up - the receiver is now ready. If a legal valid command of the right channel is received the LED will shortly turn off and indicate that the command is executed. The effect you will see is the LED blinking when messages are received. The outputs of the RC Receiver are generic Power Functions outputs in the following we will use motors as examples to describe the functionality of the control. Depending on command the four output port pins will turn into two motor controls or individually controlled outputs. The motor outputs will either be forward, float, brake, backward ON/OFF or PWM controlled. Some commands are timed out after 1.2 second when not receiving IR others are not. Default behavior is floating outputs. The receiver does not power down and can only be turned off by removing its supply voltage. 5

Protocol The payload is: 1 toggle bit, 1 escape bit, 2 bits for channel switch, 1 bit for address, 3 bits for mode and 4 bits for various data depending on mode. The address bit is intended for enabling an extra set of 4 channels for future use. The current PF RC Receiver expects by default the address bit to be 0. A message consists of: A special length synchronisation start bit, payload and Longitudinal Redundancy Check to validate the entire message before executing the command and at last a stop bit to terminate the message. Binary representation: Nibble 1 Nibble 2 Nibble 3 start T E C C a M M M D D D D L L L L stop Start Toggle Escape Channel Address Mode Data LRC Stop Start start Special synchronisation start bit (see description under Encoding ) Toggle T 0-1 Toggling for every new command Escape E 0 Use Mode to select the modes listed below 1 Combo PWM mode Channel CC 0-3 Channel switch 1-4 Address a 0 Default address space (from power up) 1 Extra address space Mode MMM 000 Extended mode 001 Combo direct mode 01x Reserved 1xx Single output mode Data DDDD 0-15 Data: different meaning depending on Mode LRC LLLL xxxx = 0xF xor Nibble 1 xor Nibble 2 xor Nibble 3 Stop stop Same as Start 6

Extended mode This mode is able to control: Brake, increment and decrement PWM in 7 steps on Output A and toggle Forward/Float on Output B. Toggle bit is verified on receiver. No timeout for lost IR. From power up the address bit is always expected to be 0 (default address space). If the Toggle Address bit command is received (with a = 0) the extra address space is used and commands are from now expected to have the address bit set to 1. A new Toggle Address bit command (now with a = 1) will toggle back to default address space. The Align toggle bit command has no action and is used to make sure the next command send is in sync. Binary representation: Nibble 1 Nibble 2 Nibble 3 start T 0 C C a 0 0 0 F F F F L L L L stop Start Toggle Escape Channel Address Mode Data LRC Stop Function FFFF 0000 Brake then float output A 0001 Increment speed on output A 0010 Decrement speed on output A 0011 Not used 0100 Toggle forward/float on output B 0101 Not used 0110 Toggle Address bit 0111 Align toggle bit (get in sync) 1000 Reserved 7

Combo direct mode This mode is able to control: Two outputs float/forward/backward/brake. This is a combo command controlling the state of both output A and B at the same time. Toggle bit is not verified on receiver. This mode has timeout for lost IR. Binary representation: Nibble 1 Nibble 2 Nibble 3 start T 0 C C a 0 0 1 B B A A L L L L stop Start Toggle Escape Channel Address Mode Data LRC Stop B output BB 00xx Float output B 01xx Forward on output B 10xx Backward on output B 11xx Brake then float output B A output AA xx00 Float output A xx01 Forward on output A xx10 Backward on output A xx11 Brake then float output A 8

Single output mode This mode is able to control: One output at a time with PWM or clear/set/toggle control pins. Toggle bit is verified on receiver if increment/decrement/toggle command is received. This mode has no timeout for lost IR on all commands except full forward and full backward. Binary representation: Nibble 1 Nibble 2 Nibble 3 start T 0 C C a 1 M O D D D D L L L L stop Start Toggle Escape Channel Address Mode Data LRC Stop Mode M 0 PWM 1 Clear/Set/Toggle/Inc/Dec Output O 0 Output A 1 Output B Mode = PWM Data DDDD 0000 Float 0001 PWM forward step 1 0010 PWM forward step 2 0011 PWM forward step 3 0100 PWM forward step 4 0101 PWM forward step 5 0110 PWM forward step 6 0111 PWM forward step 7 1000 Brake then float 1001 PWM backward step 7 1010 PWM backward step 6 1011 PWM backward step 5 1100 PWM backward step 4 1101 PWM backward step 3 1110 PWM backward step 2 1111 PWM backward step 1 Mode = Clear/Set/Toggle/Inc/Dec Data DDDD 0000 Toggle full forward (Stop Fw, Fw Stop, Bw Fw) 0001 Toggle direction 0010 Increment numerical PWM 0011 Decrement numerical PWM 0100 Increment PWM 0101 Decrement PWM 0110 Full forward (timeout) 0111 Full backward (timeout) 1000 Toggle full forward/backward (default forward) 1001 Clear C1 (negative logic C1 high) 1010 Set C1 (negative logic C1 low) 1011 Toggle C1 1100 Clear C2 (negative logic C2 high) 1101 Set C2 (negative logic C2 low) 1110 Toggle C2 1111 Toggle full backward (Stop Bw, Bw Stop, Fwd Bw) 9

Combo PWM mode This mode is able to control: Two outputs with PWM in 7 steps forward and backward. This is a combo command controlling the state of both output A and B at the same time. Toggle bit is not verified on receiver. This mode has timeout for lost IR. Binary representation: Nibble 1 Nibble 2 Nibble 3 start a 1 C C B B B B A A A A L L L L stop Start Address Escape Channel Output B Output A LRC Stop Output B Output A BBBB 0000 Float 0001 PWM forward step 1 0010 PWM forward step 2 0011 PWM forward step 3 0100 PWM forward step 4 0101 PWM forward step 5 0110 PWM forward step 6 0111 PWM forward step 7 1000 Brake then float 1001 PWM backward step 7 1010 PWM backward step 6 1011 PWM backward step 5 1100 PWM backward step 4 1101 PWM backward step 3 1110 PWM backward step 2 1111 PWM backward step 1 AAAA 0000 Float 0001 PWM forward step 1 0010 PWM forward step 2 0011 PWM forward step 3 0100 PWM forward step 4 0101 PWM forward step 5 0110 PWM forward step 6 0111 PWM forward step 7 1000 Brake then float 1001 PWM backward step 7 1010 PWM backward step 6 1011 PWM backward step 5 1100 PWM backward step 4 1101 PWM backward step 3 1110 PWM backward step 2 1111 PWM backward step 1 10

Encoding To ensure correct detection of IR messages six 38 khz cycles are transmitted as mark. Low bit consists of 6 cycles of IR and 10 cycles of pause, high bit of 6 cycles IR and 21 cycles of pause and start bit of 6 cycles IR and 39 cycles of pause. Graphically drawn: IR Mark Low bit (data = 0) High bit (data = 1) Start/Stop bit The high pulse illustrates six 38 khz cycles. Low bit length High bit length Start bit length Stop bit length = 16 x 1/38K = 421 us = 27 x 1/38K = 711 us = 45 x 1/38K = 1184 us = 45 x 1/38K = 1184 us This example shows start bit, 6 bits and stop bit (not really the actual protocol). Start High Low Low Low High High Stop 11

Transmitting Messages When a button is pressed or released on the transmitter the message is sent. Five exactly matching messages (if no other buttons are pressed or released) are sent accordingly in time intervals depending on the channel selected. This ensures that other transmitters are not interfering with all the messages. When a button is held down and the protocol needs update to prevent timeout the message is send continuously with a time interval as between message 4 and 5. First after all buttons are released and this is transmitted the transmitter will shut down. If t m is the maximum message length (16ms) and Ch is the channel number, then The delay before transmitting the first message is: The time from start to start for the next 2 messages is: The time from start to start for the following messages is: (4 Ch)*t m 5*t m (6 + 2*Ch)*t m 12

Decoding Decoding of message bits is done by measuring time from start of IR detection to next start of IR detection. Using only one, the active edge, stabilize the measured time nearly without influence of the automatic gain control in the IR receiver. The example from above: 1184us 711us 421us 421us 421us 711us 710us 1184us When the stop bits pause is reached the message is processed. Receiving Messages The receiving firmware looks for a start bit and when this is detected it samples 16 data bits, calculates and compares the LRC. If any of the sampled bits are too long the sampling is terminated immediately and a new start bit is searched for. When a bit time is sampled (measured) its time is hold against some limits. Low bit range High bit range Start/stop bit range 316-526 us 526 947 us 947 1579 us Depending on the bit time a low or high bit is rotated into the receive buffer. 13