overpro Posted September 23, 2014 Posted September 23, 2014 (edited) Some people might have the interesting to implement their own EMI gauges, I did one in last year, I'm glad to share the source code and the PCB design. This is the demo thread: http://forums.eagle.ru/showthread.php?t=115997 First of the first, I'm just a web developer, and have very limited experience on MCU, PCB deisgn, so my work is not beautiful, don't argue me on that :joystick: License: The MIT License (MIT) export.lua: function LuaExportStart() udpEMI = socket.udp() udpEMI:setpeername( "192.168.1.105", 13135) //change the IP and port according to your env udpEMI:settimeout(0) end function LuaExportActivityNextEvent(t) --get the value of each EMI gauge and multiply a number, --the result is the required stepper motor's position, the driver IC is VID6606 --and stepper motor is VID29xx it's one step equals 1/12 degree if driven by VID6606, --for example, apu_temp gauge, it's maximum degree is 3120 / 12 = 260 degree. --the factor 3120 is just a estimated number, looking at the EMI gauge panel --it seems that the APU_TEMP 's pointer range is [0, 260] degree local mainPanel = GetDevice(0) udpEMI:send( string.format([[%c %.0f %.0f %.0f %.0f %.0f %.0f %.0f %.0f %.0f %.0f %.0f %.0f]], 1, mainPanel:get_argument_value(14) * 3120 , --apu_temp mainPanel:get_argument_value(13) * 2880 , --apu_rpm mainPanel:get_argument_value(83) * 3240 , --engOilPressureRight mainPanel:get_argument_value(82) * 3240, --engOilPressureLeft mainPanel:get_argument_value(85) * 3600, --engFuelFlowRight mainPanel:get_argument_value(84) * 3600, --engFuelFlowLeft mainPanel:get_argument_value(80) * 3240, --engCoreSpeedRight mainPanel:get_argument_value(78) * 3240, --engCoreSpeedLeft mainPanel:get_argument_value(77) * 3780 , --engFSIRight mainPanel:get_argument_value(76) * 3780 , --engFSILeft mainPanel:get_argument_value(73) * 3120, --engITTTenthRight mainPanel:get_argument_value(70) * 3120 --engITTTenthLeft )) arduino code is available on my github repo: https://github.com/calltherain/Arduino_DCSW_A10C_EMI detailed spec of VID6606 and VID29xx stepper motor: http://www.vidmotion.com/product.aspx?sortid=24 http://www.vidmotion.com/product.aspx?sortid=22 The PCB Schema and Boards files are here , It's KiCAD files: https://github.com/calltherain/VID6606_595 ps: I really love KiCAD, it's easy to learn and good enough, I'm using the binaries compiled by myself, you can download the source code and build it from here: https://launchpad.net/kicad-winbuilder Edited October 4, 2014 by overpro 1 overpro = I'm not good at Nintendo Mario and always get "Game over" pretty fast, so over~~pro
overpro Posted September 23, 2014 Author Posted September 23, 2014 occupied by myself for more information overpro = I'm not good at Nintendo Mario and always get "Game over" pretty fast, so over~~pro
Devon Custard Posted September 24, 2014 Posted September 24, 2014 Thats pro for all that, really appreciate you sharing.
bnepethomas Posted September 30, 2014 Posted September 30, 2014 Thanks for sharing OverPro, awesome work as always. Cheers Peter
bnepethomas Posted September 30, 2014 Posted September 30, 2014 A quick question - how do you work out the zero position of the gauge? I see some of the gauges offered support a zero sense. Thanks for sharing OverPro, awesome work as always. Cheers Peter
overpro Posted September 30, 2014 Author Posted September 30, 2014 A quick question - how do you work out the zero position of the gauge? I see some of the gauges offered support a zero sense. this stepper motor is tailored for gauge and has an internal block to limit the pointer to [0,315] degree, so no need to sense the zero position, just do a full range move is okay void GotoZero() { for( int i = 0; i < 315 * 12; i++) { sendCmdTo595_1( B00000000 ); sendCmdTo595_2( B00000000 ); sendCmdTo595_3( B00000000 ); sendCmdTo595_1( B01010101 ); sendCmdTo595_2( B01010101 ); sendCmdTo595_3( B01010101 ); delayMicroseconds(180); } } overpro = I'm not good at Nintendo Mario and always get "Game over" pretty fast, so over~~pro
agrasyuk Posted September 30, 2014 Posted September 30, 2014 This looks very good. Infact this looks so good you almost made me reconsider my decision to go with screen rendered EMI set. Thanks alot for your work Anton. My pit build thread . Simple and cheap UFC project
Warhog Posted October 1, 2014 Posted October 1, 2014 I did a quick search on the net but I cannot find anyone selling the driver chip 6606. The company that makes them does not list any suppliers and I don't think they would sell half a dozen of those chips to a lowly little cockpit builder. Do you have a contact that we can buy from ? The stepper motors, however, can be found on eBay. Regards John W aka WarHog. My Cockpit Build Pictures... My Arduino Sketches ... https://drive.google.com/drive/folders/1-Dc0Wd9C5l3uY-cPj1iQD3iAEHY6EuHg?usp=sharing WIN 10 Pro, i8-8700k @ 5.0ghz, ASUS Maximus x Code, 16GB Corsair Dominator Platinum Ram, AIO Water Cooler, M.2 512GB NVMe, 500gb SSD, EVGA GTX 1080 ti (11gb), Sony 65” 4K Display VPC MongoosT-50, TM Warthog Throttle, TRK IR 5.0, Slaw Viper Pedals
bnepethomas Posted October 1, 2014 Posted October 1, 2014 I did a quick search on the net but I cannot find anyone selling the driver chip 6606. The company that makes them does not list any suppliers and I don't think they would sell half a dozen of those chips to a lowly little cockpit builder. Do you have a contact that we can buy from ? The stepper motors, however, can be found on eBay. Not that I've been researching..... ;) http://www.aliexpress.com/store/product/Car-instrument-stepper-motor-driver-chip-general-vid6606-um12017/1046577_1573038281.html
bnepethomas Posted October 1, 2014 Posted October 1, 2014 this stepper motor is tailored for gauge and has an internal block to limit the pointer to [0,315] degree, so no need to sense the zero position, just do a full range move is okay void GotoZero() { for( int i = 0; i < 315 * 12; i++) { sendCmdTo595_1( B00000000 ); sendCmdTo595_2( B00000000 ); sendCmdTo595_3( B00000000 ); sendCmdTo595_1( B01010101 ); sendCmdTo595_2( B01010101 ); sendCmdTo595_3( B01010101 ); delayMicroseconds(180); } } Thanks Overpro, just so I've got it right, you can basically tell the gauge move -315 degrees irrespective of current position, and it'll stop nicely against the hard stop without any damage?
Duckling Posted October 1, 2014 Posted October 1, 2014 so my work is not beautiful, don't argue me on that :joystick: Who am I to judge ? ;-) Looks great and you way ahead of me, thanks for posting OverPro. - - - -
bnepethomas Posted October 2, 2014 Posted October 2, 2014 Hi Overpro Did you get your PCB manufactured? If so can we order the PCB from the manufacturer, my thoughts are if the silkscreen etc have already been done, might as well not reinvent the wheel. Cheers Peter
bnepethomas Posted October 2, 2014 Posted October 2, 2014 And another question, any specific Ethernet shield that has been better than others? cheers Peter
overpro Posted October 2, 2014 Author Posted October 2, 2014 Thanks Overpro, just so I've got it right, you can basically tell the gauge move -315 degrees irrespective of current position, and it'll stop nicely against the hard stop without any damage? That's correct, I attached some pics of this motor, there is an internal block to make it hard stop. Because it's designed for gauges so the torque is small and will not make any damage. And if you cut one or both of the blocks and polish it carefully the gauge pointer can go 360 degree full motion but in that case you might need to add some photoreflectors to detect the zero position. a pair (Black and White ) of internal blocks: overpro = I'm not good at Nintendo Mario and always get "Game over" pretty fast, so over~~pro
overpro Posted October 2, 2014 Author Posted October 2, 2014 Hi Overpro Did you get your PCB manufactured? If so can we order the PCB from the manufacturer, my thoughts are if the silkscreen etc have already been done, might as well not reinvent the wheel. Cheers Peter Not really, I just made one PCB by myself, it's ugly :(, but you might want to try my shared my PCB designs on first post, it's KiCAD files. You can use KiCAD to export the PCB to Gerber files and send them to a PCB manufactures to build some sample boards. And another question, any specific Ethernet shield that has been better than others? cheers Peter Oh ... I didn't noticed that there are more then one models available, Just checked my shield and the chip model is WIZnet W5100. overpro = I'm not good at Nintendo Mario and always get "Game over" pretty fast, so over~~pro
Deadman Posted October 2, 2014 Posted October 2, 2014 @ bnepethomas are you looking to build a replica engine cluster? @overpro your work looks great https://forum.dcs.world/topic/133818-deadmans-cockpit-base-plans/#comment-133824 CNCs and Laser engravers are great but they can't do squat with out a precise set of plans.
Hansolo Posted October 2, 2014 Posted October 2, 2014 Very nice Overpro. Thanks for sharing. A few small noob questions. It looks like a Wiznet W5100 ethernet shield you are using on a Arduino Mega. Do you know if it works with the Uno as well. Again thanks for sharing Cheers Hans 132nd Virtual Wing homepage & 132nd Virtual Wing YouTube channel My DCS-BIOS sketches & Cockpit Album
bnepethomas Posted October 3, 2014 Posted October 3, 2014 @ bnepethomas are you looking to build a replica engine cluster? Hi Deadman - not quite the cluster, I've got the Simmeters stack which I'm happy with, but do need a couple of others like AOA, and I also noticed on the stepper motor site, one of the motors has a zero position sensor for vehicle clocks. Ever since building the F16 I've wanted a clock with hands that follows the sim time, so this could be the perfect storm. Also have some quasi-evil thoughts about doing an F18 pit when that is released by DCS. Having something that is open-source project helps protect me against another manufacturer going wheels-up. Cheers Peter
bnepethomas Posted October 3, 2014 Posted October 3, 2014 That's correct, I attached some pics of this motor, there is an internal block to make it hard stop. Because it's designed for gauges so the torque is small and will not make any damage. And if you cut one or both of the blocks and polish it carefully the gauge pointer can go 360 degree full motion but in that case you might need to add some photoreflectors to detect the zero position. a pair (Black and White ) of internal blocks: Thanks hugely for this overpro, your sharing this is awesome. cheers Peter
bnepethomas Posted October 3, 2014 Posted October 3, 2014 Not really, I just made one PCB by myself, it's ugly :(, but you might want to try my shared my PCB designs on first post, it's KiCAD files. You can use KiCAD to export the PCB to Gerber files and send them to a PCB manufactures to build some sample boards. Oh ... I didn't noticed that there are more then one models available, Just checked my shield and the chip model is WIZnet W5100. And thanks for this, I like the UDP idea over serial, it frames the data and offers higher throughput, time to take the leap. On the PCB design, thanks for sharing that, I've installed the Kicad S/W (that pretty cool), just learning how to drive, next will be learning how to solder SMD components, which will be a mess :). cheers Peter
bnepethomas Posted October 3, 2014 Posted October 3, 2014 Hi Overpro I think there may be an additional file needed in the project. When I click on the .cmp file to open it in cvpcb, it is nable to find cdu.mod. Looking at the project preferences, I think its still hiding on your d:\projects\kicad\library\cdu ;) cheers Peter
overpro Posted October 3, 2014 Author Posted October 3, 2014 Hi Overpro I think there may be an additional file needed in the project. When I click on the .cmp file to open it in cvpcb, it is nable to find cdu.mod. Looking at the project preferences, I think its still hiding on your d:\projects\kicad\library\cdu ;) cheers Peter Sorry I didn't check the files carefully, now I have fixed the Kicad CvPCB symbol to footprint associations. Please pull the files from github again, and make sure you add the default symbol footprint libraries by using this method: 1. copy this file d:\kicad-winbuilder-3.4\kicad\share\template\fp-lib-table.for-github to this place, ( remove ".for-github" from the file name ) %userprofile%\appdata\roaming\kicad\fp-lib-table 2. restart KiCad, and open Schema file and open CvPCB, this may take a few seconds because CvPCB will go to github to download the footprint libraries. And you should good to go. Please let me know if it works or not. ps: I also uploaded the gerber files to github, just in case anyone who wants to have a try ASAP. overpro = I'm not good at Nintendo Mario and always get "Game over" pretty fast, so over~~pro
Marick Posted October 3, 2014 Posted October 3, 2014 Hi overpro, Thank you for your share. I don't understand how to connect ( CONN2 2 pin ) ( CONN3 3 pin ) to arduino pin? and how to connect ( CONN4 4 pin ) to stepper motor pin ? Can you clearly tell us the installation step? Otherwise, i can not find the file as below d:\kicad-winbuilder-3.4\kicad\share\template\fp-lib-table.for-github
overpro Posted October 4, 2014 Author Posted October 4, 2014 (edited) Hi overpro, Thank you for your share. I don't understand how to connect ( CONN2 2 pin ) ( CONN3 3 pin ) to arduino pin? and how to connect ( CONN4 4 pin ) to stepper motor pin ? Can you clearly tell us the installation step? Otherwise, i can not find the file as below d:\kicad-winbuilder-3.4\kicad\share\template\fp-lib-table.for-github Hi Marick, Below is the screen shot of the PCB view, connect your 5v power source to CONN 2 pin and be aware of the +(VCC) -(GND). For the CONN 3, connect CONN3-SER, SRCLK, RCLK to Arduino 22,23,24 or 25,26,27 or 28,29,30. Because one board controls 4 stepper motor, so 3 of this board can control 12 stepper motor which covers EMI panel. You can also attach just one board with one stepper motor to test your build. The CONN4 should be connect to stepper motor, if you are using the VID29xx or similar motor, the connection should be like this: I will post some pictures later to indicate the relationships between the 4 conn4 pins and the EMI gauges. Regarding the fp-lib-table.for-github, because I'm using the latest nightly build of KiCad, the project management is quite different compared to the downloaded Windows build which was released in 2013 July, I recommend you compile the KiCad by using KiCad-Winbuilder: https://launchpad.net/kicad-winbuilder Edited October 4, 2014 by overpro overpro = I'm not good at Nintendo Mario and always get "Game over" pretty fast, so over~~pro
bnepethomas Posted October 4, 2014 Posted October 4, 2014 Sorry I didn't check the files carefully, now I have fixed the Kicad CvPCB symbol to footprint associations. Please pull the files from github again, and make sure you add the default symbol footprint libraries by using this method: 1. copy this file d:\kicad-winbuilder-3.4\kicad\share\template\fp-lib-table.for-github to this place, ( remove ".for-github" from the file name ) %userprofile%\appdata\roaming\kicad\fp-lib-table 2. restart KiCad, and open Schema file and open CvPCB, this may take a few seconds because CvPCB will go to github to download the footprint libraries. And you should good to go. Please let me know if it works or not. ps: I also uploaded the gerber files to github, just in case anyone who wants to have a try ASAP. thanks again, I'll give it a go. cheers Peter
Recommended Posts