{"id":66,"date":"2013-08-26T01:27:45","date_gmt":"2013-08-25T14:27:45","guid":{"rendered":"https:\/\/www.newioit.com.au\/?p=66"},"modified":"2013-09-02T14:34:46","modified_gmt":"2013-09-02T03:34:46","slug":"project-replace-saitek-trim-wheel-internals-hack","status":"publish","type":"post","link":"https:\/\/www.newioit.com.au\/blog\/archives\/66","title":{"rendered":"Project &#8211; Saitek Trim Wheel Internals Replacement"},"content":{"rendered":"<h3>Downloads<\/h3>\n<p><a title=\"TrimWheel Schematic\" href=\"http:\/\/ubuntuone.com\/5fvVZow72VdW4SQIKjzCFJ\" target=\"_blank\">Eagle Schematic<\/a><\/p>\n<p><a title=\"Trim Wheel Source Code\" href=\"http:\/\/ubuntuone.com\/7hVP6NioeGAQAqanAaqwuY\" target=\"_blank\">Source Code<\/a> (91KB)<\/p>\n<p>The above is stable code for this Project, but new features may be added in my <a title=\"TrimWheel Source Repo\" href=\"https:\/\/www.newioit.com.au\/websvn\/listing.php?repname=group.electronics&amp;path=%2FProjects%2Ftrimwheel%2F&amp;#a7d403a2be98ae1810445b0687d1ccc19\" target=\"_blank\">SVN Repo<\/a>.<\/p>\n<h3>Introduction<\/h3>\n<p><a href=\"https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_complete-e1377429364354.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-medium wp-image-75\" alt=\"trimwheel_complete\" src=\"https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_complete-e1377429364354-223x300.jpg\" width=\"223\" height=\"300\" srcset=\"https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_complete-e1377429364354-223x300.jpg 223w, https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_complete-e1377429364354.jpg 529w\" sizes=\"auto, (max-width: 223px) 100vw, 223px\" \/><\/a><\/p>\n<p>Over a year ago, I purchased a <a title=\"Saitek Cessna Trimwheel\" href=\"http:\/\/www.saitek.com\/uk\/prod\/trimwheel.html\" target=\"_blank\">Saitek Cessna Trim Wheel<\/a>\u00a0to complement my Flight Simulator setup. At first it was a decent enough product, but over time took a number of USB resets to be recognised by Windows. Then not long after the warranty expired, it completely stopped being enumerated and would no longer work no matter what i tried. In stead of binning the device, and inspired my some of the mods that Tom at <a title=\"FSX Times\" href=\"http:\/\/fsxtimes.wordpress.com\/\" target=\"_blank\">FSX Times<\/a> gets up to; i decided to pop it open and see what i could do to repair it.<\/p>\n<p>Inside, it turned out to be a fairly straight forward setup. I small MCU, connected to an optical rotary encoder, using a plastic disc with notches cut around the outside to provide the mechanism (which in turn was connected to the actual trim wheel). After tracing out PCB tacks to produce a rough circuit diagram, it was time to see if the issue was with the MCU, or the optical RX\/TX components.<\/p>\n<div id=\"attachment_77\" style=\"width: 582px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_encoder_schematic.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-77\" class=\" wp-image-77   \" alt=\"trimwheel_encoder_schematic\" src=\"https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_encoder_schematic.jpg\" width=\"572\" height=\"315\" srcset=\"https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_encoder_schematic.jpg 706w, https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_encoder_schematic-300x165.jpg 300w, https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_encoder_schematic-624x343.jpg 624w\" sizes=\"auto, (max-width: 572px) 100vw, 572px\" \/><\/a><p id=\"caption-attachment-77\" class=\"wp-caption-text\">Rough sketch up the Saitek circuit<\/p><\/div>\n<p>The TX part of the encoder looked like a standard IR emitter, given only two of the four pins where connected, and it was running at 1.17V (Down from 5V via the 390 ohm resistor). The Opto Encoder however required a little more research, as i had not heard of these devices. I ended up coming across the <a title=\"HLC2701 datasheet\" href=\"http:\/\/ubuntuone.com\/1y7h4xsS4Av4Xb29loyEJz\" target=\"_blank\">HLC2701<\/a> IR detector. Reading the specs on this made me smile, as it outputs in quadrature; something i had been working with very recently making life a little easier. Given that the entire device wasn&#8217;t registering within Window, i figured it meant that the MCU would need to be replaced with my own. This also meant working with a USB interface (Something i hadn&#8217;t really done up until this point).<\/p>\n<div id=\"attachment_70\" style=\"width: 253px\" class=\"wp-caption alignleft\"><a href=\"https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_board_test_cables.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-70\" class=\" wp-image-70  \" alt=\"trimwheel_board_test_cables\" src=\"https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_board_test_cables-300x231.jpg\" width=\"243\" height=\"187\" srcset=\"https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_board_test_cables-300x231.jpg 300w, https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_board_test_cables-624x481.jpg 624w, https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_board_test_cables.jpg 996w\" sizes=\"auto, (max-width: 243px) 100vw, 243px\" \/><\/a><p id=\"caption-attachment-70\" class=\"wp-caption-text\">Two test wires soldered to the IR Detector<\/p><\/div>\n<p>Skipping ahead a little bit, i decided to check the RX\/TX part of the optical encoders. Being able to use those meant not having to create my own mounting hardware if by using the current board with mine piggy backed onto it. First up, I soldered a couple of wires to the output (A &amp; B) of the RX IR detector. This allowed me to easily hook it up to my Bitscope, and within a couple turns on the Trim Wheel, was registering a quadrature output from the two signals. With these confirmations, it was time to think about how I could piggy back my own device onto the the optical encoder, and how to fit it in the casing.<\/p>\n<p>Being the impatient sort, i decided to whip up a test circuit circuit based on my<a title=\"Examples \u2013 Rotary Encoders using PCINT\" href=\"https:\/\/www.newioit.com.au\/blog\/archives\/56\" target=\"_blank\"> Rotary Encoder Example<\/a>. My biggest concern at the this point was trying to get the ATTiny85 to talk to Windows as a USB HID Joystick. The quicker i had a playground to start testing with, the better.<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_schematic.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter  wp-image-83\" alt=\"trimwheel_schematic\" src=\"https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_schematic.png\" width=\"688\" height=\"352\" srcset=\"https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_schematic.png 688w, https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_schematic-300x153.png 300w, https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_schematic-624x319.png 624w\" sizes=\"auto, (max-width: 688px) 100vw, 688px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Testing the rotary encoder of the function was the quickest success I have had with any electrical project! The setup was receiving the quadrature output of the encoder on my first attempt, and re-invigorated me to pursue this hack.<\/p>\n<div id=\"attachment_73\" style=\"width: 609px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_breadboard.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-73\" class=\" wp-image-73  \" alt=\"trimwheel_breadboard\" src=\"https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_breadboard.jpg\" width=\"599\" height=\"484\" srcset=\"https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_breadboard.jpg 951w, https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_breadboard-300x242.jpg 300w, https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_breadboard-624x503.jpg 624w\" sizes=\"auto, (max-width: 599px) 100vw, 599px\" \/><\/a><p id=\"caption-attachment-73\" class=\"wp-caption-text\">Breadboard circuit hooked up to the Trim Wheel test wires.<\/p><\/div>\n<p>Next up was getting the circuit to talk to Windows! The original Saitek device talks to Windows via a Saitek propriety USB joystick driver. At this point, i didn&#8217;t know much about Windows USB drivers, so opted to use a Windows USB HID Joystick arrangement. This is essentially a descriptor file that lives on the USB device, that tells Windows what kind of data to expect, and what it means in terms of user input. This bypasses the need to a custom driver for every device (Mouses, Keyboards and generic joysticks all use this functionality).<\/p>\n<div id=\"attachment_81\" style=\"width: 310px\" class=\"wp-caption alignright\"><a href=\"https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_proto_finished.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-81\" class=\"size-medium wp-image-81 \" alt=\"Replacement prototype\" src=\"https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_proto_finished-300x212.jpg\" width=\"300\" height=\"212\" srcset=\"https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_proto_finished-300x212.jpg 300w, https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_proto_finished-624x443.jpg 624w, https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_proto_finished.jpg 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-81\" class=\"wp-caption-text\">Replacement prototype<\/p><\/div>\n<p>While researching USB HID and how this would work with an ATTin85 device, i came across the <a title=\"V-USB at obdev\" href=\"https:\/\/www.google.com.au\/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;cad=rja&amp;ved=0CC8QFjAA&amp;url=http%3A%2F%2Fwww.obdev.at%2Fvusb%2F&amp;ei=8QsaUvSAL6u0iQePxIGoDQ&amp;usg=AFQjCNG0U53oPM9WvuaOqlwjVQrx1ghS9Q&amp;sig2=3STkzMh4i65zdr-_OioSsQ&amp;bvm=bv.51156542,d.aGc\" target=\"_blank\">V-USB<\/a> project. This is essentially a USB 1.1 all firmware library for AVR&#8217;s, that would seem to fit the bill perfectly. I also came across this project from <a title=\"V-USB with ATtiny45 \/ ATtiny85 without a crystal\" href=\"http:\/\/codeandlife.com\/2012\/02\/22\/v-usb-with-attiny45-attiny85-without-a-crystal\/\" target=\"_blank\">Code and Life<\/a> using V-USB that provides the entire base template for my project (Both schematic and code!). Without both of these sources, i doubt this project would have ever seen the light of day!<\/p>\n<p>Fast forward through a lot of hacking and breaking things to get the HID descriptor working in Windows (And never plug a V-USB device into a USB3.0 hub, it just won&#8217;t work!), and I had a reasonably working replacement for the Saitek MCU. \u00a0The next few photo&#8217;s will show how to interface my replacement MCU with the Optical Encoder.<\/p>\n<div id=\"attachment_68\" style=\"width: 591px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_board_cut_tracks.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-68\" class=\" wp-image-68  \" alt=\"trimwheel_board_cut_tracks\" src=\"https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_board_cut_tracks.jpg\" width=\"581\" height=\"431\" srcset=\"https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_board_cut_tracks.jpg 1024w, https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_board_cut_tracks-300x222.jpg 300w, https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_board_cut_tracks-624x463.jpg 624w\" sizes=\"auto, (max-width: 581px) 100vw, 581px\" \/><\/a><p id=\"caption-attachment-68\" class=\"wp-caption-text\">The tracks between the RX pins and the MCU must be cut<\/p><\/div>\n<div id=\"attachment_69\" style=\"width: 618px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_board_solder_wires.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-69\" class=\" wp-image-69  \" alt=\"trimwheel_board_solder_wires\" src=\"https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_board_solder_wires.jpg\" width=\"608\" height=\"484\" srcset=\"https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_board_solder_wires.jpg 964w, https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_board_solder_wires-300x239.jpg 300w, https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_board_solder_wires-624x497.jpg 624w\" sizes=\"auto, (max-width: 608px) 100vw, 608px\" \/><\/a><p id=\"caption-attachment-69\" class=\"wp-caption-text\">A &amp; B output connections (White &amp; Grey), Ground (Blue) and +5V (Green) connections.<\/p><\/div>\n<div id=\"attachment_82\" style=\"width: 655px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_proto_test_quadgen.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-82\" class=\" wp-image-82 \" alt=\"trimwheel_proto_test_quadgen\" src=\"https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_proto_test_quadgen.jpg\" width=\"645\" height=\"484\" srcset=\"https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_proto_test_quadgen.jpg 1024w, https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_proto_test_quadgen-300x225.jpg 300w, https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_proto_test_quadgen-624x468.jpg 624w\" sizes=\"auto, (max-width: 645px) 100vw, 645px\" \/><\/a><p id=\"caption-attachment-82\" class=\"wp-caption-text\">Testing the board prior to installation<\/p><\/div>\n<p>After some thorough speed testing using my <a title=\"Tutorials \u2013 Quadrature Generator\" href=\"https:\/\/www.newioit.com.au\/blog\/archives\/34\" target=\"_blank\">Quadrature Generator<\/a> module and some testing in FSX, it was time to mount the new board in the Trim Wheel case, and put the thing to work. Although I had soldered the wires directly to the Saitek MCU board, i decided to use pin heads on my proto board in case i wanted to swap it out for a different version later. This also made it much easier to mount my proto board in side the case, as i didn&#8217;t have to connect the cables until it was all glued in place. The below image shows my final placement for the board, and the oodles of hot glue I used to hold it in place.<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_mounting02.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-79\" alt=\"trimwheel_mounting02\" src=\"https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_mounting02.jpg\" width=\"1024\" height=\"768\" srcset=\"https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_mounting02.jpg 1024w, https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_mounting02-300x225.jpg 300w, https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/trimwheel_mounting02-624x468.jpg 624w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p>Todo: Insert picture of HID Joystick in Windows<\/p>\n<h3>Conclusion<\/h3>\n<p>This project enabled me to revive my Trim Wheel which other wise would have been thrown in the bin, saving me $60, with about $7 worth of parts. This also gave me the knowledge i needed to develop USB devices, and led me to work with FSX SimConnect to enable much richer devices, which i&#8217;ll post about in the future (Or see the sneak peak picture below).<\/p>\n<p>My next version of the Trim Wheel will be tightly bound to FSX, instead of being a USB Joystick. This will allow me to pass back to the device the current location of the simulators trim wheel, removing the &#8216;absolute value&#8217; issues that joysticks have. (Basically where the Trimwheel snaps back to its previous location prior to disabling Auto Pilot).<\/p>\n<p>If there is anything I&#8217;ve left out here that you feel is needed to complete your own project, please let me know and i&#8217;ll update with greater detail.<\/p>\n<div id=\"attachment_85\" style=\"width: 616px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/commselector_sneak_peak.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-85\" class=\"size-full wp-image-85\" alt=\"commselector_sneak_peak\" src=\"https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/commselector_sneak_peak.jpg\" width=\"606\" height=\"529\" srcset=\"https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/commselector_sneak_peak.jpg 606w, https:\/\/www.newioit.com.au\/blog\/wp-content\/uploads\/2013\/08\/commselector_sneak_peak-300x261.jpg 300w\" sizes=\"auto, (max-width: 606px) 100vw, 606px\" \/><\/a><p id=\"caption-attachment-85\" class=\"wp-caption-text\">Sneak peak of my up coming FSX project: The Audio Comms Selector<\/p><\/div>\n<h3>Gallery of All Pictures For This Project<\/h3>\n<p>[flagallery gid=4]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Downloads Eagle Schematic Source Code (91KB) The above is stable code for this Project, but new features may be added in my SVN Repo. Introduction Over a year ago, I purchased a Saitek Cessna Trim Wheel\u00a0to complement my Flight Simulator setup. At first it was a decent enough product, but over time took a number [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,5,1],"tags":[],"class_list":["post-66","post","type-post","status-publish","format-standard","hentry","category-electronics","category-projects","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.newioit.com.au\/blog\/wp-json\/wp\/v2\/posts\/66","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.newioit.com.au\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.newioit.com.au\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.newioit.com.au\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.newioit.com.au\/blog\/wp-json\/wp\/v2\/comments?post=66"}],"version-history":[{"count":5,"href":"https:\/\/www.newioit.com.au\/blog\/wp-json\/wp\/v2\/posts\/66\/revisions"}],"predecessor-version":[{"id":94,"href":"https:\/\/www.newioit.com.au\/blog\/wp-json\/wp\/v2\/posts\/66\/revisions\/94"}],"wp:attachment":[{"href":"https:\/\/www.newioit.com.au\/blog\/wp-json\/wp\/v2\/media?parent=66"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.newioit.com.au\/blog\/wp-json\/wp\/v2\/categories?post=66"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.newioit.com.au\/blog\/wp-json\/wp\/v2\/tags?post=66"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}