October 26, 2021

Sim Racing H shifter

I wanted a sturdy but simple Sim Racing H-pattern shifter compatible with my Fanatec CSL Elite wheel. This is what I came up with.

3D model. Front PCB has an RJ12 connector to connect to the wheel base. The long center nut is very long in the rendering.

All DIY variants of sim shifters that I found seem not very sturdy and usually not very simple in the construction.
My shifter is simple in the mechanical construction, and it contains relatively few parts. The electronic circuit is simple, at least for most of the diy-people. And foremost, it is very sturdy.

The shifter uses hall effect switches and position sensors that will never wear out. I have simplified the electronics so that few components are needed.
There are not many tools needed either.

The surfaces that wear is in metal where needed. X- and Y-axis joints have small ball bearings that are press fitted to the plastic parts.
The shifter uses two spring loaded ball screws that give the shifter three distinct positions in the Y-direction. The X-direction is a smooth motion. X-position is centered by two, commonly used 3D-printer hotbed springs 8mm diameter and 20mm long.
There are only three 3D-printed parts. The 4th part is a drill jig for drilling the hole in the central extension nut. The 5th part is a drill jig for creating the mounting pattern for the shifter if needed.

Parts needed for assembling the shifter


Prepare the metal parts

The center joint is made of a 30-35mm long M8 nut. There need to be a M5 threaded hole in the middle of the nut. 3D-print the jig to help creating a perfectly centered hole in the nut. Use a 4.2mm drill for best result with the threading tap.

Press the long nut into the jig and drill all the way through. Then make a M5 thread in the hole. Clean the threads afterwords, otherwise it is difficult to screw in the M5 rod at a later stage.



Cut off a 55mm long piece of the threaded M5 rod. Make a small slot in each end. Fasten one of the magnets in one of the ends of the rod. I used a small round file to make a rounded seating for the magnet. The slot on the other end is for being able to use a flat head screwdriver when mounting it to the long center nut.

Cut a 100mm long piece of the threaded M8 rod. This rod decides how long your shifter stick will be, and in turn also how long travel the shifting stick action will have.

Also cut the head off the75mm long machine bolt so that it ends up to be 68mm. The bolt to be used is preferably not threaded all the way. If this bolt is longer than 68mm it will protrude on the bottom of the shifter shell.

 


Prepare the X-block

Press in the 6 M4 nuts as far in as possible. Start with the top and bottom nuts and lastly the middle one. Repeat for the three nuts on the other side of the center axel. Screw in the 6 M4 grub screws so that they still have some threads that grip each of the nuts. The pits that form will give the distinct Y-positon of the shifter. If you like to have a less distinct positions you screw in the grub screws less deep. The grub screws also make sure the nuts stay firmly in place.


Press in all the 4 bearings in the X-block. There should be a tight fit on all the parts. Use a hammer to get them in place.

Use the angle ruler to scratch a 45° line in the X-block from top-left to bottom-right passing the bearing center. This will be used as a guide to position the magnet in a later step.

Screw the M8 threaded rod into the M8 long nut. Do not pass the center hole.



Place it down the X-block center and screw in the M5 threaded 55mm rod. The rod should be screwed in from the side where there are two small holes in the X-block. The M8 rod should also point out from the X-block side with rounded edges. Screw the M5 rod in until the top of the magnet is level with, or just under the X-block edge. Using a flat head screwdriver from the other side makes it easy to screw it in.

Calibration: With the M8 rod in the center position pointing upward: Orient the M5 screw so that the magnet SOUTH pole points between 10 and 11 o´clock when facing the magnet end of the M5 rod. Use a compass to know your pole, or hang it in a thin thread and see how it orients itself. The magnet should align with the earlier made line in the X-block.

Once the magnet orientation is done, secure its position by fastening the M8 rod firmly with some pliers.



Make sure that when moving the stick from max left to max right position, the magnet SOUTH pole should never pass 9 or 12 o´clock position.

Now screw in the 68mm cut M8 bolt from the other side of the long nut. First add some Loctite to keep it in place, and fasten it firmly with some pliers.

Tip the shifter over to one side and slide in one of the springs into the hole on the inside of the x-block. Repeat for the other side. The shifter stick should now be centered.

Press in the second magnet into the 4mm hole, flush with the X-block side.

This is how it should look when done.

Prepare the Y-block

Screw in the two spring loaded M8 ball screws until they almost protrude on the other side.


Screw in the two M5 screws on both sides until they almost protrude on the other side.



Mount the three cables for the X-axis PCB. I used a dab of hot glue here and there. Make sure enough cable is exposed in both ends. The cable need to be flexible since one end connect to the moving X-block. Do not use single core cable.


Assemble the X- and Y-blocks

Place the M5 washer onto the M5 screw on the opposite side of the spring loaded ball screws. Put some grease on the 6 nuts and slide in the X-block with the 6 nuts facing the spring loaded ball screws into the Y-block.

Screw in both M5 screws all the way. Screw in one of the spring loaded ball screws while moving the X-block back and forth. Once the ball screw start to engage with the nuts, the Y-positions should become more and more distinct. Continue to screw in the second ball screw. If you like stiffer shifter you fasten the ball screws more. Note! Do not over tighten the ball screws.

Screw a nut onto the M8 threaded rod and add a washer. Screw on the shifter knob as far as it goes, and then unscrew the nut until the washer press onto the bottom of the knob and lock it in place.



Now most of the mechanical work is done!

PCBs and electrical connections

Mount the RJ12 PCB to the front of the Y-block.

Push in the hall sensor switches (AH3574) into the slots in the Y-block. Take note how the AH3574 are oriented to know which of the legs are GND, Output and VDD. Connect the top sensor to a4 (Y-out) and bottom one to a3 on the RJ12 PCB. Also connect GND and VDD. Hot glue any loose cable. Also hot glue the sensor switches in place so that they do not fall out from their slots.

Mount the X-axis PCB to the X-block using M2 screws. Solder the cables to the X-axis PCB and secure them with some hot glue in the PCB end as a stress relief. Make sure that there is some slack in the cable so that the X-block can move without straining the cables. Solder the other end of the cables to the RJ12 PCB.

Hot glue the cables soldered to the RJ12 PCB.


Plug in the H-shifter to your Sim wheel base and calibrate the wheel base so that it interpret the shifters output values as gears. How the calibration is done depends on your steering wheel. Look it up on youtube.

Enjoy!


Bill of materials

3D printed parts (https://www.thingiverse.com/thing:5025316)

  • X-block
  • Y-block
  • Shifter knob
  • Drill jig for the M8 long nut
  • Drill jig shifter mounting pattern

Electronics







Contact me for PCBs, foogadgets@gmail.com €12 incl. shipping. Components not included.

Parts numbers from digikey.com
  • 1x   MCP6N11-010E/SN-ND     MCP6N11-010E
  • 1x   223-1562-1-ND     G-MRCO-037
  • 2x   31-AH3574-P-ACT-ND     AH3574-P-A
  • 1x   1727-1875-1-ND     BC807-40 PNP
  • 1x   380-SS-90000-007-ND     RJ12 6p6c
  • 1x   311-1.0KHRCT-ND       1k 0603 SMD
  • 5x   311-4.7KHRCT-ND       4k7 0603 SMD
  • 1x   311-47.0KHRCT-ND     47k 0603 SMD
  • 1x   311-56.0KHRCT-ND     56k 0603 SMD
  • 3x   1276-1006-1-ND         100nF Ceramic capacitor 0603 SMD

Hardware


If you have a Playseat Challenge you can also make a mount for the shifter. The mounting holes in the shifter is made to fit the angle bracket below.

Tools


Special Thanks to Yin Zhong
https://hackaday.io/project/171155-fanatec-clubsport-shifter-sq-v15-usb-adapter-diy He provided the detailed pictures and even an electrical circuit that had many ways to be improved (made by Fanatec).


May 18, 2020

Yamaha CR2020 service

I got hold of a Yamaha CR2020 that was in a pretty bad electrical shape, but very nice externals. As a hobbyist I planned to take my time and fix it properly.


I decided to do a full recap (replace all electrolytic capacitors). Well most of them. I actually left the radio and phono pcb as it was.

There are three Service Bulletins released by Yamaha for the CR2020. They all target the same problem area. Heat problem in the power supply area. One of them also target a problem with power switch waring out.

The main capacitor board is the worst heat producer. The PCB in this amp had become so hot that the PCB had become charcoal and the electrical traces lifted from the PCB.

The best solution I could come up with was to replace the PCB with a new one. There are no new to buy so I had to backward engineer the existing one. It is possible to buy on request (https://www.facebook.com/pg/foogadgets/shop).
Most of the heat is produced by four current limiting resistors. The original ones are mounted on the component side and in a way that generate heat in a bad spot. I googled the problem and found out that someone else had solved the problem. Mounting the heat generating components on the back of the PCB make it much easier for the heat to move away from the PCB.

The resistors is now located in a place where air circulates much easier.
-B and +B terminals are marked on the PCB. This is where the cables to the main board is soldered. They connect immediately to the capacitors. As a side note, I experienced the importance of isolation distance. After a full day of testing the amp and adjusting bias, I turned it off. The day after when turning it on, I heard a loud bang! It turned out that the +B cable was lying right on to the negative terminal of the capacitor. When switching on the amp the current flow to the capacitors is very high and thus the voltage shortly spikes. The voltage became so high that there was a spark through the cable isolation. After relocating the cable the problem was solved.

After the recap and restore was done, there was quite a hand full of retired components. All of them is not shown in the picture.

The capacitors where in a really bad shape.
The orange capacitors to the left was the only capacitors that still measured very good. The rest was in bad shape with many only having half the capacitance left. The capacitors in the rest of the red circles had a short circuit.

Closing up on the relay one can see that the contact pads are missing on one side.

The under dimensioned transistors TR712 and TR715 (2SD234) was upgraded to TIP41C and mounted on a big metal surface close to the faceplate. In the image below one can also see the new relay and the new green capacitor board.

Here is a close-up on the capacitor board. The two big capacitors are new 5-pin snap-in type capacitors.
The Main boards had a couple of short circuit capacitors but nothing else broken. However, I did change the potentiometer to trim the bias voltage and refreshed the thermal paste on all transistors. At the same time I checked that they seemed OK. The transistor to the right TR608 was changed since the 2SC458 is known to go bad.
Image below is before restoration.

Main boards after restoration.

The power switch came in a plastic bag. It consist of a mechanical part and an electrical switch part. The mechanical part was in perfect condition but not the electrical part. I 3D-printed a small bracket that made it possible to mount a micro-switch (CSM40550) to the mechanical switch.

And a final picture of the result.


September 29, 2017

Upgrading a Bosch PLL 360 self-levelling line laser

Based on my previous upgrade of the Cocraft HL-10 cross line laser, I was set to upgrade my PLL 360 cross line laser as well.

Analysing the hardware

I first opened the laser by locating all 5 screws.
One of the screws is hidden under the sticker.
It seem to be possible to adjust the accuracy if needed by adjusting the copper coloured screws.
The line laser is self-levelling as long as the line laser is keep within ±4 degrees referenced from the  bottom plate. If the inclination is greater, the inclination switch kicks in and turn off the line lasers at the same time as a warning LED turns on. This can be avoided by pressing the Lock key.
When the spring makes contact with the surrounding PCB, the lasers are turned off.
Behind the control panel I find the main PCB.
A simple construction.
Top-middle right is a step-down converter to bring down 4x1.5V to 3.3V to feed the microprocessor. Bottom right is the microprocessor. A PIC16F676 and a convenient ICSP header close to it (J3). Bottom left is the laser driver n-channel mosfets. Top-middle left is some pull-up resistors and current limiting resistors for the indicator LEDs.
PCB overview
After some measuring I could map all pins on the PIC the functions,
// PORTA-defines
#define H_LED        0  // OUTPUT RA0, Horizontal laser indicator LED
#define V_LED        1  // OUTPUT RA1, Vertical laser indicator LED
#define BATT_STAT    2  // INPUT RA2/AN2
#define WARN_LED     5  // OUTPUT RA5, Warning indicator LED
// PORTC-defines
#define LOCK_LED     0  // OUTPUT RC0, Lock indicator LED
#define V_CTRL       1  // OUTPUT RC1, Vertical laser control pin
#define H_CTRL       2  // OUTPUT RC2, Horizontal laser control pin
#define MODE_BUTTON  3  // INPUT RC3, Mode button
#define LOCK_BUTTON  4  // INPUT RC4, Locked mode button
#define LEVEL_TRG    5  // INPUT RC5, Level switch

The BATT_STAT is never used. The pin is connected to battery output, probably to be able to sense when the battery is running out of juice. I did not find the point in implementing the voltage sensing function.

Adding a HW interface

The J3 connector can be used to connect to the PIC microprocessor.
Pro tip. Solder the cables from the bottom and up, if you'd like to keep the programming cables after closing the line laser.
Once the header has been populated with wires and a pin-header I connected it to my Pickit2.
To my surprise there is no read protection of the original software so it could be extracted and saved. That can be useful if something goes very wrong and I need to revert back to the original line laser firmware.

When the programming is done, the programming header can be tucked away along one side of the line laser. I taped it to one side just to make sure it does not fall loose and start to interfere with the self-levelling mechanism.

The original firmware function

The original firmware have a few basic features.
The Mode button selects which one of the two lasers should be lit. The horizontal laser, the vertical laser or both lasers.
The Lock button disables the internal inclination switch so that the line laser can be used at any angle.

The new features added with my new firmware

I have created two modes. Indoor mode and outdoor mode.
The indoor mode has exactly the same features as the original firmware except for one thing. The last used setting is saved in EEPROM and is recalled when turning on the line laser next time.

The outdoor mode is exactly the same as the indoor mode except that the lasers are pulsating at 2.6kHz.
By pulsating the lasers it is possible for a line laser detector to detect the lasers outdoor in bright daylight. This is a feature that is usually found in more expensive line lasers.
The outdoor/indoor mode is toggled by holding the Mode button while turning on the line laser.

The outdoor mode has been tested with the cheap Clasohlson laser detector, http://www.clasohlson.com/se/Laserdetektor-Cocraft-PRO-Edition-D50/40-9978
The detection range is measured to be at least 55 meter outdoor.

Talk is cheap. Show me the code.

The source code is written in C for the XC8 compiler here,
https://bitbucket.org/foogadgets/pll360-upgrade

The latest hex-file (pll360-outdoor-upgrade.hex) can be found and downloaded here,
https://bitbucket.org/foogadgets/foogadgets-document-and-firmware-download/downloads/

August 29, 2017

Upgrading a cheap cross-line laser leveller

When I started to build our greenhouse, I had a cross-line laser to make sure the build progress was done in level. The problem I had was that the cross-line laser I had was impossible to detect during summer days, so I had to wait until late evening to verify if all was still in level.

The easy solution would be to buy a laser line detector. But that would set me back at least $60. On top of that I would have to buy a new line laser that is supported by the line laser detector. That kind of line laser cost from about $200 and up.

I found out that the detectors usually rely on rotating laser light. Rotating since the detector only detect blinking light. Outdoor a constant light source of a specific color does not make much of a difference compared to the background surrounding light for a light sensor, but by adding a high pass filter to the light sensor, only pulsating light will be detected. Everything else is filtered out.

OK, so I had to adapt my existing line laser to emulate a rotating line laser. I had to make the laser blink at a certain frequency. The line laser I have is this one from Clas Ohlson, Cocraft HL10-S

There is a feature on many line lasers that the laser is turned off if the laser device is inclined too much in any direction. Mechanically the laser emitter is positioned in a pendulum that is hinged in two directions so that it can freely move with gravity. The lower end of the pendulum is hanging down into a hole. If the laser device is inclined too much, the pendulum will touch the side of the hole.
Electrically that will close an electric circuit that in turn will turn off the laser light emitter.
This mechanism I will use to flicker the laser light emitter.

Opening the laser device, I found the soldering pads on the PCB that corresponded to ground(GND), power(Vcc) and the inclination trigger to turn off the laser.


Measuring the signal level on the inclination trigger showed that it was either 0V or Vcc.
Manually forcing the inclination trigger pad to Vcc turned off the laser emitter. Thus, I only needed to create an astable multivibrator that generates a high enough frequency square wave and connect that signal to the inclination trigger. What frequency is needed I still had to find out.

To start experimenting I of course needed a laser line detector. I ended up buying the very affordable, Cocraft D50 Pro edition.

Moving on with the astable multivibrator. I based it on a 555-timer that only need a few extra components to generate a square wave. Here is the electrical diagram and component values I ended up using.


It turned out that the detector start to detect the laser when the beam blinking frequency is over 340Hz. I ended up using a 1kHz square wave with a 67% duty cycle. I soldered all the components directly on the 555 IC, in a "dead bug"-style.


The circuit was enclosed in a white shrink tube and tucked away inside the line laser enclosure.



Testing my new "rotating" line laser with my laser detector outside showed a detection distance of at least 40 meters. All in all it  set me back $38 for the line laser, $50 for the detector and less than $1 for the astable multivibrator circuit.

Mission accomplished!

PS. I first planned to make my own line laser detector. But I realised that it is hard to motivate considering the time to develop and component cost, when I could buy one for $50.