Gilrock Posted April 15, 2013 Share Posted April 15, 2013 I've never tried WPF but I can say that databinding is available in standard windows forms. I use it all the time in GUI's I develop. Like I have one I'm working right now that controls a focuser on a large 1.6 meter telescope. I have a focuser class with a Connected property and a Position property. Using databinding I have all the controls on the focuser's GUI page greyed out and as soon as the Connected property goes true they all automagically enable. And I have a seven segment display control that shows the focuser position and it automatically updates whenever the Position property of the focuser class changes. You just need to implement INotifyPropertyChanged for your class and have each property do the notification in the set part of the property. Gil Link to comment Share on other sites More sharing options...
gyom Posted April 15, 2013 Share Posted April 15, 2013 Hi Gyom,Been out of the scene for a little bit, but this caught my eye. While I have a plunger on my cab, I never really did anything with it. I was always looking for the best way to create a virtual plunger (The hardware specifically). This high hat controller looks like a cool idea. Think I understand the principle of variable resistance but, how do you intend to interface these led's with your pc? I'd love to see pics and hear your feedback on how well it works out when completed. Well since I'm working on an Arduino controller, I'll be able to hook the plunger on it! The hardware and Arduino part will be the easiest I think. The led circuit is pretty standard and you just have to hook it on one of the Arduino's analog pin. Since the plunger is a big spring, the sliding mecanism is already present, it's just a matter of figuring out the best way to hide/show the leds. The easy way would be to put the plunger in a box with 2 holes (for both leds) at an angle where when the plunger is at "rest", the rod blocks the way (so no light from the led to the receiver), and when the spring is fully pull, the rod is not blocking any light (full light from led to receiver). A bit like that Reading the value is almost the same thing I've already did so far. The hardest part (as always with Visual pinball), is how I'm gonna convert the inputs into something VP can understand. I'll have to find what VP can handle actually accept as plunger input, I haven't had the time so far. But the easiest would be to emulate a mouse movement (or mouse wheel up/down). Link to comment Share on other sites More sharing options...
maxxsinner Posted April 16, 2013 Share Posted April 16, 2013 There are a few working on plunger designs including myself gyom and I might be able to help with some information. The original Mot-ion plunger was an infrared distance sensor similar to what you are trying to make but the sensor and receiver were installed at the end of the plunger, using the tip of the plunger to bounce the infrared signal back to the receiver. As most will tell you this was less than reliable. They have redone the design with either a LVDT type of sensor or a hall effect sensor. I have not had the chance to have a good look at the new design to ascertain which it is. I have tried with ultrasonic’s, IR sensors and home made LVDT's with mixed results. LVDT is going to be the most accurate type of linear sensor that could be done, but implementing is the difficult part as my goal is to design something that people could make at home themselves. Ultrasonics polling rate is too slow to pick up quick motion on the plunger when it is released and infrared was reasonably accurate, but came with the same problems that the Mot-ion plunger had; calibration errors, unreliable action, etc. If you are looking to do a simple switch rather than analouge, a small induction sensor would be the easiest way. As for converting the input to something VP can understand, I recommend starting with the teensy USB board. You can configure it to act as a gamepad so an analogue signal will work as a plunger on the Z axis with just a little calibration. VP will recognize it and work straight away. If you are looking to just do a simple switch, the teensy can act as a keyboard and be configured as the enter key. Good luck with your design. Hope this info helps. Link to comment Share on other sites More sharing options...
samwyze Posted April 17, 2013 Share Posted April 17, 2013 There are a few working on plunger designs including myself gyom and I might be able to help with some information. The original Mot-ion plunger was an infrared distance sensor similar to what you are trying to make but the sensor and receiver were installed at the end of the plunger, using the tip of the plunger to bounce the infrared signal back to the receiver. As most will tell you this was less than reliable. They have redone the design with either a LVDT type of sensor or a hall effect sensor. I have not had the chance to have a good look at the new design to ascertain which it is. I have tried with ultrasonic’s, IR sensors and home made LVDT's with mixed results. LVDT is going to be the most accurate type of linear sensor that could be done, but implementing is the difficult part as my goal is to design something that people could make at home themselves. Ultrasonics polling rate is too slow to pick up quick motion on the plunger when it is released and infrared was reasonably accurate, but came with the same problems that the Mot-ion plunger had; calibration errors, unreliable action, etc. If you are looking to do a simple switch rather than analouge, a small induction sensor would be the easiest way. As for converting the input to something VP can understand, I recommend starting with the teensy USB board. You can configure it to act as a gamepad so an analogue signal will work as a plunger on the Z axis with just a little calibration. VP will recognize it and work straight away. If you are looking to just do a simple switch, the teensy can act as a keyboard and be configured as the enter key. Good luck with your design. Hope this info helps. I've been looking for a way to get more reliable results from an ir based input, do you have any suggestions/insight? Or do you think this is a dead-end route? Link to comment Share on other sites More sharing options...
maxxsinner Posted April 18, 2013 Share Posted April 18, 2013 Hey samwyze. I had a tinker with the IR and got some good results. Turned off the PC, teensy board etc.... came back the next day and the calibration was all out?? So basically had to start again. Could not work out what was causing it at all and ended up moving onto the LVDT as that is the one I would really like to get going. Certainly not a dead end route in my opinion, may just need further refinement. Seems odd that Mot-ion has moved away from the IR unless they could not work out the calibration problem. Link to comment Share on other sites More sharing options...
gyom Posted April 18, 2013 Share Posted April 18, 2013 Thanks for the reply maxx! The thing is that I'm trying to get both inputs and outputs with my Arduino, so the 2nd board option is not good for now. But I might have found a better idea to my plunger, once again based on my megadrum project: piezzo. It would be so easy.. a plunger, an 'L' bracket, a piezzo and a bit of foam so the rod don't strike the piezzo directly. It would be exactly like a stick strike on a drum! Link to comment Share on other sites More sharing options...
gyom Posted April 19, 2013 Share Posted April 19, 2013 (edited) As for my "problem" with my input conversion of the Arduino's data to something VP can understand.. I found a nice solution. So far I was using a dll that injected keypresses directly into the DirectX input buffer with a mechanism that made sure VP was always the active window. It was working great, but only working for emulating a keyboard or a mouse, which doesn't help for my analog plunger and nudge. After a lot of research, I found a nice little software: vJoy. It's a virtual joystick driver that windows recognize as a real joystick (and so does VP). It comes with an SDK (dll) that allow to control it from code. So I changed my test code to implement it and it works great! And it's so much easier.. no need to inject keys or setfocus to VP thru weird complicated code. Just acquire the joystick and change the buttons status. The bonus? Since a joystick, it as XYZ axis (even more with rotation and POV). Problem solved! Edited April 19, 2013 by gyom Link to comment Share on other sites More sharing options...
shifters67 Posted April 20, 2013 Share Posted April 20, 2013 Hi Gyom, seems like your going great with this - sort out a dll for me to interface directly with VP events to my C# client at the same time If i could sort that out we could merge code bases and could have all the functionality in one device - or two! My code will use the uarts to cascade events to multiple boards from the PC but not really set up the opposite way yet - worth thinking about. Shifters Link to comment Share on other sites More sharing options...
maxxsinner Posted April 21, 2013 Share Posted April 21, 2013 Nice work gyom. That vJoy looks very interesting. Chuck an ADXL335 accelerometer for nudge and you will be ready to go. Link to comment Share on other sites More sharing options...
gyom Posted April 21, 2013 Share Posted April 21, 2013 Nice work gyom. That vJoy looks very interesting. Chuck an ADXL335 accelerometer for nudge and you will be ready to go. Thanks maxx! That's exactly what I've beeing looking for in the last couple of days! And it's pretty cheap, 4$ free shipping on ebay.. with the Arduino, will be pretty easy to convert the data into vJoy XY axis. As for the nudging.. I think I'll try the piezo! And I've think of an other option.. for more "real feeling" of hitting a ball with the plunger: Add a real ball! The way I see it, at the end of the plunger, I could add a real ball with a small track of about maybe 5-6 inches and add at the piezo at the end of that track, once again protected by foam/plate combo like a virtual drum (think rockband drum lol). So you would hit the ball and the ball hit the piezo. It would add a little lag between the strock and the actual input, but I'm pretty sure it would be quite small for the amount of feel it would add. The really thing, would be to be able to see the ball behind the glass and see it "continue" it's way of the table. But that would require changing the tables to hide the plunger.. too complicated for now lol. If people are interested in my code, I can add it to my project on github. It's still a "test/hardcoded" project, but if some of you are interested on how to implement the Arduino/vJoy.. I'll gladly share it! Link to comment Share on other sites More sharing options...
maxxsinner Posted April 21, 2013 Share Posted April 21, 2013 If I am reading correctly gyom, the piezo and led setups that you have been showing will work as a switch, not analogue? The LED will simulate a keypress when the plunger is pulled back far enough to allow the sensor to see the IR LED and with the piezo will need to be hit to trigger the plunger? A simple inductive sensor would be easy and cheap like this one here - http://www.ebay.com.au/itm/LJ12A3-4-Z-BY-Inductive-Proximity-Sensor-Detection-Switch-PNP-DC6-36V-12MM-FV88-/140904989838?_trksid=p3284.m263&_trkparms=algo%3DSI%26its%3DI%26itu%3DUCI%252BRTU%26otn%3D21%26pmod%3D290671992004%26ps%3D54 Link to comment Share on other sites More sharing options...
gyom Posted April 21, 2013 Share Posted April 21, 2013 No, I was thinking of putting only the piezo without the led, and reading the piezo with one of Arduino's analog pin. Depeding on the force (how for you pull the plunger), the Arduino code should be able to tell the difference in velocity since the piezo reacts like an variable resistance. I'm not sure how VP works with analog plunger tho since I've never . I know it's working with the 'Z' axis, so I was thinking that I could translate the voltage difference (impact) and translate it into z-axis data on the vJoy. Link to comment Share on other sites More sharing options...
maxxsinner Posted April 21, 2013 Share Posted April 21, 2013 Interesting idea there gyom. So it would react an instant spike for the plunger as the voltage peaks. Nice way to think outside the box. Link to comment Share on other sites More sharing options...
gyom Posted April 21, 2013 Share Posted April 21, 2013 Exactly! The voltage spike should read more or less depending on the force the strike! Cheap and easy (piezo are like what, 25-50 cents?). The easy setup would only require an 'L' braket and a piezo while the "complex max feeling setup" would require some kind of small wood track with the piezzo at the end, and an actual pinball. Now I just need to find a plunger to test both ways.. lol! Link to comment Share on other sites More sharing options...
gyom Posted April 21, 2013 Share Posted April 21, 2013 (edited) I've updated my code in my github project: https://github.com/gui999/ArduiPin (visual studio 2010) REMEMBER, this should only be considered only as a proof of concept right now.. while I've tried to remove it, there's still hardcoding involved. The best example are the pin #. I've uploaded the code for the curious out there that want to know how I've managed to link my Arduino with vJoy to interact with VP. A LOT of things not implemented yet in the C# code.. like outputs (I have no way to test right now), analog inputs, etc. So a LOT of TODO. The "digital/button" inputs work great. ZERO lag between a button push and the resulting event in VP. Hope the code is readable enough! Edited April 21, 2013 by gyom Link to comment Share on other sites More sharing options...
mouse Posted May 12, 2013 Share Posted May 12, 2013 Is the DUEs 3.3v VS 5v a large thing to overcome? I would think the faster proc, bigger flash, and more I/O's would be very nice. Plus they are cheaper than the Mega are. I am going to be buying the Arduino for my cabinet soon, and am really considering the Due but don't want to buy a board that is going to be a dead end for this project. So EXCITED!! Link to comment Share on other sites More sharing options...
shifters67 Posted May 12, 2013 Share Posted May 12, 2013 Hi all, if there is interest i can post my arduino code (but no where to host it - can this site take zips?) It has lots of functionality and lots of fancy led effects (see elsewhere in this thread for what is supported). regards Shifters Link to comment Share on other sites More sharing options...
jeepguy81 Posted May 12, 2013 Share Posted May 12, 2013 Heck yeah please do post, or host in some fashion. Sent from my SPH-L710 using Tapatalk 2 Link to comment Share on other sites More sharing options...
maxxsinner Posted May 12, 2013 Share Posted May 12, 2013 Hi all,if there is interest i can post my arduino code (but no where to host it - can this site take zips?) It has lots of functionality and lots of fancy led effects (see elsewhere in this thread for what is supported). regards Shifters Still no word from Pixel shifters?? Link to comment Share on other sites More sharing options...
viriiguy Posted May 13, 2013 Share Posted May 13, 2013 Hi all,if there is interest i can post my arduino code (but no where to host it - can this site take zips?) It has lots of functionality and lots of fancy led effects (see elsewhere in this thread for what is supported). regards Shifters Contact Dazz. I suspect he can host it for you. Link to comment Share on other sites More sharing options...
rockyrocket Posted May 13, 2013 Share Posted May 13, 2013 Still no word from Pixel shifters?? Damn shame if he is permanently off the grid. Was looking forward to seeing what was to come. Link to comment Share on other sites More sharing options...
gyom Posted May 14, 2013 Share Posted May 14, 2013 (edited) My work is at a stand still right now since I switched into cabinet building mode! I will be easier to test the outputs if I actually have outputs to tests.. lol (and I have still no way to grab events from pinmame)! And it takes time to received my components. I buy everything on ebay from China and it takes 3 weeks each time. I'm also taking pictures and I'll post a blog soon for those interested in my "arduipin" build. I'm thinking if I could switch my Arduino into an HID joystick. It would make it easier in one way since it wouldn't require the "vJoy" since it would be recognized as an actual joystick, but would make it harder to code and test since it require to flash back and forth each time you want to update the code (flash to "arduino mode" to update the code, flash to "HID device" to test the code). Edited May 14, 2013 by gyom Link to comment Share on other sites More sharing options...
Dazz Posted May 15, 2013 Share Posted May 15, 2013 Just PM me and let me know what exactly you need. Link to comment Share on other sites More sharing options...
shifters67 Posted May 15, 2013 Share Posted May 15, 2013 Still no word from Pixel shifters?? Hi Maxx, no its all gone quiet from Pixel! Shifters Link to comment Share on other sites More sharing options...
shifters67 Posted May 15, 2013 Share Posted May 15, 2013 Just PM me and let me know what exactly you need. PM sent! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now