Generating holes for countersunk screws in FreeCAD

Update 1 Aug 2015: Add option for countersunk holes to be matched to a selected screw type

When working with countersunk screws in FreeCAD there is usually a need to pass over all the screw holes and add a recess/chamfer to the holes to match the countersunk screw.

This process can be rather tedious to do manually. For this reason and by requests from users I have added a “Make countersunk hole” function into the Fasteners Workbench. If not yet installed, see installation instructions here.

How to use:

Prepare a part with adequate holes for screws. For the automatic sizing to work, the holes should be based on the desired screw diameters. (For example for M5 screw, prepare a 5mm hole. You can also place a 4.2mm hole for holes that supposed to be tapped)

fscs1

Select the desired part and press the “Make countersunk” (fscsicon) button in the toolbar. A task dialog will appear on the left:

fscs2

The dialog will show a list of possible circular edges that can be chamfered to accommodate countersunk screws.

Move you mouse over the part and select the desired holes you want to put screws in. Select the top edge of the hole. You can select holes one by one (no need to press CTRL) or you can click on a face and all holes in that face will be selected. Each selected edge will be checked in the Dialog list, and automatic screw diameter will be selected. You can also check/uncheck edges directly in the list – but in this case no automatic sizing will occur.

When finished, Click the OK button at the top of the dialog. (This process is very similar to creating standard chamfers/fillets). For each selected hole, a chamfered recess matching the screws will be created:

fscs3

This process is of course parametrized. So if the result is not satisfactory, you can simply double click on the created Countersunk and you can edit the parameters. For example you can change the countersunk diameter by double clicking on the desired diameter, and selecting a new one from the combo:

fscs4

It is also possible to change the diameter for all the selected edges by selecting the new diameter from the bottom Diameter box.

Click OK when finished. The Countersunk part will be updated:

fscs6

Now let’s add some screws. Select the top edge of the new chamfered holes. Multiple selection can be done by pressing and holding the CTRL key. Click on the desired countersunk screw from the toolbar. A matching screw for each hole will be placed.If some screws came out upside down, select them and use the Invert(fsinverticon) button to flip them back:

fscs7

Note: Countersunk screws are matched by their head diameter and other screws are matched by their body diameter.

Have Fun!

SHS

 

Fasteners workbench for FreeCAD

Update 21-Jul-2015: Updated to Ulrich’s V2.0 screw_maker. More fasteners and nuts!

Update 01-Oct-2015: Add Bill-Of-Material generation

Many times when I design parts in FreeCAD (Specially Sheet Metal) I need to add standard fasteners such as screws, press-nuts, stand-offs etc… I used to add them manually, usually just as a rough shape, just to have it in the drawing for clearance. Fortunately, volunteers from the FreeCAD community begun to release addons  to generate such standard parts automatically. One of these addons is the very nice macro by Ulrich Brammer, that generates several types of screws with high accuracy and conformance with the standard.

To make it easier to use, and also conform with parametric nature of FreeCAD, I decided to write a simple workbench wrapper with WYSIWYG Icons and some controls.

Installation:

Starting from Frecad 0.17, The installation is simple and done using FreeCad’s Add-on manager (Under ‘Tools’ menu)

For off-line manual installations:
Download this file: FastenersWb
Extract the file into FreeCAD Mod directory.
(On Windows its somewhere like “C:\Program Files\FreeCAD 0.18\Mod”, On Linux: “~/.FreeCAD/Mod”  , create it if not exist)
That’s it.
Under the Mod directory you should see a new directory called Fasteners:

FSdir

How to use:

Usage is pretty straightforward:

Start a new document in FreeCAD. Select the Fasteners workbench from the drop-down list.

A series of screws will show on the toolbar:
FSToolbar

Simple Usage:
Clicking on any of the screws will create this screw in the origin position with default size. To change size/length select the newly created screw, then go to the data tab in the property panel, there you can change diameter and length. (For now it is in metric standard):

FSParams

Changing the “thread” property to “true” will render the screw threads as well. Please note that generating threads takes considerable amount of time, during which, FreeCAD will not be responsive.
The invert and offset properties are only applicable to attached fasteners. See next.

Attached fasteners:
Fasteners can also be attached to features in other parts. To attache a screw to a part, the part must have features with circular edges, such as holes. To attach screws to holes, select the desired circular edge or several edges (You can also select a face if you want to select all holes in that face):
FSSelect

Now click on the desired screw. A screw will be placed on each of the selected features, trying to match the screw size to the hole size:
FSCreated

You can now, like before, change diameter and length from the properties panel. If you wish the screw to hover above the hole, you can set the “offset” property  to the desired distance. Sometimes the screw does not detect the direction correctly and appears upside down. To correct this change the “invert” property to true, or select the screw and press the Flip button (FSFlip) in the toolbar.

To attach an existing fastener to a different feature, select the screw, then control-select the new feature:
FSSelMove

Now press the Move button (FSMove) in the toolbar. The screw will move to the new location:
FSMoved

An attached screw will move with the part it is attached to. If you wish to detach the screw from the parent part, simply select only the screw, then press the move button. The screw is now detached and can be moved individually.

Simplifying objects

It is important to note that if you wish to share FCStd files that contains fasteners (or parts from other custom parametric workbenches)  with other people, they must install these workbenches as well, or else they will get errors when trying to use them.
However, if you just want to share the resulting parts, with no need to change object’s parameters, you can use the Simplify (SimplifyObj) function, to convert the fasteners to simple shapes. They will appear as new Shape parts in the model tree. You can then delete the original fasteners and save as a simple FCStd that can be read and used on any FreeCAD installation.

Source Code:

For those who are interested, GitHub code can be found here.

Future planned features:

The current workbench is just a wrapper to the screw_maker macro. As so it shows only screws (and a washer). I hope to soon add some press-nuts(added), studs(added) and stand-offs(added).

Once again, many thanks to Ulrich Brammer for his great screw maker macro.

That’s all folks!
Hope it helps.

 

Sheet metal Addon for FreeCAD

Update 29 Apr 2016: Updated Ulrich Brammer’s Unfolding tool to ver 17. Thank you Ulrich!

As part of doing home made projects one needs some kind of CAD software to design mechanical parts. As a fan of open source software I use FreeCAD which is a great alternative to the market’s highly expensive Solid CAD software.

One thing I use a lot, is designing Sheet Metal parts. As there is no special support for it in FreeCAD, it tends to take time to design Sheet Metal parts, as I need to manually add sketches, extrude walls, and add fillets. Furthermore, If I found something to be wrong in the base part, I have to go over the entire process to fix it.

This is where open source software shines. If I need a new feature, I can just go ahead and add it. Turns out FreeCAD is very friendly to extensions. So I decided to add a sheet metal extension and share it with others. One thing worth mentioning: there is this guy who is working on a sheet metal extension which will probably be far better then mine, but until he releases it, my extension can help speed up part design.

Installing the extension

Starting from Frecad 0.17, The installation is simple and done using FreeCad’s Add-on manager (Under ‘Tools’ menu)

For older versions:
To use the sheet metal extension, first you need to install the latest version of FreeCAD (0.16 at the time of writing) if yo dont have it already.
Now go ahead and download the extension: SheetMetal_V0.0.18
Extract this zip file into the Mod directory under the FreeCAD installation path. (on Windows it’s something like “C:\Program Files\FreeCAD 0.16\Mod”)
You should now see a new directory under Mod: SheetMetal.
That’s all for installation.

Working with the Sheet Metal extension

To simply understand how to work with the Sheet Metal extension, here is a sample workflow:

Start with thin layer solid shape, either by extruding a sketch, or creating a thin Box. From the workbench drop-down select “Sheet Metal”. Now select one of the side faces of your objects:

smcap1

The Sheet Metal workbench shows 2 command icons:

BendIcon Bend: Add bended extension

ExtrudeIcon Extrude: Add a strait extrusion of the face

Click the Bend tool:

smcap2

A 90 degrees bended extension with default values will be added. You can now play with the bend parameters by selecting the Bend part in the model tree, and then the Data tab underneath. In the parameters table, change the length to 7mm and add a 2mm gap on both sides:

smcap3m

Let’s extend the bended flap sideways. Select both side faces of the new wall. (Press and hold Control to select multiple faces). Now click the Extrude tool:

smcap4

Shape the result: In the parameters panel, set length to 5mm and gap2 to 1mm:

smcap5m

Now let’s add more bended extensions. This time select 2 side faces of the base to make 2 symmetric bends. Click Bend. Set the length to 7mm:

smcap6

That’s it, you can continue now and add more bends and extrusions until you get you desired final part. The nice thing about it all that the final part is fully parametric. This means that any change in a parent part will immediately propagate to the dependent parts, without the need to redo them. Click the gray “Cube” part from the model tree, and change the Length to 60mm. See how all the bends adjusts accordingly:

smcap7

The parameters of the Bend give you lots of flexibility. You can for example add just the bend, by setting the Length to zero, or even just add the relief cuts, by setting the bend angle to zero as well:

smflex

Upon completion of the sheet metal part, you can select the OpenScad workbench and use the Refine (RefineIcon) tool to cleanup the geometry.

Here is a sample part made with several symmetric bends:

smcap10

That’s all! Hope it helps someone. Over time I will try to add some more features and keep the above SheetMetal.zip updated. You are welcome to leave comments and suggestions.

Update 13 Jun 2015: Ulrich Brammer’s Unfolding tool Added. Thank you Ulrich!

Ulrich Brammer’s great unfolding tool is now integrated into the workbench. Many thanks for the developer. To use it, simply select any one of the faces of the folded sheet metal and press the Unfold (UnfoldIcon) icon

Before:
unfold_before

After:
unfold_after

SHS

Combine multiple game controllers into a single logical one

Update April 2018:
Use vJoy GUI configuration instead of command line.
Added 64 bit version. (compatible with windows 8 & 10)

Sometimes, as I found it myself, PC games can handle only one controller. For example, the FreeSpace 2 Open (FSO) supports only a single HID input device.  This eliminate the possibility to use a separate throttle and joystick together in this type of games. To overcome this problem, we need to combine both physical controllers into one virtual controller to be used at this game. The virtual controller will combine  and provide all axis, POVs and buttons of both controllers.

VJOY Virtual controller

Fortunately there is a great free software called vJoy. VJoy lets you create a virtual HID controller with configurable number of axis, POVs and buttons. You then need to feed this vJoy controller with data you want to present to the game. An included SDK is letting you develop your own vJoy feeder.  Using this SDK, I have developed a feeder that takes input from both Suncom SFS Throttle and Suncom F15 Talon joystick (converted to work on USB by my previous projects) and feeds a single vJoy virtual controller. Following, I will explain how to install and use it. I will also publish the source code, so anybody who wants to make his own feeder or to join any other types of  joysticks can use it as a reference.

NOTE: vJoy is only for Windows platform.

Step 1: Install vJoy

Go to vJoy website, download and install the software. This will create a single default virtual controller.

Step 2: Configure vJoy

We now need to configure the vJoy controller to have all needed axes POVs and buttons.
Open the vJoy configuration utility “Configure vJoy”, and configure device #1 as follows:

vJoy configuration utility

Then Press “Apply”.

 

The vJoy controller should be now configured correctly. To make sure it is, Open windows control panel, and select Game Controllers. Select the vJoy controller and click properties. You should see something like this:

vJoy_cp

Step 3: Install the feeder.

Download the SuncomControllerMerge feeder  32bit version here or 64bit version here. It does not come with an installer, so you need to install it manually. Just extract the zip file to a directory of your choice and run the SuncomControllerMerge.exe file included.

Thats it! you are all set! All you need now id to plug the Suncom Throttle and joystick and the feeder will automatically detect them. To check if everything works correctly, go back to Game controllers in the control panel and click properties on the vJoy controller. Now play with both joystick and throttle and make sure both affect the vJoy controller.

Important notes:

1.  Some games, not only that they do not support multiple controllers, they even do not let you select which one to use. In this case, make sure the vJoy controller is the default one. you can do it by going back to the Game Controllers window in the control panel, and press the “advanced” button.

2. Though the vJoy controller will always be present, even after the system reboots, the feeder will not, and must be activated each time when needed. Without the feeder, the game will detect the vJoy controller, but will not receive any data from it.

Source code:

For those of you who wants to play with the software, or adapt it to other controllers,
Updated sources, good for windows 7, 8, 10 can be found at GitHub , and compiled with VS c# 2010 and up.

And here is the old source code. It can be compiled under MS Visual c# 2008 express and up.

 

 

Converting the Suncom SFS Throttle to USB

The time has come to convert the Suncom throttle as well.

sfs_throttle

Suncom SFS Throttle

 

The Suncom SFS is a pretty well made throttle with split grip and programmable buttons. The programmable feature was good for the days where game ports could only support 4 buttons, but USB game controllers have no such limit.

I strongly recommend reading the previous post on the Suncom joystick as it has several tips I will not repeat here.

 

Suncom SFS hardware overview

The Suncom SFS have pretty dense electronics under the hood. It has 3 separate PCBs and a whole bunch of cable harnesses. As opposed to the Suncom joystick, there is no separate controller for the buttons. Instead, the buttons are electronically ordered in a grid of 4 by 4, and need to be scanned sequentially to get their status.

SFS_original_electronics

Suncom SFS original electronics

 

Preparation before fitting the new hardware

1. Remove the old PCBs

3 PCBs need to be removed. The first one is the smallest. It holds the 2 extension connectors. Remove the screws and pull the PCB out. You will probably need to use some force and bend the surrounding plastic to get this one out. Do it carefully. The other 2 PCBs will be easier to remove. When removing the mid size PCB, pay attention that this will loosen up the 4 red button cups, take care not to loose them.

SFS_pcbs

Throttle’s 3 PCBs taken apart

2. Disconnect cables.

The main body should be disconnected now from the PCBs. There are 2 cable harnesses coming from the grips (11 pin and 5 pin) and 4 wires coming from the potentiometers.  All the wires are connected to the main PCB. The cables should be just pulled out from the board. The 4 POT wires should be de-soldered.

Main_PCB

Disconnecting cables and wires

 

3. Adding a 3rd wire to the POTs

In the original electronics, as in all PC Game-Port devices, only 2 wires are connected to the potentiometers. But in our case we need 3: VCC, GND and return. So, as in the joystick case, we need to add another wire to the POT’s pin number 3. The POTs are not easily accessible  for soldering. To get access we need to detach the grip assembly from the main body.  To do that, first remove the 4 screws attaching the grip assembly to the body:

GripAssyScrews

Yes, this time the screws are not just for decoration

Now carefully lift the grip assembly out of the main body. You will need to play with it a bit and again maybe use some slight force to do it. Be very careful not to damage the wires while doing so!

Now that the POTs are accessible, add a 3rd wire to both POTs by soldering an extra wire to pin number 1 (might be pin no 3 if the POT is flipped)

pot1

Right pot, a wire should be soldered to pin 1

pot2

Left pot with pin 1 already wired

Note wire colors for later:  Wire connected to the pin closest to the front of the throttle (pin 3 on both POTs in my case) is the VCC. Back wire is the GND, and middle wire is the return.

You can now reattach the grips assembly back to the body, again, careful on the wires.

 4. Salvaging parts from the main PCB.

Some electronic components from the main PCB are needed for reuse. You will need to carefully de-solder the following parts: The 9 LEDs, the 4 tact switches, the slide switch, the 5 pin connector, the 22 pin right-angled pin header, and the 4 diodes.

PartsToSalvage

Components from main board needed for the new PCB

Preparations done!

 

Assembling the new PCB

1. Collect necessary parts

Order a PCB from Itead Studio, using the attached Gerber Files.
Order parts from digikey or another place, using the attached BOM.
Find a USB cable.  I used a USB2 extension cable, and just cut the female end.
(For any of you who wish to play with the PCB, here is the complete KiCad project: SuncomSFS_Kicad)

2. Assemble the PCB

Start with the SMD parts.As noted in the Joystick post, there are many Youtube tutorials on how to solder smd parts. Here is my method:

For resistors/capacitors, First apply some lead with the soldering iron on one of the pads on the PCB. Then using tweezers pick the resistor/capacitor and solder one side to the already coated pad. Now that the component is fixed into place go ahead and solder the other side.

For fine pitch ICs, such the PIC MCU, again, apply some lead on one of the component pads on the PCB, then solder the component to its place, and since only 1 pin is being soldered to the one coated pad, it is easy to play with the IC until all pins are aligned correctly. Then solder another pin on the other side of the IC fixing it into place. Make sure that all the pins are still aligned to the pads, and then start to solder all the rest of the pins. You don’t have to be accurate and it is OK if you short a pin or 2 at this stage. When all pins are soldered, Use solder-wick to remove excess lead from the pins, freeing any of the shorted ones on the way. Use a cleaning solvent to remove any leftover dirt. Using a magnifier glass  inspect and make sure all pins are soldered correctly and no shorts left.

pcbSmd

New PCB with smd parts assembled

Next, Solder all through-hole components (3 connectors, 5 switches, 4 diodes and 9 LEDs). For each components, first solder 1 pin, then make sure the component is places correctly, and only then solder the rest of the pins. (if it is not places correctly, since only one pin is soldered, you can heat-up this pin with the soldering Iron and move the component until it is placed correctly.) for the LEDs, pay attention for the polarity: align the strait cut on the bottom of the led dome with the strait line on the PCB symbol. The LEDs should have a small bending on their leads helping you place them at the correct height above the PCB. Note also the diodes polarity – black stripe on diode goes to the white line on the PCB.
Important note: The the JST programming connector goes on the BACK side of the PCB.

3. prepare the USB cable.

To hold the new cable nicely into the body, we need to reuse the rubber gasket that held the original cables. There are 2 cables passing through the gasket. Cut both cables as close as possible to the surface of the gasket from both sides.

SFSGasket1

Cable gasket. Cut on both sides.

After cutting the cables, pull out all internal wires from the gasket to free the holes. Take the new USB cable. If you use a USB extension cable as I did, cut out the female side. Try to pass the cut edge of the new cable through the gasket hole (either of them).  If the hole is too tight, measure the cable diameter, and use a standard drill bit with the similar diameter to widen the hole. Make sure you insert the cable from the correct side.

SFSUSBCable

New USB cable inserted through gasket.

After the cable is inserted, expose about 1 Inch of wires from the cut edge, then from each wire expose a few millimeters of copper.

It is very important now to make sure the wire colors of the USB cable are correct. (In my case I found out that they ware not). Using a multimeter or similar device make sure the wire colors are as in the following pinout table:

USBConn

USB type A connector looking from the front side.

1. Red (VCC)
2. White (D-)
3. Green (D+)
4. Black (GND)

If the wiring is not correct, make sure you map them correctly when connecting to the PCB.

4. Connecting the PCB to the main body

First you want to solder the USB cable to the PCB. Use the following image to see where each wire goes:

SFSPCBUSB

USB cable to PCB wire connection.

Now you need to connect the 3 x 2 potentiometers wires.  Solder the POT wires using the image below and the notes you made at step 3 of preparation stage.

PCBPOT1

Left POT connections

PCBPOT2

Right POT connections

Last, you need to connect the 5 and 11 wire cables coming from the grip assembly. There is only one way to connect the 5 pin connector. The 11 pin connector connect to the upper line of pins in the 11 pin header, noting that the side with brown and black wires are toward pin number 1.

SFSPCBComplete

PCB fully assembled and connected to main body.

 5. Fitting the PCB in place.

Before placing the PCB in place, make sure the slide switch is aligned with its cup on the body. Now carefully place back the 4 red tact switch caps. Make sure the springs in the cups are placed correctly. Carefully turn the PCB upside down making sure all connected wires are getting in the way of the switches or the screw holes. Screw back the 3 PCB screws to hold the PCB in place.

PCBInPlace

PCB fit in place.

That’s about it for the hardware part!

Programming the software

The software for the PIC is similar to the one used on the F15 joystick. Similarly, when the slide-switch is on (LED is lit), several buttons become toggle buttons. The left and right grip are mapped to X and Y analog axis. In addition there are 16 switches, and 2 8-direction POVs.

Download the project from this link: SuncomUsbThrottle_PIC18F25K20

Use the same procedure as in the Suncom Joystick post to program the Throttle.

That’s it for the software part!

Final touch

Before closing everything, 2 last things should be done:

1. You may want to cover the original extension connector holes by inserting back the small connector PCB. Cut all wires coming out of it before you do so.

2. As one of the readers suggested, place a cable tie at the entry side of the USB cable, to make sure the cable will not be accidentally pulled out.  (Thank you, Craig!)

SFSFinalTouch

Final touch

SFSCableEntry

Cable entry and extension connectors in place

Thats all!

Close up the bottom plate, and enjoy your renewed Suncom SFS Throttle!

-SHS

Update:
As asked by Rajeen, here is a (rough) button connections diagram for the grip: GripButtonDiagram

Converting old Game-port joysticks to USB

This project intend to revive old PC Game port type joysticks by converting them to modern USB HID game device.

So, you want to convert your good old Suncom F15 Talon joystick from this:

OldCon

into this:

NewCon

In this post I will explain in detail how to convert an old Game Port joystick to USB using pic microcontroller. I will also provide PCB schematics and PIC firmware.

Note: This project requires basic electronics understanding and soldering skills, And of course, everything provided here is given as-is, use it wisely and on your own risk.

This project is intended to replace the hardware of a Suncom f15 Talon joystick, but with little tweaks can be used for other types of joysticks. The PCB have several extra inputs to accommodate for extra inputs/axis.

Suncom F15 Talon joystick

The SFT joystick, aside from Game-port connector, have a keyboard bypass connector that enables the joystick to convert joystick buttons into keystrokes. This function was necessary since PC Game-port supports only 4 buttons. It has a programmable feature to set what key is mapped to which button. This function is now obsolete since a USB joystick can support as many buttons as needed. The joystick itself contains 2 PCBs inside, one at the base that controls all programmable functions and keyboard emulation, and another one inside the grip that collects all button presses and communicate them with the base PCB. I had to reverse engineer this communication since the communication chip was too old to find a datasheet for. Turns out its a simple parallel to serial converter, easily handled by a microcontroller. This also eliminate the need to replace the PCB in the grip.

Dismantling the SFT base PCB

We now need to carefully remove the base PCB taking notes of some wiring connections.

Open the base: remove the suction cups by unscrewing them. Reveal the base screws by pealing off the rubber pads. Unscrew the base screws and remove the metal base.

Remove the PCB: Unscrew the 5 PCB holding screws. Lift the PCB. Using a soldering iron start removing all wires from the PCB. There are 4 wires connecting the pots, and 9 wires connecting the grip. 5 of the wires coming from the grip must be carefully noted and marked before disconnection: GND, PR, CS, D0-D1, and Pi-P/S

bottom_pcb_note

Note and mark these wires!

The other 4 wires coming from the grip are the original game port buttons and we don’t need them. (There is a button in the grip just under the POV lever, that selects if the 4 main buttons will be send using the com chip or using the 4 direct wires. By default its on, so we do not need the direct button wiring)

Salvage necessary components: Some parts are needed to be salvaged from the main PCB, to be used on the replacement one. Carefully remove the 4 tact buttons, the slider switch and the 5 LEDs. (these parts are rather standard, so they can be replaced with new ones if needed)

Further preparations: The original game-port used only 2 wires per potentiometer it used a very unreliable method to measure the pots state. The new PCB used DA converters to detect POT state. For this we need 3 wire per pot – VCC, GND, and return. Applying VCC and GND to the POT ends, gives a voltage on the return pin that is relative to the POT dial position. Add an extra wire to each POT as in the following photo, and take note of the pin names:

pot_conn

Potentiometer connections


Replacement PCB

The new PCB I designed is based on Microchip’s PIC18F25K50. All other components are just capacitors/resistors and the salvaged parts. Here are all the files you need in order to make this PCB yourself:

Schematics:  SuncomF15
Kicad Project: SuncomF15KicadProj
Gerber files: gerbers_suncomf15_5by10_Green_HASL_1.6mm
Part list: Suncom_F15_BOM

Feel free to use/change/distribute these files. There are no restrictions whatsoever.

The simplest way to have this PCB is to get it manufactured on line. For merely 15$ you can get 10 pieces using this fine website:  IteadStudio. Just select and buy the “2Layer Green PCB 5cm x 10cm Max“, note the order #, and send them an email with the Gerber zip file attached. (see detailed instructions on the product page).

PCB Assembling

After obtaining the parts and PCB you will need to assemble it. The PCB is 2 layered with components on both sides. First you should assemble the PIC, the programming connector, and all capacitors and resistors. Then on the other side, assemble LEDs and switches. Then connect all the wires.

Assembling PIC and res/caps: This stage is mostly SMD soldering. If you are not familiar with it, there are a lot of tutorials on Youtube. Its not that difficult. Start with the PIC, then resistors/capacitors, then solder the JST programming connector.

Assy_step1

Assembling SMD components

Assembling the Switches: First assemble the tact buttons. Make sure they are fully inserted into the PCB:

Assembling tact switches

Assembling tact switches

Next you need to solder the slide switch. The PCB I designed have no space for the switch mounting holes, so you will have to Cut/file the mounting legs out:

Cutting slide switch mounting pins

Cutting slide switch mounting pins

Then solder it to the PCB, direction is irrelevant, it is symmetric.

Assembling the LEDs: The LEDs are a bit tricky to solder since they have to be mounted in a certain height to fit the led holes in the plastic base correctly. Any method can be used but here is how I did it. First I placed a piece of  tape over the holes of the LEDs from the outside:

Placing a tape over the holes of the LEDs

Then I inserted the LEDs into the PCB without soldering them. Next, I carefully turned the PCB over and placed it inside the base in the correct location, using the screw holes as guides. I then let the LED fall into place. The tape will prevent them from falling too low. And if you use a clear tape, you can make sure the LEDs indeed fell into place correctly. I then put 2 screws to hold the PCB, and solder the LEDs inside the plastic base. Take extra care as not to damage the plastic with the soldering iron.

Placing the PCB and letting the LEDs fall into place.

Placing the PCB and letting the LEDs fall into place.

Connecting a USB cable: You will need a USB cable for this. Either salvage it from an old unused USB device, or just get a USB2 extension cable from EBAY and cut the female edge. You will also need to salvage the rubber gasket at the entry of the cable into the base, from the old cable. Just cut the old cable from both sides of the gasket and remove the inner wires from it. Then, insert the cut side of the USB cable through the gasket, making sure it is from the correct side:

Passing the USB cable inside the gasket

Passing the USB cable inside the gasket

Next, Solder the cable to the PCB from the switch side. The cable should be color coded, if not, you will have to figure out each wire functionality.
Connect green wire to D+
Connect white wire to D-
Connect red wire to the square pad
Connect the black wire to the last pad

USB cable wire connections

USB cable wire connections

PCB completed with LEDs switches and cable

PCB completed with LEDs switches and cable

Connecting grip wires: Its time to connect the 5 grip wires. They should be connected based on the markings made in the “Removing PCB” section. I have added wire colors based on my own joystick, but I can not guaranty its the same for all.

Connect CS wire (Dark blue) to CK pad
Connect Pi-P/S wire (Brown) to ST pad
Connect D0-D1 wire (Gray) to DA pad
Connect PR wire (Red) to the square pad on the bottom left
Connect GND wire (Black) to the bottom right pad

assy_grip

Connecting the 5 wires of the grip

Connecting the potentiometers: We now connect the potentiometers to the analog inputs. Connect x axis pot to the A1 analog input and the y axis pot to A2.

assy_pots

Connecting the potentiometers

Note: Make sure the potentiometers wires are long enough, if not, you must replace or extend them.

Wrapping up: That’s it! The hardware part is finished. All is left is to fix the PCB into the base. Place back the red button cups with their spring in place. Align the slider switch hat with the slider switch itself. Carefully place the PCB into its place aligning the switches with the cups. Fasten the 3 screws to hold the PCB in its place. Press the red buttons and move the slider switch to make sure all is working mechanically.

Placing red cups and aligning the slide switch

Placing red cups and aligning the slide switch

Lastly, Fit the rubber cable gasket in its place.

PCB is fasten in place. Rubber gasket is fit.

PCB is fasten in place. Rubber gasket is fit.


 

Software

The software for the PIC is based ob Microchip’s HID game device demo. I have adjusted it to fit specifically for the Suncom F15 Talon. For other joysticks you will have to tweak the SW accordingly. It shouldn’t be that hard. A feature I added in my version is that when the slide-switch is on (LED is lit), the base buttons become toggle buttons. When the switch is off, they are momentary.

Download the project from this link: SuncomUsbJoystick_PIC18F25K20

The project can be compiled with Microchip MPLAB IDE 8.56 and up. If no tweaks are needed, just use the hex file available in the above zip. You will have to make an adapter cable from PicKit/ICD to JST. Just connect pins 1 – 5 of the programmer to pins 1 – 5 of the JST connector. Pin 6 is unused. Here is an example programming cable for pickit 3:

pic_cable

PicKit 3 programming cable

Thats it!


 

An optional mechanical tweak

This step is optional, but I find this tweak as a very nice improvement to the Suncom joystick.  The Suncom have a 4 way POV. The POV input comprises of 4 tact switches for north, south, east and west directions. Theoretically, by detection of two switches pressed together, it is possible to add the sub-directions as well: north-east, north-west, south-east, and south-west. However, the Joystick mechanically prevents it. Here is a way to overcome this mechanical limitation. Caution:  do this tweak carefully as you might mechanically damage the stick.

For this part, you will have to take apart the joystick’s grip. First, pull out the 2 4-way controls cups. Then unscrew the grip screws and carefully separate the 3 plastic pieces comprising the grip. After opening the grip, remove the 2 screws holding the grip’s PCB, and remove the PCB. During this process, springs and button cups may fall, so be careful not to loose anything. Now take a look at the POV base (The POV is the right 4-way control). There is a concave indentation with 4 pins from 4 sides. These pins limit the POV stick movement. Cut about 2 mm from their height to remove this limitation:

pov_tweak1

Cutting the limit pins

Next, we address the POV stick itself. We need to add some thickness to the stick plate. We do it by adding a layer of isolation tape to the bottom side of the plate:

pov_trweak2

Adding a layer of tape

Lastly we need to address the cover. The opening in the grip plastic for the POV stick is “+” shaped to make place for 4-way movement. You will need to file it to make way for the 4 other directions. I used a small round file to add slits for the “X” directions:

pov_tweak3

Filing the “X” directions.

Voila! You have an 8 directions POV now. You might need fine tune these changes if it does not work at the first try.


 

Good luck, and if you have questions, feel free to leave a comment.

-SHS