ShiftX3: Difference between revisions
Line 24: | Line 24: | ||
* RJ45 network cable | * RJ45 network cable | ||
====OBDII Cable integration==== | ====Plug and Play: OBDII Cable integration==== | ||
OBDII installation is effectively plug and play. Power is supplied to both ShiftX3 and RaceCapture via the OBDII connection. | OBDII installation is effectively plug and play. Power is supplied to both ShiftX3 and RaceCapture via the OBDII connection. | ||
* Plug the CAN hub into RaceCapture | * Plug the CAN hub into RaceCapture |
Revision as of 17:49, 11 January 2019
Introduction
Parts in the Kit
In the kit you will receive:
- ShiftX3
- 2 #6 screws for surface mounting
Dimensions
- ShiftX3 with enclosure 136 x 32 x 9.46 mm (5.35 x 1.26 x .37 inches)
Connection and Installation
Mounting ShiftX3
Attach ShiftX3 with the mounting screws and tighten until snug.
Power and connection with RaceCapture/Pro or RaceCapture/Track MK2
Suggested parts (included with the optional CAN hub accessory pack)
- RJ45 Splitter
- RJ45 network cable
Plug and Play: OBDII Cable integration
OBDII installation is effectively plug and play. Power is supplied to both ShiftX3 and RaceCapture via the OBDII connection.
- Plug the CAN hub into RaceCapture
- Plug the OBDII cable into the CAN hub
- Plug the RJ45 cable into the CAN hub
- Plug the other end of the RJ45 cable into ShiftX3
Non OBDII installation
If you have your RaceCapture installed without OBDII, you can provide power to ShiftX3 and RaceCapture via a direct wire connection.
- Note:
- If you are powering RaceCapture/Pro directly via the main harness, this will not provide power back through the RJ45 connector, as isolation diodes are present within RaceCapture/Pro to prevent undesired back-driving of circuits. To power ShiftX3, you must provide external via the CAN hub using the technique below.
- You can power RaceCapture/Track MK2 and ShiftX3 via the RJ45 cable connection described below. This also can power RaceCapture/Pro via RJ45 port, if desired.
- Plug the CAN hub into RaceCapture
- Plug the RJ45 cable into the CAN hub
- Plug the other end of the RJ45 cable into ShiftX3
- Prepare the RJ45 cable described below for power + ground and plug into the CAN hub
RJ45 power cable for ShiftX3
Start by snipping the RJ45 connector off the end of a patch cable, and then expose the individual wires.
If you just need power and ground, just use these connections and snip the others short.
ShiftX3 connection | RaceCapture Connection | CAT5 EIA-T568B RJ45 cable |
---|---|---|
Red | +12v | Brown |
White | Ground | Orange/White |
No Connection | CAN 1 High | Orange |
No Connection | CAN 1 Low | Green/White |
Black | CAN 2 High | Blue |
Yellow | CAN 2 Low | Blue/White |
Note: These color codes assume EIA-T568B RJ45 cable (check printing on the cable to confirm)
CAN Termination
CAN termination is enabled by default. To disable termination, cut the CAN Term jumper on the bottom of ShiftX3 circuit board.
CAN Base Address
The default CAN base address is 935424 (0xE4600). You can change it by breaking the trace bridging the ADR1 jumper on the bottom of the ShiftX3 circuit board.
ADR1 jumper setting | Base address |
---|---|
Closed (Default setting) | 935424 (0xE4600) |
Open | 935680 (0xE4700) |
CAN Baud Rate
The default CAN baud rate is 500K. You can switch to 1MB by breaking the ADR2 Jumper on the bottom of the ShiftX3 board.
ADR2 jumper setting | Baud Rate |
---|---|
Closed (Default setting) | 500K |
Open | 1MB |
Scripts
The following scripts assume ShiftX3 is the first ShiftX3 on the bus (ADR1 jumper default setting). ShiftX3 is designed to work on the CAN2 network.
Disco Lights Demo
This is a test script that exercises all of the LEDs and the 7 segment display on ShiftX3. You can use this as a first time test, as it does not rely on any sensors.
Script
Copy and paste this entire script into the scripting window, replacing any existing script.
This script will randomly set LEDs with different colors and the display will update with random numbers.
setTickRate(30) -- Set configuration. Parameters: can bus (0=CAN1, 1=CAN2), base address, brightness, auto brightness scaling, orientation (0=normal, 1=display above LED bar) sxSetConfig(1, 0xE4600, bright,sxAutoBrightScaling,orientInverted) function rndc() return math.random(0,255) end function onTick() for i=0,9,1 do r = rndc() g = rndc() b = rndc() sxSetLed(i,1,r,g,b,0) end sxSetDisplay(0, math.random(0,9)) end
Sequential shift light
This script configures just a sequential shift light.
Script
Copy and paste this entire script, replacing any existing script:
- Default is reading RPM from the channel named "RPM"
setTickRate(30) -- Set ShiftX3 configuration -- Parameters: can bus (0=CAN1, 1=CAN2), base address, brightness, auto brightness scaling, orientation (0=normal, 1=display above LED bar) sxSetConfig(1, 0xE4600, 0, 61, 0) --config shift light sxCfgLinearGraph(0,0,0,7000) --left to right graph, linear style, 0 - 7000 RPM range sxSetLinearThresh(0,0,3000,0,255,0,0) --green at 3000 RPM sxSetLinearThresh(1,0,5000,255,255,0,0) --yellow at 5000 RPM sxSetLinearThresh(2,0,6000,255,0,0,10) --red+flash at 6500 RPM function onTick() sxUpdateLinearGraph(getChannel("RPM")) end
Shift Light + Twin Alert Example
This script shows a more complete example that demos a sequential shift light + two alerts.
Assumptions:
- Engine Temperature on the 1st alert LED, connected to first analog channel - channel name "EngineTemp"
- Oil Pressure on the 2nd alert LED, connected to second analog channel - channel name "OilPress"
Edit the script to change the analog channels you want to monitor.
Script
Copy and paste this entire script into the scripting window, replacing any existing script.
setTickRate(30) -- Set ShiftX3 configuration -- Parameters: can bus (0=CAN1, 1=CAN2), base address, brightness, auto brightness scaling, orientation (0=normal, 1=display above LED bar) sxSetConfig(1, 0xE4600, 0, 61, 0) --config shift light sxCfgLinearGraph(0,0,0,7000) --left to right graph, linear style, 0 - 7000 RPM range sxSetLinearThresh(0,0,3000,0,255,0,0) --green at 3000 RPM sxSetLinearThresh(1,0,5000,255,255,0,0) --yellow at 5000 RPM sxSetLinearThresh(2,0,6000,255,0,0,10) --red+flash at 6500 RPM --configure first alert (right LED) as engine temperature (F) sxSetAlertThresh(0,0,205,255,255,0,0) --yellow warning at 205F sxSetAlertThresh(0,1,225,255,0,0,10) -- red flash at 225F --configure second alert (left LED) as oil pressure (PSI) sxSetAlertThresh(1,0,0,0,0,255,10) --red flash below 15 psi sxSetAlertThresh(1,1,15,255,255,0,5) --yellow flash 15-20 PSI sxSetAlertThresh(1,2,20,0,0,0,0) --above 20, no alert function onTick() --update RPM sxUpdateLinearGraph(getChannel("RPM")) --update engine temp alert sxUpdateAlert(0, getChannel("EngineTemp")) --update oil pressure alert sxUpdateAlert(1, getChannel("OilPress")) end
Predictive Lap Timer Indicator
This script enables predictive lap time visualization.
How it works
A bar extends left or right from the center of the linear graph:
- Green bar extending to the right indicates you're beating the best time
- Red bar extending to the left means you're falling behind.
- When you're close to the best time, the center blue LED illuminates.
Notes:
- The script is designed for a +/- 10 second maximum delta - so if you're ahead or behind by 10 seconds, the linear graph will be fully illuminated center-right, or center-left.
- You will need to complete a a full lap to train the predictive timer before the graph will update.
Script
Copy and paste this entire script into the scripting window, replacing any existing script.
-- Predictive time visualizer --save best lap time bestTime = 0 -- Set ShiftX3 configuration -- Parameters: can bus (0=CAN1, 1=CAN2), base address, brightness, auto brightness scaling, orientation (0=normal, 1=display above LED bar) sxSetConfig(1, 0xE4600, 0, 61, 0) --config shift light sxCfgLinearGraph(1,0,0,200) --center-out graph, linear style, +/- 10.0 seconds in 0.1 sec resolution sxSetLinearThresh(0,0,0,255,0,0,0) --red if you're falling behind best lap sxSetLinearThresh(1,0,80,0,0,255,0) --blue if you're close to best lap sxSetLinearThresh(2,0,110,0,255,0,0) --green if you're beating best lap setTickRate(30) function onTick() local predTime = getPredTime() local timeDiff = (bestTime - predTime) * 60 -- rail values timeDiff = math.max(timeDiff, -10) timeDiff = math.min(timeDiff, 10) --scale values from +/- 10 sec to a 0-200 scale timeDiff = (timeDiff + 10) * 10 sxUpdateLinearGraph(timeDiff) --update best lap time if an updated lap time is available local lastLapTime = getLapTime() if lastLapTime < bestTime or bestTime == 0 then bestTime = lastLapTime end end
Boost Gauge
This script visualizes a single analog input channel on the linear graph.
How it works
The script configures the linear graph, then reads an analog channel and updates the graph with the current value. In this case, the value represents boost level measured from a MAP sensor.
Assumptions
- MAP sensor is on the channel named "MAP"
Script
Copy and paste this entire script into the scripting window, replacing any existing script.
setTickRate(30) -- Set ShiftX3 configuration -- Parameters: can bus (0=CAN1, 1=CAN2), base address, brightness, auto brightness scaling, orientation (0=normal, 1=display above LED bar) sxSetConfig(1, 0xE4600, 0, 61, 0) --config shift light sxCfgLinearGraph(0,0,0, 20) --left to right graph, linear style, 0 - 20 PSI boost sxSetLinearThresh(0,0,0,0,255,0,0) --green starting at no boost sxSetLinearThresh(1,0,10,255,255,0,0) --yellow starting at 10 PSI boost sxSetLinearThresh(2,0,15,255,0,0,10) --red+flash at 15 PSI boost function onTick() local map = getChannel("MAP") --convert to PSI boost local boost = math.max(map - 100, 0) * .145038 sxUpdateLinearGraph(boost) end
ShiftX3 CAN bus API
Overview
The CAN bus API provides the configuration and control interface for ShiftX3.
Two styles of control are available:
- Low level control of LEDs - the ability to discretely set LED color and flash behavior
- High level control - configuring alert thresholds and linear graph up front, and then providing simple value updates
CAN Messages
CAN base ID
CAN base ID is 0xE3600 (931328)
Cutting the jumper ADR1 will add 256 to the base ID, allowing up to two ShiftX3 displays on the same CAN bus.
CAN Baud rate
500K and 1MB rates are supported.
500K is enabled by default; cut the jumper ADR2 on the bottom of ShiftX3 to enable 1MB.
Configuration / Runtime Options
Announcement
Broadcast by the device upon power up
CAN ID: Base + 0
Offset | What | Value |
---|---|---|
0 | Total LEDs | Total number of LEDs on the device |
1 | Alert Indicators | Number of logical alert indicators |
2 | Linear Bar Graph Length | Number of LEDs in linear graph |
3 | Major Version | Firmware major version number |
4 | Minor Version | Firmware minor version number |
5 | Patch Version | Firmware patch version number |
Statistics
Statistics information, broadcast periodically by device
CAN ID: Base + 2
Offset | What | Value |
---|---|---|
0 | Major Version | Firmware major version number |
1 | Minor Version | Firmware minor version number |
2 | Patch Version | Firmware patch version number |
Set Configuration Parameters Group 1
Sets various configuration options.
CAN ID: Base + 3
Offset | What | Value |
---|---|---|
0 | Brightness | 0 - 100; 1 = dimmest; 100 = brightest; 0 = automatic brightness control using built-in light sensor. |
1 | Automatic brightness scaling (Optional) | 0-255; default=51. adjust this value to adjust the relative gain of the built-in light sensor when in automatic brightness mode. |
Set Display
Directly sets the value of the 7 segment display.
CAN ID: Base + 50
Offset | What | Value |
---|---|---|
0 | Digit index | 0 (must be 0) |
1 | Character | ASCII value of character to display |
The value of the display is set by the ASCII coded value. To set a numeric value, offset the value by 48: e.g. 48 = 0, 49 = 1, etc.
Most alphanumeric characters are supported as well, also via ASCII representation.
Set Discrete LED
A low level function to directly set any LED on the device.
CAN ID: Base + 10
Offset | What | Value |
---|---|---|
0 | LED index | 0 -> # of LEDs on device |
1 | Number of LEDs to set | 0 -> # of LEDs on device (0 = set all remaining) |
2 | Red | 0 - 255 |
3 | Green | 0 - 255 |
4 | Blue | 0 - 255 |
5 | Flash | 0-10Hz (0 = full on) |
Alert Indicators
Alert Indicators are typically single LEDs or a group of LEDs treated as one logical unit. This is defined by the hardware configuration of the device.
Set Alert
Directly set an alert indicator
CAN ID: Base + 20
Offset | What | Value |
---|---|---|
0 | Alert ID | 0 -> # of Alert indicators |
1 | Red | 0 - 255 |
2 | Green | 0 - 255 |
3 | Blue | 0 - 255 |
4 | Flash | 0-10Hz (0 = full on) |
Set Alert Threshold
Configures an alert threshold. Up to 5 thresholds can be configured per alert indicator.
Notes:
- If the current value is greater than the last threshold, then the last threshold is selected.
- The first threshold may have a threshold value >= 0; remaining thresholds must be > 0
CAN ID: Base + 21
Offset | What | Value |
---|---|---|
0 | Alert ID | 0 -> # of Alert indicators |
1 | Threshold ID | 0 - 4 |
2 | Threshold (low byte) | |
3 | Threshold (high byte) | |
4 | Red | 0 - 255 |
5 | Green | 0 - 255 |
6 | Blue | 0 - 255 |
7 | Flash Hz | 0 - 10 (0 = full on) |
Update Current Alert Value
Updates the current value for an alert indicator. The configured alert thresholds will be applied to the current value.
CAN ID: Base + 22
Offset | What | Value |
---|---|---|
0 | Alert ID | 0 -> # of Alert indicators |
1 | Value (low byte) | |
2 | Value (high byte) |
Linear Graph
The linear graph mode provides visualizations for common scenarios:
- Sequential RPM shift light where the progression is stepped
- Linear bar graph to linearly indicate a sensor value
- Center left/right graph to indicate +/- performance against a reference - such as visualizing current predictive time vs best time
Power up default configuration
Upon power up the linear graph is configured:
- Rendering style: left->right
- Linear style: stepped
- Low Range: 0
- High Range: N/A
- Threshold :
- Threshold value: 3000 / segment length: 3 / color RGB: (0, 255, 0) / flash: 0
- Threshold value: 5000 / segment length: 5 / color RGB: (0, 255, 255) / flash: 0
- Threshold value: 7000 / segment length: 7 / color RGB: (255, 0, 0) / flash: 5
Configure Linear Graph
Configures the options for the linear graph portion of the device.
Rendering style:
- If left->right, linear graph illuminates left to right
- If centered, values below the mid-point in the range extend from the center to the left, and values above the mid-point extend from the center to the right.
- If right->left, linear graph illuminates right to left
Linear style:
- if smooth, graph length is updated smoothly by interpolating the current value in-between LEDs
- If stepped, creates the visual effect of stepped progressions by setting the segment length of the threshold configuration. High Range of configuration is ignored.
CAN ID: Base + 40
Offset | What | Value |
---|---|---|
0 | Rendering Style | 0 = left->right, 1=center, 2=right->left |
1 | Linear Style | 0 = Smooth / interpolated, 1 = stepped |
2 | Low Range (low byte) | |
3 | Low Range (high byte) | |
4 | High Range (low byte) | (ignored if linear style = stepped) |
5 | High Range (high byte) | (ignored if linear style = stepped) |
Set Linear Graph Threshold
Configures a linear threshold. Up to 5 thresholds can be configured
Notes:
- If the current value is greater than the last threshold, then the last threshold is selected.
- The first threshold may have a threshold value >= 0; remaining thresholds must be > 0
CAN ID: Base + 41
Offset | What | Value |
---|---|---|
0 | Threshold ID | 0 - 4 |
1 | Segment Length | 0 -> # of LEDs on device (ignored if linear style is ‘smooth’) |
2 | Threshold (low byte) | |
3 | Threshold (high byte) | |
4 | Red | 0 - 255 |
5 | Green | 0 - 255 |
6 | Blue | 0 - 255 |
7 | Flash Hz | 0 - 10 (0 = full on) |
Update Current Linear Graph Value
Updates the current value for the linear graph
CAN ID: Base + 42
Offset | What | Value |
---|---|---|
0 | Value (low byte) | |
1 | Value (high byte) |
Notifications
Notifications related to events broadcasted from ShiftX3
Button State
Indicates a change in the button state
CAN ID: Base + 60
Offset | What | Value |
---|---|---|
0 | Button state | 1 = button is pressed; 0 = button |