Project to create a teensy based gamecube controller with hall effect sensors, snapback filtering, and notch calibration

Overview

PhobGCC

Gamecube controller motherboard using a teensy as the microcontroller. Aim is to make an accessible and consistent controller. Has the option of using hall effect sensors instead of potentiometers, notch calibration, and snapback filtering.

If your interested in making one, join the project discord to ask questions and get the most up to date information: https://discord.gg/eNJ7xWMvxf

Check out the wiki for some info about how the phobGCC works: https://github.com/Phobos132/PhobGCC/wiki

Hall effect sensors:

Prototypes

Board Version 1.1:

1.1

Initial prototypes:

Prototypes

Comments
  • Experimental notch adjustment

    Experimental notch adjustment

    This changes the calibration procedure.

    First it goes through collecting data: cardinals, then diagonals, then optionally notches. Then it does up to 12 more steps, in which you can adjust the notches while viewing the live output of the stick. Press B to reset to default.

    This needs testing with a controller shell that actually has notches.

    opened by CarVac 2
  • Merge hardware revision branches

    Merge hardware revision branches

    Rather than having branches with variants of the firmware code, split out the hardware-specific code into separate root .ino files, and put the shared code in another included source file.

    opened by CarVac 1
  • Implement lighter-weight Kalman filter

    Implement lighter-weight Kalman filter

    It should both run faster and be more responsive to small stick inputs.

    It's faster because I removed all the unnecessary matrix math.

    It responds to small stick inputs better because I made it weight the stick position higher when the stick isn't moving quickly in that axis. See the following graph, where orange is the new filter and yellow is the old filter (only shown for 100% stick travel).

    Screenshot_20220325_001150

    Bottom unit is frames at 60fps.

    Hopefully there are no bugs.

    opened by CarVac 1
  • Clean&comment, add cal point outlier rejection

    Clean&comment, add cal point outlier rejection

    Cleaned and commented linearizeCal, cleanCalPoints, and calcStickValues.

    Added rejection of 4 largest and smallest values in each axis for the origin for cleanCalPoints.

    opened by CarVac 0
  • Control UI overhaul

    Control UI overhaul

    Implemented the Rienne-style commands for PhobGCC configuration. All Sticks freeze when changes occur. C-stick Offset now displays the coordinate output when changed or allows for the current state to be checked. Also set up a safety check so that the user can't set it too high.

    opened by FrostSSBM 0
  • Add axis smoothing for ledgedashes

    Add axis smoothing for ledgedashes

    The previous attempt incurred quite a large performance penalty, so I moved the filter gain computation out of runKalman into its own function that can be called only when the source parameters get changed.

    opened by CarVac 0
  • Dev fixed time step basic

    Dev fixed time step basic

    • a fixed timestep of 1ms for the filter
    • teensy 4.0 support
    • averaging of ADC reading
    • small hysteresis on stick values to reduce noise/jitter

    Tested on boards 1.0, 1.1 with teensy 3.2, and 1.1 with teensy 4.0

    opened by Phobos132 0
  • C-stick Offset + SafeMode + Harder To Reset

    C-stick Offset + SafeMode + Harder To Reset

    C-stick Offset can now be adjusted using the X or Y button to define the Axis, A to increase or B to decrease. Controller now has a safe mode, Dpad Down + Start is necessary to configure anything. Reset is now harder to input, Start+Dpad Left.

    opened by FrostSSBM 0
  • Debug resetDefaults

    Debug resetDefaults

    Check resetDefaults for bugs and clean/comment (I think there's a small issue in there somewhere that makes the analog stick behave strangely after resetting the controller for the first time after programming)

    opened by Phobos132 0
  • Rework Teensy 3.2 Communication Code

    Rework Teensy 3.2 Communication Code

    Disclaimer: I can search stackoverflow posts well enough to cobble stuff together, but software is definitley not my specialty. This is not necessarily a good way of doing this, just a way that I got it to work on my setup.

    Requirements/Specifications: Non-blocking - Must allow other code to run while waiting for the next command Relatively low latency - Unclear exactly how important this is, shoot for <10 us between end of command and start of response Commands are expected to be 200kHz with ~1.25us lows indicating 1 and ~3.75us lows indicating 0 Responses will be ~250kHz with ~1us lows indicating 1 and ~3us lows indicating 0 See simples website for the the 'joybus' protocol: https://simplecontrollers.bigcartel.com/gamecube-protocol

    Implementation: Current implementation uses one of the teensys hardware serial ports to allow for asynchronous reading and writing of data The joybus protocol is approximated by the serial protocol in a 2 joybus bit per serial byte style, see: http://www.qwertymodo.com/hardware-projects/n64/n64-controller While the serial port can read and write the data well, it is not good at doing so with low latency, because of this interrupts and timers are used to keep track of how many bits have been read or written in order to respond with low latency

    Details: two main functions involved: bitcounter() function called by the RX pin interrupt which will activate on the falling edge of every pulse on the data line increments the bit count if only one bit has been read (indicating the start of a new command) start a timer which will call the communicate() function and set the commStatus to Read (because we are reading a command)

    	communicate()
    		function that gets called using timers to read data out of the hardware serial port buffers, parse it, determine the appropriate response, and write the data back to the hardware serial port buffers to be sent over the data line
    		
    	Process:
    		comm status is _commIdle
    		data line goes low causing interrupt, bitcounter runs:
    			start timer that will call communicate when the first 8 bits of the command have arrived
    			set the comm status to _commRead
    		
    		40us later
    		
    		communicate() gets called by the timer
    		if the comm status is commRead:
    			checks that we have 4 bytes of serial data (first 8 bits of the command)
    			read those 4 bytes and parse into a single byte of joybus data
    			set the serial baud rate to fast to be ready to send a response
    			decide if the byte is a probe, origin, or poll command, or something else (error)
    			if its a probe command:
    				set the timer to trigger again at the end of the response, send the preset probe response and set the write Queue to the probe response length + the command length
    				set the comm status to _commWrite
    			if its an origin command:
    				set the timer to trigger again at the end of the response, sent the preset origin response and set the write queue to the origin response length + the command length
    				set the comm status to _commWrite
    			if its poll command:
    				set the timer to trigger again a bit before the end of the poll command
    				set the comm status to _commPoll
    			if its something else:
    				got garbage data, reset everything, clear the serial port and try waiting for a stop bit to syncronize 
    		some time later
    		
    		communicate() gets called again by the timer
    		if comm status is _commPoll:
    			wait for _bitCount to reach 25, indicating that the poll command has finished
    			send the data in pollResponse (done immediately to minimize latency)
    			set the timer to trigger again at the thend of the poll response
    			set _writeQueue to the length of the poll response + the length of the poll command
    			set the comm status to _commWrite
    		if the comm status is _commWrite:
    			wait for _bitCount to equal _writeQueue, indicating that the response has finished
    			turn the serial baud rate back to slow
    			set the comm status to _commIdle
    			set _bitCount to 0
    			set _writeQueue to 0
    			clear the serial port in case there's any garbage data left to be ready for the next command
    

    Phobos' Suggestions:

    General cleanup and commenting (obviously)

    Improved parsing of serial bytes to joybus bits, should be able to just look at bits 2 and 5 (6?) of the serial data to decide what the joybus bits are, rather than matching the whole byte

    Try running in half duplex mode, this is a recent addition to the teensy serial library and worked with the teensy 4.0, should work here too. Will make things cleaner and will remove the need for the diode

    Consider setting up the hardware serial directly rather than using the teensy serial libraries, may make things cleaner and lower latency

    See if the response can be sent to the hardware serial buffers as an array rather than one byte at a time, I tried this but wasn't able to make it work without increasing latency significantly

    See if we can interrupt directly from the hardware serial port on data available (not serialevent(), I think this can be done but was too complicated for me to implement quickly

    opened by Phobos132 0
  • Create Full Build Instructions

    Create Full Build Instructions

    Need to fully document the build process including: Ordering Boards Ordering Parts Disassembling a controller Assembling the board Programming the Teensy

    documentation 
    opened by Phobos132 1
Releases(v0.20)
  • v0.20(May 21, 2022)

    Includes:

    • New Calibration Routine
    • Axis Delay Control (For Ledgedashing)
    • C-stick Snapback Control (With Axis-delay for wrong-aerial)
    • New Trigger Modes
    • New less D-pad Reliant Control Scheme

    Bug Fixes:

    • Trigger Tricking Now Works
    Source code(tar.gz)
    Source code(zip)
Owner
null
matrix-effect This is a dumb matrix effect type thing

matrix-effect This is a dumb matrix effect type thing. It's only like one source file which should compile... Define __POSIX or __WIN though, for posi

null 42 Sep 23, 2022
Linux HWMON sensors driver for ASUS motherboards to get sensor readings from the embedded controller

asus-wmi-ec-sensors Linux HWMON sensors driver for ASUS motherboards to read sensors from the embedded controller Many ASUS motherboards do not publis

Eugene Shalygin 6 Aug 30, 2022
Create a firework effect with WS2812b LED and a MCU

LED-Fireworks Firework effect with WS2812b LED and a MCU This project uses FastLED library to control the LED strip. WS2812b IC is embedded into each

null 75 Dec 5, 2022
A simple 3D game engine for GameCube, Wii, 3DS, Windows, and Linux.

octave A Simple 3D Game Engine for GameCube, Wii, 3DS, Windows, and Linux Windows Setup Download and Install: Visual Studio Community 2017 (with C++ s

Martin Holtkamp 10 Dec 25, 2022
A cheap,simple,Ongeki controller Use Keyboard Simulation and Mouse Simulation to controller the ongeki game. Using Pro-micro control.

N.A.G.E.K.I. A cheap,simple,Ongeki controller Use Keyboard Simulation and Mouse Simulation to controller the ongeki game. Using Pro-micro control. 中文版

NanaNana 39 Dec 8, 2022
A cheap,simple,Ongeki controller Use Keyboard Simulation and Mouse Simulation to controller the ongeki game. Using Pro-micro control.

N.A.G.E.K.I. PLEASE CHECK Main Project A cheap,simple,Ongeki controller Use Keyboard Simulation and Mouse Simulation to controller the ongeki game. Us

NanaNana 11 Dec 30, 2021
DirectX 11 library that provides convenient access to compute-based triangle filtering (CTF)

AMD GeometryFX The GeometryFX library provides convenient access to compute-based triangle filtering (CTF), which improves triangle throughput by filt

GPUOpen Effects 218 Dec 15, 2022
custom esp8266 controller for driving the pwm led controller

room8266 custom esp8266 controller for driving the pwm led controller designed to drive this: https://github.com/austinscreations/PWM-LED-Controller t

null 1 Nov 1, 2021
QNEthernet, an lwIP-Based Ethernet Library For Teensy 4.1

QNEthernet, an lwIP-Based Ethernet Library For Teensy 4.1 Version: 0.10.0-snapshot The QNEthernet library provides Arduino-like Ethernet functionality

Shawn Silverman 28 Dec 7, 2022
This repo contains source code of our paper presented in IROS2021 "Single-Shot is Enough: Panoramic Infrastructure Based Calibration of Multiple Cameras and 3D LiDARs"

Single-Shot is Enough: Panoramic Infrastructure Based Calibration of Multiple Cameras and 3D LiDARs Updates [2021/09/01] first commit, source code of

Alibaba 83 Dec 19, 2022
ROS1 and ROS2 messages for event based image sensors

ROS package with array messages for event based cameras This package has definitions for messages created by event based sensors. The events are kept

Bernd Pfrommer 1 Feb 22, 2022
Application firewall PoC with filtering performed in the kernel, for Linux.

Voi Application firewall with filtering performed in the kernel, for Linux. Status Currently just scaffolding code No where near ready for a productio

Marc 7 Sep 15, 2022
Invariant-ekf - C++ library to implement invariant extended Kalman filtering for aided inertial navigation.

inekf This repository contains a C++ library that implements an invariant extended Kalman filter (InEKF) for 3D aided inertial navigation. This filter

Ross Hartley 273 Dec 24, 2022
Fast and Accurate Extrinsic Calibration for Multiple LiDARs and Cameras

Fast and Accurate Extrinsic Calibration for Multiple LiDARs and Cameras The pre-print version of our paper is available here. The pre-release code has

HKU-Mars-Lab 244 Dec 24, 2022
Teensy 4 I2S Audio Library

Teensy 4 I2S Library This is a no-nonsense I2S library for Teensy 4 and 4.1. It was derived from the I2S code in Paul Stoffregen's Teensy Audio Librar

Valdemar Erlingsson 8 Sep 26, 2022
Arduino code for a high speed 8000hz wired mouse using a teensy 4 MCU

teensy4_mouse Arduino code for a high speed 8000Hz wired mouse using a teensy 4 MCU. This code is inspired by https://github.com/mrjohnk/PMW3360DM-T2Q

Herbert Trip 9 Nov 19, 2022
Use Atari keyboard as USB keyboard with a Teensy 3.6

Atari Keyboard Convert an Atari 600/800/1200 XL into a USB keyboard. I bricked my Atari mainboard. My goal is to use the keyboard of the Atari on a Ra

Jos Koenis 2 Dec 3, 2021
Collection of tools to manage Teensy boards

You can find these instructions on the official web page. Overview TyTools is a collection of independent tools and you only need one executable to us

Niels Martignène 181 Dec 31, 2022
monome serial library for teensy development boards

monome-teensy allows teensy development boards to communicate with monome grids via monome serial protocol works with teensy 3.6, 4.0 and 4.1 (when us

Josh Ruihley 9 Oct 5, 2022