New project - MSFS C++ USB interface


+ Reply to Thread
Results 1 to 40 of 163

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,677


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    I really enjoy programming, and now even more so cause I hate being a buyer. Looking for an item, getting to field the same questions; comparing prices, it's so tedious. Really happy I know how to use a spreadsheet. And I have to be careful not to give wrong specs, I keep copy-paste of a lot of my replies. I've been doing supplier research for over 2 weeks now, and I'm royally fed up with this part of the project.

    I've been moving "my stuff" from a small room to half my basement; you know, that part of the house that you accumulate garbage over 30 years and 3 kids. Well I've cleaned up nearly 1/2 of my new area; PC and printer is back up and running. I didn't even take the time to paint the cement floor, or finish the gyproc walls; I've spent enough time moving my daughter in, then back out a few days later. :/

    I've got most of my shelves and storage bins set up, but I don't have a soldering workspace up yet and that really bugs me. I'm taking a bit of time to make a special area for the 3D printer, a secondary PC and my pet project; a custom CNC machine to fabricate PCB boards, plastic parts, that sort of thing.

    The cost of PCB boards is just insane now; even tiny ones. I figure I'll cover the cost fabricating my own milling machine with this first model. I don't need anything fancy; just X, Y and Z axis for now. I know I'll want pick-and-place one day, same with an automated tool changer, but those things can wait.

    It's nice to be able to test designs soooooo much faster. It won't be as nice a professional PCBs, but I know it'll work for a fraction of the cost. Darn, even if I go back to chemical etching, it's still cheaper and faster than waiting 1 week for the DigiKey special offer.

    I was getting "good enough" at PCB fabrication too; and this time I have a LOT of space to set myself up properly. Like install my own kitchen vent that evacuates fumes outside, instead of working on the kitchen stove. I can use that for a tiny paintbooth as well. And there's been progress in the DIY PCB fabrication world; guys are now finishing their boards green (that has to be cheaper and less "fumy" than the silver coating I was dipping mine in, some even doing silkscreen.

    Only downside, I had to disassemble my pool table. ;(

    Robert

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,866


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    I am done with the DIY pcb, chemicals and drilling... Enough fumes, dust and stains!

    A CNC machine is nice to have, for various other uses also, among pcb and drilling, but not for me anymore.

    Now I use the dirty cheap and ultra fast JLCPCB for any pcb needs.

    Ioannis

  3. #3
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,677


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    I'm gonna check out JLCPCB once I have a circuit ready.

    Right now I'm finishing up buying parts; just need those rocker switches and some graphic overlay for backlit text.

    On the positive side, I'm well on my way repossessing my basement from all that junk I've accumulated.

    Finally got to work on my new workbench debugging why that LED wasn't turning on as it should.

    Robert

    Last edited by Demon; - 22nd July 2023 at 02:44.

  4. #4
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,677


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    I'm a visual person, I like to see what I'm doing as opposed to relying exclusively on drawings and schematics (although I do enjoy making them).


    This is what I'm doing right now; the communication & navigation panel (COM1, COM2, NAV1 and NAV2).




    This is a quick layout of the parts I've bought (that's about 9 inches wide, 8 inches tall).




    The TEST button was integrated in the volume button in-game. I couldn't afford potentiometers with a push-button, so I added a separate black button

    The rotary encoders I'm using to change frequency have a built-in push-button switch; that way I don't need a dual knob arrangement (again, more expensive).

    Yeah, those squiggly pink circles will be LEDs later in life.

    Robert
    Last edited by Demon; - 23rd July 2023 at 19:02.

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,866


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    All these pots, displays, switches etc, will be inerfaced to PIC microcontrollers and then to the PC running the simulator?

    Ioannis

  6. #6
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,677


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    Quote Originally Posted by Ioannis View Post
    All these pots, displays, switches etc, will be inerfaced to PIC microcontrollers and then to the PC running the simulator?

    Ioannis
    That's the plan.
    🙃
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  7. #7
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,866


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    Wish I was closer to your location. An amazing project this will be!

    Ioannis

  8. #8
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,677


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    Quote Originally Posted by Ioannis View Post
    I am done with the DIY pcb, chemicals and drilling... Enough fumes, dust and stains!

    A CNC machine is nice to have, for various other uses also, among pcb and drilling, but not for me anymore.

    Now I use the dirty cheap and ultra fast JLCPCB for any pcb needs.

    Ioannis
    I went the chemical way 14 years ago; not doing that again. I had SOIC SMD parts and it worked, but I'm too old to breath fumes.


    This is my 2nd attempt on my mini-CNC. I royally screwed up the mirror operation on the 1st attempt.

    Top:


    Bottom:


    Still need to get fine steel wool to finish the job, dip in silver nitrate, and test text with inkjet printer transfer paper.

    Robert
    Last edited by Demon; - 22nd October 2023 at 00:35.

  9. #9
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,677


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    I think the secret to making nice double-sided PCBs on a mini-CNC is to establish a procedure. This is what I do on the mini-CNC:

    Code:
    1. Install 3.175mm drill bit.
    2. Home X, Y and Z axis.
    3. Probe Z-axis.
    4. Drill Left Alignment Holes.
    5. Drill Right Alignment Holes.
    
    6. Install 30deg V-bit.
    7. Probe Z axis.
    8. Height-map PCB, if required.
    9. Route Top layer.
    
    10. Install 0.8mm endmill bit.
    11. Probe Z axis.
    12. Route Top layer Cutout.
    
    13. Flip PCB using Alignment Pins.
    
    14. Install 30deg V-bit.
    15. Probe Z axis.
    16. Route Bottom layer.
    
    17. Install drill bit.
    18. Probe Z axis.
    19. Drill Bottom layer.
    
    ... repeats steps 12 - 14 for all Drill files
    
    20. Install 2 Retention Pins in Screw Holes.
    
    21. Install 0.8mm endmill bit (Make sure drill clears Retention Pins).
    22. Probe Z axis.
    23. Route Bottom layer Cutout.
    I take notes while I'm using the machine, and improve on the process.

    This is what I do to generate the G-code files from FlatCAM:

    Code:
    =========================== FlatCAM ===========================
    
    Start WinPythonPowershell
    
    cd ..
    cd ..
    cd flatcam
    python .\flatcam.py
    
    
    ========== Do Height Map before drilling, if required. ==========
    
    
    	*** do not import Drill file for 3 Fiducials ***
    
    
    ****************** Alignment Holes and Mirror ******************
    
    Generate Drill files and Mirror Bottom:
    	- select MechanicalNofiducial file.
    	- click on 2-Sided.
    	- Axis = X.
    	- Reference = Box.
    
    	- click on Gerber.
    	- Select Bottom layer.
    	- click on Mirror.
    
    	- click on Excelon.
    	- Select Drill file.
    	- click on Mirror.
    	...
    	- repeat for all Drill files.
    
    	- Drill Dia = 3.175mm.
    
    	- point on desired coordinates Upper Left above Outline.
    	- Shift + Left Click.
    	- click Create Excelon Object.
    
    	- point on desired coordinates Upper Right above Outline.
    	- Shift + Left Click.
    	- click Create Excelon Object.
    
    	- select 1st Alignment Hole Drill file.
    	- click Properties.
    	- rename to "1 - Alignment_Holes_L_3.175mm".
    	- click Drilling.
    	- Cut Z = -10.0mm.
    	- Travel Z = 1.0mm.
    	- Feedrate = 25mm/min.
    	- SpindleSpeed = 7500rpm.
    	- Start Z = 1mm.
    	- EndMove Z = 1mm.
    	- EndMove X,Y = 0,0.
    	- Preprocessor = GRBL_11_No_M6.
    	- Click GenerateCNCjob Object.
    
    	- select new Alignment CNC Job.
    	- Save CNC job (include drill dia and side in file name).
    	...
    	- repeat for 2nd Alignment Hole Drill file with:
    	  - "2 - Alignment_Holes_R_3.175mm",
    	  - EndMove Z = 25mm.
    
    	- Save Project.
    
    
    ************************ Milling Layer ************************
    
    Generate Geometry file:
    	- hide all other layers.
    	- select Gerber file for Top layer.
    	- click Properties.
    	- click Isolation Routing - Advanced.
    	- click Calculators, if necessary:
    		- Tip Diameter = 0.1mm
    		- Tip angle = 30deg.
    		- Cut Z = -0.1mm
    		- click Calculate.
    		- Copy Tool Diameter of 0.1536mm.
    	- Paste Tool Diameter.
    	- Shape = C1, circular with 1 flute.
    	- Passes = 2.
    	- Overlap = 20%.
    	- Enable Combine.
    	- Click Generate Geometry.
    
    	- Save Project.
    
    Generate CNC file:
    	- Select Geometry file.
    	- click Properties.
    	- click Milling - Advanced.
    	- Tool Dia = 0.1536mm.
    	- Job = Isolation.
    	- Cut Z = -0.1mm
    	- Travel Z = 1mm.
    	- Feedrate X-Y = 120mm/min - 140mm/min.
    	- Feedrate Z = 10mm/min - 12mm/min.
    	- Spindle Speed = 9500rpm - 12000rpm.
    	- EndMove Z = 25mm.
    	- EndMove X,Y = 0,0.
    	- Preprocessor = GRBL_11_no_M6.
    	- click Generate CNCjob Object.
    	- Save CNC job (include mill shape in file name).
    
    	- Save Project.
    	...
    	- repeat 2 steps for Bottom layer.
    
    
    *************************** Holes ***************************
    
    Generate Drill file:
    	- select excelon file for alignment holes.
    	- click Properties.
    	- click Drilling - Advanced.
    	- Cut Z = -2.0mm (small), -3.0 (large), -10.0 (Retention Pins).
    	- Travel Z = 1.0mm; height above PCB for traveling.
    	- Feedrate = 25mm/min (large) to 40mm/min (small).
    	- SpindleSpeed = 7500rpm.
    	- Start Z = 1mm; height when operation starts.
    	- EndMove Z = 25mm; height to raise after operation.
    	- EndMove X,Y = 0,0; return to origin.
    	- Click GenerateCNCjob Object.
    	- Save CNC job (include drill dia in file name).
    
    	- Save Project.
    
    
    ************************** Cut-out **************************
    
    Generate Geometry file:
    	- hide all other layers.
    	- select Gerber file for MechanicalNofiducial.
    	- click Properties.
    	- click Cutout - Advanced.
    	- Tool Diameter = 0.8mm.
    	- Cut Z = -0.5mm (top layer), -1.3mm (bottom layer).
    	- Passes = 0.10mm.
    	- Margin = 0.
    	- Gaps = None.
    	- Click Generate Geometry.
    
    	- Save Project.
    
    Generate CNC file:
    	- Select Geometry file.
    	- click Properties.
    	- click Milling - Advanced.
    	- Tool Diameter = 0.8mm.
    	- Job = Finishing.
    	- Cut Z = -0.5mm (top layer), -1.3mm (bottom layer).
    	- Multi Depth = enabled, 0.1mm - 0.15mm.
    	- Margin = 0mm.
    	- Gaps = None.
    	- Travel Z = 1mm.
    	- Feedrate X-Y = 100mm/min - 360mm/min.
    	- Feedrate Z = 10mm/min - 30mm/min.
    	- Spindle Speed = 9500rpm - 12000rpm.
    	- EndMove Z = 25mm.
    	- EndMove X,Y = 0,0.
    	- Preprocessor = GRBL_11_no_M6.
    	- click Generate CNCjob Object.
    	- Save CNC job (include endmill shape in file name).
    
    	- Save Project.
    There's been a lot of tweaking and adjusting since day 1. Most of those values are now set as the default values in FlatCAM. I have a lot less room for errors, except in things like trace isolation and PCB cut-outs; I use Milling operation for both of them, but use a V-bit for isolation, and an endmill for cutting out the board. Those 2 bits don't use the same speeds.

    Robert
    Last edited by Demon; - 22nd October 2023 at 01:32.

  10. #10
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,866


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    Nice PCB, though it needs sanding as you noted.

    The steps to reach your goal will be valuable for a newbie on the field of CNCing a pcb.

    For one off is great. Do you know what is the smallest part you can do with your CNC?

    Ioannis

  11. #11
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,677


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    Quote Originally Posted by Ioannis View Post
    Nice PCB, though it needs sanding as you noted.
    ...
    Do you know what is the smallest part you can do with your CNC?

    Ioannis
    Thanks.

    Well, I know this can handle SOIC easily. I'm sure this could handle SSOP. The only limitation is me; my hands shake a bit now. I got some of that low-melt solder and a new hot-air gun to test some SSOP.

    Last weekend I found out that QCAD doesn't have any means of milling slots; so that meant finding another PCB design software. After 30 minutes of research, I had already decided KiCAD was the one to try first. Reviews on the web gave it very high marks, and deservedly so. Took me only 2 days to get "comfy" with it; I love it, very powerful. I had to redo that circuit above from scratch; which was a good learning experience. It gave me a chance to put the 2 screws in a diagonal arrangement, with 2 headers in the opposite corners for stability.

    I uploaded my new design to JLCPCB for the fun of it; just to get an idea on the upcoming costs. 26mm x 18.5mm, panelized 10 rows x 10 columns (even 100 per sheet), 5 sheets. Check this out, $22 excluding shipping. I'm not even gonna bother shopping elsewhere.


    (updated with the silkscreen, paste and mask files for both sides; turns out that's all included in the price)

    I have 6 of these "switch/pot/encoder adapter circuits", 4 secondary boards (maybe 4" x 6"), and one USB master (that won't be very big). It looks possible to keep that under or close to $10 with JLCPCB.

    Robert
    Last edited by Demon; - 25th October 2023 at 05:22.

  12. #12
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,677


    Did you find this post helpful? Yes | No

    Default Re: New project - MSFS C++ USB interface

    3D PCB viewer included in KiCAD.



    Wow! :O

Similar Threads

  1. USB interface
    By Frozen001 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 28th December 2011, 19:37
  2. Host for USB interface?
    By Carrasco in forum Off Topic
    Replies: 4
    Last Post: - 3rd August 2007, 23:59
  3. USB Interface using PIC
    By Tissy in forum mel PIC BASIC Pro
    Replies: 21
    Last Post: - 22nd May 2006, 16:04
  4. USB interface from PIC16F877 to PC
    By headshouter in forum USB
    Replies: 0
    Last Post: - 26th February 2006, 04:58
  5. USB project
    By NL2TTL in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 18th January 2005, 21:59

Members who have read this thread : 21

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts