Wiki source code of LSS-2MC Board

Last modified by Eric Nantel on 2023/05/29 07:33

Hide last authors
Eric Nantel 4.1 1 {{lightbox image="LSS-2MC.png" width="350"/}}
Eric Nantel 2.1 2
Eric Nantel 92.1 3 [[[[image:[email protected]||alt="buy-online.jpg"]]>>https://www.robotshop.com/products/lynxmotion-ses-v2-arduino-compatible-12a-dual-motor-controller-lss-lss-2mc||rel="noopener noreferrer" target="_blank"]]
Eric Nantel 2.1 4
5 **Table of Contents**
6
7 {{toc/}}
8
9 = Description =
10
Coleman Benson 50.2 11 The Lynxmotion LSS-2MC ("Lynxmotion Smart Servo To Motor Controller") module was designed as a multi-purpose, Arduino programmable board intended to "bridge the gap" between a Lynxmotion Smart Servo (LSS) serial bus and one or two electromechanical devices operating on PWM input like brushed DC motors (used to rotate fans, pumps or wheels for example), or LEDs. The onboard motor controller chip also allows for control of one bipolar stepper motor using all four pins. Although a default program is included when shipped, it can be re-programmed using the standard Arduino IDE software to communicate with the onboard motor controller acting as a standard Arduino board.
Eric Nantel 2.1 12
13 = Features =
14
Eric Nantel 60.1 15 * Dual 1.2A H-Bridge motor driver ([[MP6508GR-P>>attach:MP6508.pdf]])
Eric Nantel 5.1 16 * USB Type-C connector
Eric Nantel 2.1 17 * 2x LSS connectors allow for daisy chaining
Eric Nantel 60.1 18 * Input / Output A3 pin under the USB Type-C (Unpopulated / Solder pads only)
19 * LED (red): Tx-Rx USB serial activity
Eric Nantel 2.1 20 * LED (green): Power LED (PWR)
Eric Nantel 60.1 21 * Arduino Nano bootloader installed & Arduino IDE compatible
Eric Nantel 2.1 22 * Lynxmotion Smart Servo (LSS) mounting pattern
Eric Nantel 5.1 23 * Same form factor as the** **[[LSS - Power Hub>>doc:servo-erector-set-system.ses-electronics.ses-modules.lss-power-hub.WebHome||rel="noopener noreferrer" target="_blank"]] / [[doc:servo-erector-set-system.ses-electronics.ses-modules.lss-2io-board.WebHome]] / [[doc:servo-erector-set-system.ses-electronics.ses-modules.lss-5vr.WebHome]]
Eric Nantel 2.1 24
25 = Specifications =
26
27 * Microcontroller: ATMega328P
Eric Nantel 51.1 28 * USB-to-Serial IC: CH340E ([[Driver Download>>http://www.wch-ic.com/search?q=CH340&t=downloads]])
Eric Nantel 2.1 29 * Logic voltage: 5V
Eric Nantel 5.1 30 * Analog voltage: 5V
Eric Nantel 16.1 31 * 5V maximum current: 200mA
Eric Nantel 60.1 32 * Number of analog pins: 1 (A3)
Eric Nantel 2.1 33 * Input voltage via LSS connector: 6V-12V
34 * Maximum rated current through LSS connectors: 2A
35
Eric Nantel 90.1 36 = Schematic =
37
Eric Nantel 79.1 38 The complete schematic can be downloaded [[HERE>>attach:LSS 2MC Board V0.3.pdf]].
39
Eric Nantel 80.2 40 = Communication =
Eric Nantel 79.1 41
Eric Nantel 91.1 42 Using the LSS-2MC with its Lss2MC example code requires that the user understand the Protocol which is available  [[HERE>>doc:.2mc-communication-protocol.WebHome]].
Eric Nantel 85.1 43 The code is available on GitHub and in the [[AlternativeLSS>>https://github.com/Lynxmotion/AlternativeLSS]] library through the Arduino IDE library manager.
Eric Nantel 79.1 44
Eric Nantel 80.1 45 **Internal Serial Connection**
46
Eric Nantel 80.2 47 The board is effectively a "peripheral". In order to respond to LSS commands, it needs to be running appropriate code, or the default Lss2MC Arduino sample program.
48 Pinout is as follows:
Eric Nantel 80.1 49
50 * ATMega328P's Tx pin (D1) is connected to the LSS Tx line through a [[tri-state buffer (IC3)>>https://en.wikipedia.org/wiki/Three-state_logic||rel="noopener noreferrer" target="_blank"]] that can be enabled or disabled with pin D14.
51 * ATMega328P's Rx pin (D0) is connected to the LSS Rx line.
52
Eric Nantel 80.2 53 Therefore data that is sent from an external UART device will be received on the LSS Rx line and the ATMega328P Rx pin. The LSS-2MC USB-to-Serial IC Tx is connected to the ATMega328P Rx (pin D0) through another [[tri-state buffer (IC4)>>https://en.wikipedia.org/wiki/Three-state_logic||rel="noopener noreferrer" target="_blank"]] that can be enabled/disabled with pin D7. The Lss2MC Arduino code inherently takes care of managing the pins D14 and D7 as follows :
Eric Nantel 80.1 54
Eric Nantel 80.2 55 * **D7 **is LOW**: **to disconnect 2MC USB-to-Serial IC Tx from ATMega328P Rx (pin D0) allowing the ATMega328P to receive data from the UART controller device as 2MC USB-to-Serial IC Tx is HIGH when 2MC is powered.
56 * **D14** is HIGH**:** when the 2MC Board is sending data on the LSS Tx line to an external UART device Rx pin. LSS Tx line is asserted to the 2MC Tx pin :
Eric Nantel 80.1 57
Eric Nantel 84.1 58 {{lightbox image="LSS-2MC-Schematic-2RC-D14HIGH.png" width="900"/}}
Eric Nantel 80.1 59
60 * **D14 **is LOW**:** when the 2IO Board is not sending data on the LSS Tx line. The 2IO frees up the LSS Tx line to avoid bus congestion (when 2 devices sends data at the same time) :
61
Eric Nantel 84.1 62 {{lightbox image="LSS-2MC-Schematic-2RC-D14LOW.png" width="900"/}}
Eric Nantel 80.1 63
Eric Nantel 2.1 64 = Pinout =
65
Eric Nantel 22.1 66 |(% colspan="3" %)**Top External Pins**
Eric Nantel 16.1 67 |(% colspan="1" rowspan="8" style="text-align:center; vertical-align:middle; width:300px" %){{lightbox image="LSS-2MC-External.png"/}}|(% style="width:35px" %)[[image:[email protected]]]|**Vin**: Input voltage supplied by LSS bus (6V to ~~12V)
68 |[[image:[email protected]]]|**Ground (G)**: Common ground
69 |[[image:[email protected]]]|**LSS Rx**
70 |[[image:[email protected]]]|**LSS Tx**
71 |[[image:[email protected]||alt="SQUARE-Red.png"]]|**H-Bridge Output #1**
72 |[[image:[email protected]||alt="SQUARE-Red.png"]]|**H-Bridge Output #2**
73 |[[image:[email protected]||alt="SQUARE-Blue.png"]]|**H-Bridge Output #3**
74 |[[image:[email protected]]]|**H-Bridge Output #4**
Coleman Benson 50.3 75 |(% colspan="3" %)**Bottom Solder Pins (Optional)**
76 |(% colspan="1" rowspan="3" %){{lightbox image="LSS-2MC-External-Bottom.png"/}}|(% style="vertical-align:middle" %)[[image:[email protected]]]|(% style="vertical-align:middle" %)**Pin A3: **Analog input 3
Eric Nantel 22.1 77 |(% style="vertical-align:middle" %)[[image:[email protected]]]|(% style="vertical-align:middle" %)**5V Out:** Low current output for sensor when used with A3
78 |(% style="vertical-align:middle" %)[[image:[email protected]]]|(% style="vertical-align:middle" %)**Ground (G)**: Common ground
Eric Nantel 48.1 79 |(% colspan="3" %)**Internal Pins / Connections**
Eric Nantel 18.1 80 |(% colspan="1" rowspan="9" %) |(% colspan="2" rowspan="1" %)**Pin D14: **Controls the tri-state buffer (IC3) on the ATMega328P Tx serial line (pulled-down)
Eric Nantel 19.1 81 |(% colspan="2" rowspan="1" %)**Pin D7: **Controls the tri-state buffer (IC4) on CH340E Tx / ATMega328P Rx serial line (pulled-up)
Coleman Benson 50.3 82 |(% colspan="2" rowspan="1" %)**Pin D9: **H-Bridge Input #1
83 |(% colspan="2" rowspan="1" %)**Pin D10:** H-Bridge Input #2
84 |(% colspan="2" rowspan="1" %)**Pin D3: **H-Bridge Input #3
85 |(% colspan="2" rowspan="1" %)**Pin D11:** H-Bridge Input #4
Eric Nantel 60.1 86 |(% colspan="2" rowspan="1" %)**Pins A4:** H-Bridge i2c (SDA = A4)
Coleman Benson 50.3 87 |(% colspan="2" rowspan="1" %)**Pin D2: **H-Bridge NSleep (set high to enable)
88 |(% colspan="2" rowspan="1" %)**Pin D8:** H-Bridge NFault
Eric Nantel 16.1 89
Eric Nantel 79.1 90 = Wiring & Power Options =
Eric Nantel 78.1 91
Eric Nantel 77.1 92 |(% colspan="3" style="width:300px" %)**Power**
93 |(% colspan="1" rowspan="2" style="width:300px" %){{lightbox image="LSS-2MC-Power.png"/}}|(% style="vertical-align:middle; width:35px" %)[[image:[email protected]]]|(% style="vertical-align:middle" %)(((
94 **LSS Connectors: **The board is meant to be powered from ONE of the two LSS connectors. Vin will supply the two on-board 5V regulators (logic and Vout) and to the Lynxmotion Smart Servos connected on the bus. Power will also be supplied to the h-bridge at the same voltage as the bus voltage.
Eric Nantel 16.1 95
Eric Nantel 77.1 96 Refer to LSS Voltage rating in [[LSS - Specifications>>doc:lynxmotion-smart-servo.lss-specifications.WebHome||rel="noopener noreferrer" target="_blank"]]
97 )))
Eric Nantel 2.1 98 |(% style="vertical-align:middle; width:35px" %)[[image:[email protected]||alt="SQUARE-Red.png"]]|(% style="vertical-align:middle" %)(((
Eric Nantel 77.1 99 **USB: **Connecting only the USB will only provide voltage to the logic. It won't power the h-bridge chip.
Eric Nantel 2.1 100 )))
Eric Nantel 41.1 101 |(% colspan="3" style="width:300px" %)~*~*NOTE:~*~* USB and Vin power source are isolated and there are no issues connecting both a USB and a powered LSS bus at the same time
Eric Nantel 2.1 102
Eric Nantel 41.1 103 |(% colspan="2" %)**Sample Wiring / Use**
Eric Nantel 72.1 104 |{{lightbox image="LSS-2MC-Power-LSS-ADA.png"/}}|{{lightbox image="LSS-2MC-Power-LSS-HUB.png"/}}
Coleman Benson 50.3 105 |(% style="text-align:center" %)(((
106 //LSS-2MC on a bus, powered by an LSS-ADA//
Eric Nantel 36.1 107
Coleman Benson 50.3 108 //Lynxmotion Smart Servo is optional //
109 )))|(% style="text-align:center" %)(((
110 //LSS-2MC on a bus, powered by an LSS-HUB //
111
112 //Lynxmotion Smart Servo and LSS-2IO are optional //
113 )))
114
Eric Nantel 79.1 115 == Dual H-Bridge (DC Motors) ==
Eric Nantel 2.1 116
117 |**Sample Wiring / Use**
Eric Nantel 72.1 118 |{{lightbox image="LSS-2MC-Wiring-DC.png" width="900"/}}
Eric Nantel 2.1 119
Eric Nantel 79.1 120 == Bipolar Stepper Motor ==
Eric Nantel 2.1 121
Eric Nantel 41.1 122 |**Sample Wiring / Use**
Eric Nantel 72.1 123 |{{lightbox image="LSS-2MC-Wiring-Stepper.png" width="900"/}}
Eric Nantel 41.1 124
Eric Nantel 2.1 125 = Dimensions & Mounting =
126
Eric Nantel 44.1 127 |(% style="width:300px" %){{lightbox image="LSS-2MC-Dimensions.png"/}}|(% style="width:300px" %)[[image:servo-erector-set-system.ses-electronics.ses-modules.lss-2io-board.WebHome@LSS-2IO-Mounting.gif]]|
Copyright RobotShop 2018