DIY Daystate GCU v5 (Red Wolf) programmer

How to build your own Daystate GCU v5 programming tool, this is the GCU found in the Red Wolf. The GCU communicates with the Daystate programmer via a '1 wire' serial interface, to build one of your own you will need the following components:

1 x 4k7 1/4 Watt 5% resistor (EBay $3.49 for 100)

1 x 1N4148 Diode (EBay $1.59 for 10)

1 x JST SH 1.0 5 pin plug with tails (EBay $3.49 for 10)

1 x USB-UART 5V TTL adapter (EBay $2.58 each)

All these parts can be found easily on EBay or Amazon although you may end up buying a pack of 10 or a 100 diodes and resistors. Even if you don't have any of these parts on hand you can still build the hardware for less than $20

Once you have these parts you will need to assemble them as shown in the schematic diagram below

1wire_schematic.1645906337.png


Note the pin number on the programming header of the GCU

header.1645906824.png




Depending on the type of USB-UART adapter you purchased you may be able to add the diode and resistor directly to the adapter


small_1wire.1645906413.jpg


A fully assembled adapter and cable look like this (only 3 of the 5 pins are required)


assembled.1645906879.jpg


Now that you have your hardware assembled you can plug it into your PC and follow the vendor's instructions to install drivers etc. Next you will need to download some software from Github.

https://github.com/DaystateRebel/gcui

The gcui tool is written in Rust (https://www.rust-lang.org/tools/install) but for convenience I have made a compiled Windows binary available here:

https://github.com/DaystateRebel/gcui_binaries/blob/main/gcui.exe

Download the exe (or build from source code if you prefer) and put it in a directory on your hard drive. Open a command prompt ad "cd" to the directory where you saved the executable. Gcui can perform the following functions (replace comX with the name of the USB-UART hardware, you'll find it in Device Manager)

To read power settings from the GCU

$ gcui.exe --port=comX --read --filename=file.csv

To write power settings to the GCU

$ gcui.exe --port=comX --write --filename=file.csv

To read the current air pressure from the GCU

$ gcui.exe --port=comX --pressure

To read the current pulse duration from the GCU

$ gcui.exe --port=comX --pulse

To read the GCU version

$ gcui.exe --port=comX --rwversion

The power settings are read to / written from a .csv which you can open in Excel/Google Sheets

Screenshot from 2022-02-26 16-12-05.1645909942.png


Congratulations, you can now easily download, edit, save and reload power settings from your computer instead of writing them on bits of paper - welcome to the 21st Century!

Coming next - What do all these numbers mean and how do I recalculate HS & LS? I will also be adding support for "locked power" mode to gcui so we a full featured alternative to the current hardware programmer

Happy Hacking

Rebel
 
The Sciencey Bit: Daystate use Piecewise Linear Approximation to calculate the hammer strike pulse duration based on 3 set points and the pressure in the bottle. The goal is to calculate how long the hammer strike pulse must last at any given bottle pressure from only those three calibration points (Hi, Mid & Low pressure). This reduces the effort required to calibrate a rifle while still offering decent

The difference between the bottle pressure and the set point pressure is calculated then multiplied by a pre-calculated 'slope' (HS - High Slope, LS - Low Slope) to get a pulse duration delta that is added to the set point pulse duration

The algorithm looks like this:

u16 CalculatePulseDuration(u16 Pressure)
{
if Pressure > Hi Pressure {
pulse duration = Hi Pulse + ((Pressure - Hi Pressure) * HS)/128
return pulse duration
}
if Pressure > Mid Pressure {
pulse duration = Hi Pulse - ((Hi Pressure - Pressure) * HS)/128
return pulse duration
}
if Pressure < Low Pressure {
pulse duration = Low Pulse
return pulse duration
}
if Pressure < Mid Pressure {
pulse duration = Mid Pulse - ((Mid Pressure - Pressure) * LS)/128
return pulse duration
}
}

Where:

Pressure - the measured pressure in the bottle

Hi, Mid, Low Pulse - the hammer strike pulse duration at Hi, Mid, Low pressure from the power settings

Hi, Mid, Low Pressure - the Hi, Mid, Low pressure from the power settings

HS - High Slope, the microseconds/BAR ratio used when bottle pressure is greater than the mid pressure set point

LS - Low Slope, the microseconds/BAR ratio used when bottle pressure is less than the mid pressure set point

All of the above is calculating the difference between current bottle pressure and one of the 3 set points by the HS (when bottle pressure is greater than the mid pressure set point) else LS (when the bottle pressure is less than the mid pressure set point) and adding/subtracting it to/from the pulse duration at that setpoint

So, now we know what's going on let's look at the power setting data from my Red Wolf (25cal standard power). The HS & LS values should allow us to calculate the pulse duration at the High, Low and Mid points

Screenshot from 2022-02-26 16-12-05.1645923837.png


Low Power (3) - Bottle pressure is at the Low Pressure set point
Mid pressure - Low pressure = 675 - 400 = 275

Pulse duration = Mid Pulse - ((Mid pressure - Low pressure ) * LS) / 128

Pulse duration = 1785 - ((675 - 400) * 97) / 128 => 1785 - 208.4 = 1576.6

This is close enough to 1575 (the Low Pulse duration)

Low Power (3) - Bottle pressure is at the Mid Pressure set point

Hi point pressure - Mid point pressure = 925 - 675 = 250

Pulse duration = High Pulse - ((Hi point pressure - Mid point pressure) * HS) / 128

Pulse duration = 2085 - ((925 - 675) * 153) / 128 => 2085 - 298.8 = 1786.2

This is close enough to 1785 (the Mid Pulse duration)

Mid Power (2) - Bottle pressure is at the Low Pressure set point
Mid pressure - Low pressure = 725 - 525 = 200

Pulse duration = Mid Pulse - ((Mid pressure - Low pressure ) * LS) / 128

Pulse duration = 2100 - ((725 - 525) * 128) / 128 => 2100 - 200 = 1900

This is exactly 1900 (the Low Pulse duration)

Mid Power (2) - Bottle pressure is at the Mid Pressure set point

Hi point pressure - Mid point pressure = 925 - 725 = 250

Pulse duration = High Pulse - ((Hi point pressure - Mid point pressure) * HS) / 128

Pulse duration = 2375 - ((925 - 725) * 176) / 128 => 2375 - 275 = 2100

This is exactly 2100 (the Mid Pulse duration)

High Power (3) - Bottle pressure is at the Low Pressure set point
Mid pressure - Low pressure = 825 - 725 = 100

Pulse duration = Mid Pulse - ((Mid pressure - Low pressure ) * LS) / 128

Pulse duration = 2725 - ((825 - 725) * 160) / 128 => 2725 - 125 = 2600

This is exactly 2600 (the Low Pulse duration)

Mid Power (2) - Bottle pressure is at the Mid Pressure set point

Hi point pressure - Mid point pressure = 975 - 825 = 150

Pulse duration = High Pulse - ((Hi point pressure - Mid point pressure) * HS) / 128

Pulse duration = 3000 - ((975 - 825) * 352) / 128 => 3000 - 412.5 = 2588

WTF? This is way less than the mid pulse value of 2725

I doubt Daystate shipped it like that (and it's suspicious that Hi power HS = 2 * Mid power HS). Could it be that someone 'tuned' my Red Wolf before I got it? Let's calculate the correct HS:

High pulse - Mid pulse = 3000 - 2725 = 275

Hi point pressure - Mid point pressure = 975 - 825 = 150

HS = 275 * 128 / 150 = 235

Pulse duration = 3000 - ((975 - 825) * 235) / 128 => 3000 - 275.4 = 2725 :D

So now I can fix my Red Wolf's high power setting!
 
Really interesting work, and a lot to take in there!

I have a couple questions- 

1. On the calculations where you are checking the pulse durations, why is the second part of the formula divided by 128? I understand that the equation is attempting to determine how much to modify the reference pulse value but I don't understand where the 128 value comes from.

2. How are the slope values calculated and what are the units? I think of slope as the rate of change of the y axis divided by the rate of change of the x axis. As an example, why wouldn't the high slope for power level 1 be (Hi Pulse - mid pulse)/(hi pressure - mid pressure) which would give (3000-2725)/(975-825) =1.83. The value in the spreadsheet says 352.

I'm sure I'm probably missing something fundamental. Thanks in advance for the help.
 
Since the information is now public, some Richard Cranium will be selling these on ebay and reaping the rewards of someone else's hard work. Been there, saw that.



Considering the price of these airguns, you would think that Daystate would just include a programmer with each one. But then again, I keep saying that FX should include a radar with each of their airguns too. In the case of Daystate, you can see that with the addition of a little heatshrink, they could send these out at $10-$15 each and including them with a $3000 rifle is a pretty trivial amount on increase.
 
  • Like
Reactions: Smitty911
Wow, you created GUI as well. I have no issue with CLI stuff but this is way easy from the looks of it. Now to see if I can see well enough to solder up what you diagrammed and load a window instance on one of my boxes. (It should be illegal for me to touch a soldering iron unless the wire gauge is 14 or bigger.)
 
Does anyone know if this programmer and GUI could be
used on the Airwolf MCT and Daystate Target also?

Or only on the Redwolf?
Can you post some pics of the electronics in those?
Wow, you created GUI as well. I have no issue with CLI stuff but this is way easy from the looks of it. Now to see if I can see well enough to solder up what you diagrammed and load a window instance on one of my boxes. (It should be illegal for me to touch a soldering iron unless the wire gauge is 14 or bigger.)
CLI FTW! But I what I was referring to is this : https://www.airgunnation.com/threads/wifi-wolf.1268819/

That picture is from the Web UI I have been working on - I'm about 90% of the way to a minimal viable product. Might be ready for a Beta test in a month or two. I will have a new demo video soon

"and load a window instance on one of my boxes" - the source code is here: https://github.com/DaystateRebel/gcui

It's written in Rust so you should have no problems compiling on Linux or a Mac (PM me if you need help getting started)