Author Topic: Analog stick center calibration MOD (Joykostyl)  (Read 648 times)

Offline ZhenyaKa

  • Chief squatting Hard
  • *
  • Posts: 10
  • Post quality +0/-0
  • Gender: Male
  • Acidmods User
Analog stick center calibration MOD (Joykostyl)
« on: October 28, 2017, 06:38:33 AM »
Hello.
I want to show you my first Dualshock 4 mod.


It can to set zero points for both sticks.

As I know Sony calibrate their sticks. I saw original stick with 1.4V and 1.7V on middle at potentiometers (3.2V divide 2 is 1.6V).

When you replace broken analog stick (from Aliexpress for example), you will get some shiftings of zero points and some games will rotate camera :)
China sticks has some  larger deadzone, but it give clear 1.6V on middle.

My mode read voltage from stick and we can shift it manualy to good zero position.
Calibration mode activated with pressed L or R stick when plugging USB-cable.
Which stick pressed - that we will calibrate with other stick.
When we click calibrating stick - calibration done and shift values writes in EEPROM.

How it made you can see on video (Button film is not connected that L1 R1 goes some mad  :wacko:)
https://youtu.be/pkh7YIXIVwI


Now it on breadboard only:



Need to made PCB plate :)

Any question I cannn answer :)

PS: sorry for bad English.

Offline RDC

  • Acid Modder
  • *
  • Posts: 742
  • Post quality +78/-2
  • Gender: Male
  • The CGnome Project
Re: Analog stick center calibration MOD (Joykostyl)
« Reply #1 on: October 29, 2017, 01:06:59 PM »
Nice work there.

I did something like this awhile back for the 360 and XB1 controllers, but never made a PC side app for adjusting things as it was all done on the controller. They get calibrated after they are made, and installing new sticks or doing a Southpaw swap on them, especially the XB1 controller, just makes a real mess of things and they will drift all over. I quit messing with that project some time ago and never picked it back up as it was going to be a bit of a mess to install. I'm sure I could get it to be a lot cleaner, but it took a back seat to other larger projects here.



Are you lifting the 4 Wiper lines from the POTs? or cutting traces on the board?

I'm curious about the hardware you're using also. I see 4 Trim POTs on the breadboard, just wondering what they are doing? I used a 16F690 and a DAC104S for my design so the output of the Sticks went to the PIC, then PIC to DAC then the DAC to the controller board and the DAC uses the Stick voltage for the Reference, so it could be used on almost any controller that uses the same POT setup.
Screwing up is one of the best learning tools, so long as the only thing you're not learning is how to screw up.

Offline ZhenyaKa

  • Chief squatting Hard
  • *
  • Posts: 10
  • Post quality +0/-0
  • Gender: Male
  • Acidmods User
Re: Analog stick center calibration MOD (Joykostyl)
« Reply #2 on: October 29, 2017, 01:27:06 PM »
PC-side app is DS4Windows app.

It's no need necessarily for calibration.

It just shows how one stick affect on other (setting zero point).

Calibration can made with standard windows calibration wizard (we can see 0..255 value for each stick and set middle point to 127 or 128 for example).

But this calibration works in windows only and not affect on PS4 mode.

My MOD let to shift zero point of each stick looking at stick cursor position.
When save shifts in EEPROM of atmega328p.

And when gamepad power on normally atmega reads EEPROM values and shifts LX LY, RX RY axis by shift values.

And we have good center on both sticks.

Offline ZhenyaKa

  • Chief squatting Hard
  • *
  • Posts: 10
  • Post quality +0/-0
  • Gender: Male
  • Acidmods User
Re: Analog stick center calibration MOD (Joykostyl)
« Reply #3 on: October 29, 2017, 01:33:08 PM »


Are you lifting the 4 Wiper lines from the POTs? or cutting traces on the board?

I'm curious about the hardware you're using also. I see 4 Trim POTs on the breadboard, just wondering what they are doing? I used a 16F690 and a DAC104S for my design so the output of the Sticks went to the PIC, then PIC to DAC then the DAC to the controller board and the DAC uses the Stick voltage for the Reference, so it could be used on almost any controller that uses the same POT setup.

I cuted wires. PS4 controllers so bad for desoldering sticks analogs :) Metallized holes... It's hard to remove solder well.

"I see 4 Trim POTs on the breadboard" - there are parts of RC-filters for PWMs for each channel (release version will have constant resitors).

AVR havn't DAC on board. That why I need to convert PWM signal to analog signal.

My version can used on any controller too.

« Last Edit: October 29, 2017, 01:40:28 PM by ZhenyaKa »

Offline RDC

  • Acid Modder
  • *
  • Posts: 742
  • Post quality +78/-2
  • Gender: Male
  • The CGnome Project
Re: Analog stick center calibration MOD (Joykostyl)
« Reply #4 on: October 29, 2017, 02:00:32 PM »
Yes those Sony controllers can be fun to desolder the sticks.

Interesting project, looking forward to seeing how the PCB design goes.
Screwing up is one of the best learning tools, so long as the only thing you're not learning is how to screw up.

Offline ZhenyaKa

  • Chief squatting Hard
  • *
  • Posts: 10
  • Post quality +0/-0
  • Gender: Male
  • Acidmods User
Re: Analog stick center calibration MOD (Joykostyl)
« Reply #5 on: October 29, 2017, 02:09:10 PM »
Yes those Sony controllers can be fun to desolder the sticks.

Interesting project, looking forward to seeing how the PCB design goes.
I cut legs when replace sticks. But here sticks are well and I don't want to hurt them :)

I have 1206 elements only and now have some trouble to put PCB in body of gamepad :)))

Arduino Pro Mini have some place near motor, but additional PCB doesn't fit where.

Need to project new smaller PCB


WIP:

Offline RDC

  • Acid Modder
  • *
  • Posts: 742
  • Post quality +78/-2
  • Gender: Male
  • The CGnome Project
Re: Analog stick center calibration MOD (Joykostyl)
« Reply #6 on: October 29, 2017, 02:33:52 PM »
You should be able to use a lot smaller Vias and components than 1206, unless you are making the actual PCB yourself?

OSHPark is a really great place to get prototype PCBs made and they are cheap, but they make great boards. Their specs for 2 layer boards now are Vias are 10mil holes and 5mil annular rings, then 6mil/6mil trace/space width, so you can get that board to half that size there easy with 0603 components that are still easy to work with.
Screwing up is one of the best learning tools, so long as the only thing you're not learning is how to screw up.

Offline ZhenyaKa

  • Chief squatting Hard
  • *
  • Posts: 10
  • Post quality +0/-0
  • Gender: Male
  • Acidmods User
Re: Analog stick center calibration MOD (Joykostyl)
« Reply #7 on: October 29, 2017, 02:44:06 PM »
You should be able to use a lot smaller Vias and components than 1206, unless you are making the actual PCB yourself?

OSHPark is a really great place to get prototype PCBs made and they are cheap, but they make great boards. Their specs for 2 layer boards now are Vias are 10mil holes and 5mil annular rings, then 6mil/6mil trace/space width, so you can get that board to half that size there easy with 0603 components that are still easy to work with.

I think it will be some expensive to order there 2-3 PCBs and ship them to Russia :)

My plate I will make with simple Laser-Iron technology :) (names LUT in Russia).

With laser print (mirror image) and put it on clean PCB when iron it.
After that remove paper and put PCB in ammonium persulphate solution (Ferric chloride is great to or citric acid + hydrogen peroxide).

Copper layer will be removed on clear areas.
After that clean black printed powder with acetone and I'll got ready PCB :)

I think this method is not secred :)

Offline RDC

  • Acid Modder
  • *
  • Posts: 742
  • Post quality +78/-2
  • Gender: Male
  • The CGnome Project
Re: Analog stick center calibration MOD (Joykostyl)
« Reply #8 on: October 29, 2017, 02:56:21 PM »
Orders at OSHPark are made in multiples of 3, so 1 order is 3 boards, and the shipping is free. ;) Really hard to beat them versus a homemade PCB with vias. Just a lot more work to connect all of those things versus getting the boards made up with proper vias, but for making a solid prototype before making a bigger run I can see doing them that way. Keep them in mind for future projects, as they can also do 4 layer with better tolerances.
Screwing up is one of the best learning tools, so long as the only thing you're not learning is how to screw up.

Offline ZhenyaKa

  • Chief squatting Hard
  • *
  • Posts: 10
  • Post quality +0/-0
  • Gender: Male
  • Acidmods User
Re: Analog stick center calibration MOD (Joykostyl)
« Reply #9 on: October 29, 2017, 03:07:02 PM »
https://easyeda.com/order - is cheaper or not?

I'm newbe at this question.

Never to order PCB.

Offline RDC

  • Acid Modder
  • *
  • Posts: 742
  • Post quality +78/-2
  • Gender: Male
  • The CGnome Project
Re: Analog stick center calibration MOD (Joykostyl)
« Reply #10 on: October 29, 2017, 03:26:34 PM »
Those are cheaper since you can get a lot more than just 3 made up, but the shipping looks like it's $30 or more, and the PCB specs aren't quite as good in my opinion. The minimum hoe size is .30mm and the finish on them is HASL. OSHPark boards are all ENIG standard.

A 16.5mm x 16.5mm PCB from OSHPark is $2.15 for 3 of them. A 25mm x 35mm board would be $7.05 for 3. That's total costs, since shipping is free.
Screwing up is one of the best learning tools, so long as the only thing you're not learning is how to screw up.

Offline ZhenyaKa

  • Chief squatting Hard
  • *
  • Posts: 10
  • Post quality +0/-0
  • Gender: Male
  • Acidmods User
Re: Analog stick center calibration MOD (Joykostyl)
« Reply #11 on: October 29, 2017, 03:34:13 PM »
A 16.5mm x 16.5mm PCB from OSHPark is $2.15 for 3 of them. A 25mm x 35mm board would be $7.05 for 3. That's total costs, since shipping is free.

I can't clear understand. I pay for one and will get 2 additional PCB?

They wrote what 1 square inch costs $5.

Totally they ship 1 square inch diveded to 3 my PCB or 1+1+1 inch?

Offline RDC

  • Acid Modder
  • *
  • Posts: 742
  • Post quality +78/-2
  • Gender: Male
  • The CGnome Project
Re: Analog stick center calibration MOD (Joykostyl)
« Reply #12 on: October 29, 2017, 03:50:20 PM »
A 1sq inch board, 25.4mm x 25.4mm, would be $5 and you would get 3 of the boards for that $5.
Screwing up is one of the best learning tools, so long as the only thing you're not learning is how to screw up.

Offline ZhenyaKa

  • Chief squatting Hard
  • *
  • Posts: 10
  • Post quality +0/-0
  • Gender: Male
  • Acidmods User
Re: Analog stick center calibration MOD (Joykostyl)
« Reply #13 on: November 01, 2017, 03:52:01 AM »
PCB almost ready :)

Overheated right edge a little (temp sensor of hot airgun lost contact and temp quickly went to 450C)

I think to add exchange left-to-right stick functionality in FW.
I saw here question how to do that, but can't find thread.


Offline ZhenyaKa

  • Chief squatting Hard
  • *
  • Posts: 10
  • Post quality +0/-0
  • Gender: Male
  • Acidmods User
Re: Analog stick center calibration MOD (Joykostyl)
« Reply #14 on: November 02, 2017, 11:24:19 AM »
Gamepad PCB part:

Offline RDC

  • Acid Modder
  • *
  • Posts: 742
  • Post quality +78/-2
  • Gender: Male
  • The CGnome Project
Re: Analog stick center calibration MOD (Joykostyl)
« Reply #15 on: November 02, 2017, 08:57:39 PM »
Nice looking boards.

You can do any of the 4 Stick layouts in your code now since your board is between the Sticks and controller. Default, SouthPaw, Legacy and Legacy-Southpaw.
Screwing up is one of the best learning tools, so long as the only thing you're not learning is how to screw up.

Offline ZhenyaKa

  • Chief squatting Hard
  • *
  • Posts: 10
  • Post quality +0/-0
  • Gender: Male
  • Acidmods User
Re: Analog stick center calibration MOD (Joykostyl)
« Reply #16 on: November 03, 2017, 03:44:46 AM »
Nice looking boards.

You can do any of the 4 Stick layouts in your code now since your board is between the Sticks and controller. Default, SouthPaw, Legacy and Legacy-Southpaw.
Thanks.  Wire with fluoroplast insulation is great (MGTF names in Russia). Great to solder it and insulation not welding at all : )


What difference between this layouts?
I think that I need to add buttons proxy too. Now I just read it and can't exchange left and right button.

Offline RDC

  • Acid Modder
  • *
  • Posts: 742
  • Post quality +78/-2
  • Gender: Male
  • The CGnome Project
Re: Analog stick center calibration MOD (Joykostyl)
« Reply #17 on: November 04, 2017, 02:53:21 AM »
Default = Nothing changed.

SouthPaw = Left and Right swapped. Most common layout for left handed gamers. Sometimes L3/R3 are swapped also, depends on the gamer.

Legacy = Just the X-axis of Left and Right swapped.

Legacy-SouthPaw = Just the Y-axis of Left and Right are swapped.


You will not be able to swap the L3/R3 unless you cut those traces and wire the chip between them and the board, like how you have done with the stick Axis.
Screwing up is one of the best learning tools, so long as the only thing you're not learning is how to screw up.