{"id":415,"date":"2017-03-15T14:18:18","date_gmt":"2017-03-15T18:18:18","guid":{"rendered":"http:\/\/projectsofdan.com\/?p=415"},"modified":"2018-12-15T15:48:44","modified_gmt":"2018-12-15T20:48:44","slug":"racecapture-pro","status":"publish","type":"post","link":"https:\/\/projectsofdan.com\/?p=415","title":{"rendered":"RaceCapture Pro"},"content":{"rendered":"\n<p>Over the winter I decided to switch from my homemade digital dashboard solution to the Autosport Labs <a href=\"https:\/\/www.autosportlabs.com\/product\/racecapturepro-mk3\/\">RaceCapture Pro<\/a>. <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/projectsofdan.com\/wp-content\/uploads\/2018\/12\/MK3_3quarter-1024x768.jpg\" alt=\"\" class=\"wp-image-416\" width=\"351\" height=\"263\" srcset=\"https:\/\/projectsofdan.com\/wp-content\/uploads\/2018\/12\/MK3_3quarter.jpg 1024w, https:\/\/projectsofdan.com\/wp-content\/uploads\/2018\/12\/MK3_3quarter-300x225.jpg 300w, https:\/\/projectsofdan.com\/wp-content\/uploads\/2018\/12\/MK3_3quarter-768x576.jpg 768w, https:\/\/projectsofdan.com\/wp-content\/uploads\/2018\/12\/MK3_3quarter-624x468.jpg 624w\" sizes=\"auto, (max-width: 351px) 100vw, 351px\" \/><\/figure><\/div>\n\n\n\n<p>In terms of logging hardware, it includes a ton of features:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>8 12bit analog inputs<\/li><li>3 digital I\/O<\/li><li>4 timer inputs<br><\/li><li>10Hz GPS<\/li><li>3-axis accelerometer<\/li><li>2 CANBUS busses<\/li><li>RS-232<\/li><li>WiFi<\/li><li>Bluetooth<\/li><li>SD card storage<\/li><\/ul>\n\n\n\n<p>The other cool thing is that its designed for you to use a tablet as the dashboard display. The tablet connects to the main unit via bluetooth and looks something like this:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/wiki.autosportlabs.com\/RaceCapture_Dashboard_Tablet_Automation\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" src=\"https:\/\/wiki.autosportlabs.com\/images\/thumb\/1\/1a\/Dashboard_Automation_-_Example_Dash.JPG\/500px-Dashboard_Automation_-_Example_Dash.JPG\" alt=\"\"\/><\/a><\/figure><\/div>\n\n\n\n<p>There are many configuration options and you can have as many &#8220;screens&#8221; as you want so you can cycle through different displays as needed. <\/p>\n\n\n\n<p>In terms of software, the RaceCapture app can be run on a PC or even on the tablet itself. The idea is that after a session, you can pull out the dashboard tablet and check out the data. You can plot channels and compare laps.<\/p>\n\n\n\n<p>I ended up using the RaceCapture Pro mk3 connected to my water temp, oil temp, oil pressure, and TPS sensors. I used an Amazon Fire HD8 tablet as the dash as you can see here:<\/p>\n\n\n\n<p>The RCP system uses LUA scripting to configure much of the hardware and also to allow you to write custom vitual channel scripts. Here is the LUA script i wrote to setup my hardware as well as the ShiftX2 shift light. It also calculates speed based off of the E36&#8217;s differential speed sensor and gear based on speed and RPM.<br><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsetTickRate(10) --10Hz \n-- What CAN bus ShiftX2 is connected to. 0=CAN1, 1=CAN2\nsxCan = 1\n-- 0=first ShiftX2 on bus, 1=second ShiftX2 (if ADR1 jumper is cut)\nsxId=0\n--Brightness, 0-100. 0=automatic brightness\nsxBright=0\nsxCanId = 0xE3600 + (256 * sxId)\nprintln(&#039;shiftx2 base id &#039; ..sxCanId)\n--virtual channels \n--addChannel(&quot;name&quot;,SR,prec,min,max,&quot;unit&quot;) \nspeeddiff_id = addChannel(&quot;Speed_&quot;,10,0,0,160,&quot;MPH&quot;) \ngear_id = addChannel(&quot;Gear&quot;,5,0,0,5,&quot;gear&quot;) \nbrakeg_id = addChannel(&quot;BrakeG&quot;,10,2,0,2,&quot;G&quot;)\n--global constants \nfirst = 4.20 \nsecond = 2.49 \nthird = 1.66 \nfourth = 1.24 \nfifth = 1.00 \nfinal = 3.46 \ntirediameter = 24.7 \n--global variables \nrpm = 0 \nrpm_diff = 0 \nspeed = 0 \nfunction updateSpeedDiff() \n   rpm_diff = getTimerRpm(1) \n   speed = rpm_difftirediameter0.002975 \n   speed = speed + 0.5 -- round because 0 prec. truncates \n   setChannel(speeddiff_id, speed) \nend \nfunction updateGear() \n   rpm = getTimerRpm(0) \n   local gearErr = 0.15 \n   local gear = 0 \nif speed &gt; 2 then \n      ratio = rpm\/(rpm_diff*final) \n      if ((first  - ratio)^2) &amp;lt; (gearErr^2) then gear = 1 end \n      if ((second - ratio)^2) &amp;lt; (gearErr^2) then gear = 2 end \n      if ((third  - ratio)^2) &amp;lt; (gearErr^2) then gear = 3 end \n      if ((fourth - ratio)^2) &amp;lt; (gearErr^2) then gear = 4 end \n      if ((fifth  - ratio)^2) &amp;lt; (gearErr^2) then gear = 5 end \n   end \n   setChannel(gear_id, gear) \nend \nfunction autoLog() \n   if speed &gt; 10 and rpm &gt; 500 then \n      startLogging() \n   end \n   if speed &amp;lt; 5 and rpm &amp;lt; 100 then \n      stopLogging() \n   end \nend \nfunction sxOnUpdate()\n  --add your code to update ShiftX2 alerts or linear graph during run time.\n  --Runs continuously based on tickRate.\n--uncomment the below for Direct RPM on input 0\n  sxUpdateLinearGraph(getTimerRpm(0))\n--update engine temp alert\n  sxUpdateAlert(0, getAnalog(0))\n--update oil pressure alert\n  sxUpdateAlert(1, getAnalog(2))\nend\nfunction sxOnInit()\n  --config shift light\n  sxCfgLinearGraph(0,0,0,7000) --left to right graph, linear style, 0 - 7000 RPM range\nsxSetLinearThresh(0,0,4000,0,255,0,0) --green at 3000 RPM\n  sxSetLinearThresh(1,0,5400,255,255,0,0) --yellow at 5000 RPM\n  sxSetLinearThresh(2,0,6800,255,0,0,10) --red+flash at 6500 RPM\n--configure first alert (right LED) as engine temperature (F)\n  sxSetAlertThresh(0,0,215,255,255,0,5) --yellow warning at 215F\n  sxSetAlertThresh(0,1,225,255,0,0,10) -- red flash at 225F\n--configure second alert (left LED) as oil pressure (PSI)\n  sxSetAlertThresh(1,0,0,255,0,0,10) --red flash below 8 psi\n  sxSetAlertThresh(1,1,8,255,255,0,5) --yellow flash 8-12 PSI\n  sxSetAlertThresh(1,2,12,0,0,0,0) --above 12, no alert\nend\nfunction sxOnBut(b)\n  --called if the button state changes\n  println(&#039;button: &#039; ..b)\nend\n---ShiftX2 functions\nfunction sxSetLed(i,l,r,g,b,f)\n  sxTx(10,{i,l,r,g,b,f})\nend\nfunction sxSetLinearThresh(id,s,th,r,g,b,f)\n  sxTx(41,{id,s,spl(th),sph(th),r,g,b,f})\nend\nfunction sxSetAlertThresh(id,tid,th,r,g,b,f)\n  sxTx(21,{id,tid,spl(th),sph(th),r,g,b,f})\nend\nfunction setBaseConfig(bright)\n  sxTx(3,{bright})\nend\nfunction sxSetAlert(id,r,g,b,f)\n  sxTx(20,{id,r,g,b,f})\nend\nfunction sxUpdateAlert(id,v)\n  if v~=nil then sxTx(22,{id,spl(v),sph(v)}) end\nend\nfunction sxCfgLinearGraph(rs,ls,lr,hr) \n  sxTx(40,{rs,ls,spl(lr),sph(lr),spl(hr),sph(hr)})\nend\nfunction sxUpdateLinearGraph(v)\n  if v ~= nil then sxTx(42,{spl(v),sph(v)}) end\nend\nfunction sxInit()\n  println(&#039;config shiftX2&#039;)\n  setBaseConfig(sxBright)\n  if sxOnInit~=nil then sxOnInit() end\nend\nfunction sxChkCan()\n  id,ext,data=rxCAN(sxCan,0)\n  if id==sxCanId then sxInit() end\n  if id==sxCanId+60 and sxOnBut~=nil then sxOnBut(data&#x5B;1]) end\nend\nfunction sxProcess()\n  sxChkCan()\n  if sxOnUpdate~=nil then sxOnUpdate() end\nend\nfunction sxTx(offset, data)\n  txCAN(sxCan, sxCanId + offset, 1, data)\n  sleep(10)\nend\nfunction spl(v) return bit.band(v,0xFF) end\nfunction sph(v) return bit.rshift(bit.band(v,0xFF00),8) end\nfunction onTick()\n  updateSpeedDiff()\n  updateGear()\n  autoLog()\n  sxProcess()\nend\nsxInit()\n\n<\/pre><\/div>\n\n\n<p>See my latest RaceCapture LUA scripts on my <a href=\"https:\/\/github.com\/TXBDan\/RaceCapture-LUA\">Github<\/a>.<br><\/p>\n\n\n\n<p><br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Over the winter I decided to switch from my homemade digital dashboard solution to the Autosport Labs RaceCapture Pro. In terms of logging hardware, it includes a ton of features: 8 12bit analog inputs 3 digital I\/O 4 timer inputs 10Hz GPS 3-axis accelerometer 2 CANBUS busses RS-232 WiFi Bluetooth SD card storage The other [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[36],"class_list":["post-415","post","type-post","status-publish","format-standard","hentry","category-project-m3","tag-racecapture"],"_links":{"self":[{"href":"https:\/\/projectsofdan.com\/index.php?rest_route=\/wp\/v2\/posts\/415","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/projectsofdan.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/projectsofdan.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/projectsofdan.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/projectsofdan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=415"}],"version-history":[{"count":9,"href":"https:\/\/projectsofdan.com\/index.php?rest_route=\/wp\/v2\/posts\/415\/revisions"}],"predecessor-version":[{"id":429,"href":"https:\/\/projectsofdan.com\/index.php?rest_route=\/wp\/v2\/posts\/415\/revisions\/429"}],"wp:attachment":[{"href":"https:\/\/projectsofdan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=415"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/projectsofdan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=415"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/projectsofdan.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=415"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}