Wireless Wii Nunchuck *TESTERS WANTED

OK, cruise -> brakes is the ESC. I've seen this too on my Flier and it went away after reflashing to different code. What I think is happening there (based on having seen it a few times and testing): the ESC sees a constant signal from cruise, and decides that's the new "neutral." Then when it drops back to the stick-neutral, the ESC thinks it's negative and applies brakes. Depending on where the cruise was set, this could be a lot of brakes.

The servo / ESC signal is a time pulse between 1 000 and 2 000 us (microseconds), once every 20 000 us. "Neutral" is exactly halfway, or 1 500 us. Usually :) 1 000 == full brakes, 2 000 == full power. Wiiceiver uses exactly 1 500 as neutral, 2 000 as full power, 1 000 as full brakes. Any controller will look for the middle stick position and call it 1 500, but it's impossible to know that the stick is perfectly centered. That's one reason for the trim tabs on a good RC controller. On a nunchuck, Nintendo just assumes the stick is centered when you power up the wii, so whatever position at startup = "center." If you hold it to the right when you turn it on, it will get screwed up -- letting it back to "center" ends up being pretty far left, for instance.

Wiiceiver doesn't do that. Some ESCs *do* perform that sort of checking, though, and cruise control is something of an unnatural thing for an ESC to see. In an RC car, and I imagine most ESC tests, the receiver will get a varying signal from idle, up, brakes, idle, etc. it's possible your ESC is programmed to treat a constant flat signal (even high, like 1 750 us) as the new "neutral." If the signal drops even a little (to 1 700, which is like 35% throttle) the ESC would interpret this as brakes...

I haven't been able to get into an ESC code, which is part of the reason Vedder's project exists. I'd love to be able to confirm the above, but I can't. I know it happened a lot on a flier with one code version, and stopped happening when I reverted. Some have a setting for automatically setting neutral, but on Flier I wasn't able to turn it off reliably.

On yours I'd recommend testing with the board upside down. Set cruise, speed up, slow down, see if you can hold a fixed speed for a long time, see what happens when you let it back to neutral, etc. If you can reliably get it to suck, lemme know. It would be easy to update 'cruise' to send slightly varying signals -- small enough to be unnoticable, but enough to keep the ESC from freaking out. If you can get the problem to repeat I will send over some code to hopefully fix it.
 
Hi, i've bought 2 different wireless controller but i can't manage them. if i connect the motor, start to accelerate automatically and at full speed disconnect. this is what I got when i left the controller on the table. any idea?
Code:
655     X: 54   Y: 46   AccX: 48         AccY: 46        AccZ: 255       0 1
656     X: 151  Y: 46   AccX: 49        AccY: 47        AccZ: 129       1 0
657     X: 204  Y: 77   AccX: 31        AccY: 44        AccZ: 43        0 1
658     X: 46   Y: 46   AccX: 49        AccY: 47        AccZ: 45        0 1
659     X: 202  Y: 158  AccX: 205     AccY: 256       AccZ: 46        0 1
660     X: 110  Y: 174  AccX: 49       AccY: 47        AccZ: 46        0 1
661     X: 46   Y: 46   AccX: 49        AccY: 47        AccZ: 46        0 1
662     X: 46   Y: 46   AccX: 49        AccY: 47        AccZ: 46        0 1
663     X: 46   Y: 46   AccX: 49        AccY: 47        AccZ: 46        0 1
664     X: 46   Y: 46   AccX: 90        AccY: 27        AccZ: 43        1 1
665     X: 46   Y: 52   AccX: 47        AccY: 47        AccZ: 30        0 1
666     X: 46   Y: 46   AccX: 47        AccY: 47        AccZ: 100       1 0
667     X: 25   Y: 39   AccX: 205       AccY: 48        AccZ: 48        0 0
668     X: 255  Y: 46   AccX: 49        AccY: 49        AccZ: 181       1 0
669     X: 78   Y: 46   AccX: 48        AccY: 47        AccZ: 46        0 1
670     X: 14   Y: 231  AccX: 90        AccY: 62        AccZ: 220       0 0
671     X: 46   Y: 46   AccX: 49        AccY: 47        AccZ: 46        0 1
672     X: 46   Y: 46   AccX: 49        AccY: 47        AccZ: 46        0 1
673     X: 46   Y: 46   AccX: 49        AccY: 47        AccZ: 46        0 1
674     X: 46   Y: 46   AccX: 49        AccY: 47        AccZ: 46        0 1
675     X: 46   Y: 46   AccX: 48        AccY: 52        AccZ: 31        0 0
676     X: 89   Y: 50   AccX: 30        AccY: 214       AccZ: 198       1 1
677     X: 233  Y: 67   AccX: 46        AccY: 48        AccZ: 174       0 1
678     X: 46   Y: 242  AccX: 242       AccY: 245       AccZ: 245       0 1
679     X: 242  Y: 242  AccX: 242       AccY: 215       AccZ: 235       1 1
680     X: 190  Y: 159  AccX: 39        AccY: 68        AccZ: 46        0 1
681     X: 46   Y: 27   AccX: 165       AccY: 159       AccZ: 115       0 1
682     X: 46   Y: 169  AccX: 49        AccY: 210       AccZ: 46        0 1
683     X: 46   Y: 46   AccX: 49        AccY: 47        AccZ: 46        0 1
684     X: 46   Y: 46   AccX: 258       AccY: 258       AccZ: 258       1 1
685     X: 255  Y: 255  AccX: 258       AccY: 258       AccZ: 258       1 1
686     X: 255  Y: 255  AccX: 258       AccY: 258       AccZ: 258       1 1
687     X: 255  Y: 255  AccX: 258       AccY: 258       AccZ: 258       1 1
688     X: 255  Y: 255  AccX: 258       AccY: 258       AccZ: 258       1 1
689     X: 255  Y: 255  AccX: 258       AccY: 258       AccZ: 258       1 1
690     X: 255  Y: 255  AccX: 258       AccY: 258       AccZ: 258       1 1
691     X: 255  Y: 255  AccX: 258       AccY: 258       AccZ: 258       1 1
692     X: 255  Y: 255  AccX: 258       AccY: 258       AccZ: 258       1 1
693     X: 255  Y: 255  AccX: 258       AccY: 258       AccZ: 258       1 1
694     X: 255  Y: 255  AccX: 258       AccY: 258       AccZ: 258       1 1
695     X: 255  Y: 255  AccX: 258       AccY: 258       AccZ: 258       1 1
696     X: 255  Y: 255  AccX: 49        AccY: 46        AccZ: 44        0 1
697     X: 46   Y: 41   AccX: 66        AccY: 46        AccZ: 54        0 1
698     X: 46   Y: 46   AccX: 258       AccY: 7 AccZ: 151       0 1
699     X: 46   Y: 46   AccX: 129       AccY: 237       AccZ: 158       1 0
700     X: 52   Y: 43   AccX: 47        AccY: 47        AccZ: 46        0 1
701     X: 46   Y: 46   AccX: 48        AccY: 48        AccZ: 203       0 1
702     X: 201  Y: 255  AccX: 49        AccY: 47        AccZ: 111       0 1
703     X: 46   Y: 46   AccX: 49        AccY: 47        AccZ: 46        0 1
704     X: 46   Y: 46   AccX: 49        AccY: 47        AccZ: 46        0 1
 
what code is reading the nunchuck? If it's really sitting on a table, I'd expect very small deviation (if any) in the X & Y, and none in the accelerometers. Seeing them go 25 to 255 is terrifying. It also looks like the C and Z buttons are flipping on & off.

The fact that they're sitting around 45 (and not a midpoint, closer to 128) is also weird, but without knowing how the inputs are being interpreted I don't know what's up.

Do these controllers work on an actual Wii?
 
I really don't know if is working on the wii.
this listed is another arduino program.
today i will send you the debug output from your sketch. i have tried with / with-out pull-up on the line. next step is to send command directly on the Nunchuck with a bus pirate and see if i get any answer from this address.

EDIT:
tried with this init sequence with no success. same data on output.(competition pro & snakebyte) are the brand.
Code:
static byte nunchuck_init (unsigned short timeout)
{
  static byte rc = 1;
  unsigned long time = millis();
  do
  {
    Wire.beginTransmission (WII_NUNCHUCK_TWI_ADR);  // transmit to device 0x52
    Wire.write (0xF0);   // sends memory address Snakebyte Wireless Motion XS controller
    Wire.write (0x55);   // sends data.
    Serial.println("Handshake 1/2....");
    if (Wire.endTransmission() == 0) { // stop transmitting
      Wire.beginTransmission (WII_NUNCHUCK_TWI_ADR);  // transmit to device 0x52
      Wire.write (0xA5);   // sends memory address for Snakebyte Wireless Motion XS controller
      Wire.write (0x00);   // sends sent a zero.
      Serial.println("Handshake 2/2....");
      if (Wire.endTransmission () == 0) {
        rc = 0;
      }
    }
  }
  while (rc != 0 && (!timeout || ((millis() - time) < timeout)));
  Serial.println("OK.");
  delay(3000);
  return rc;
}
 
the data MOSTLY looks legit, apart from a few really nutty bits like showing values > 255 (impossible) and the solid 255s across the board. I've never seen a nunchuck do that.

Run the wiiceiver code and uncomment "#define DEBUGGING_CHUCK", you'll see what it thinks the chuck is doing.
 
this is your code.
Code:
(Re)starting the nunchuck: #6
156090: Chuck.setup() ... transmitted @ 156092; setup complete @ 156228
Reading stored value: Y=255
Ingoring stored value
156229 Waiting for activity ... 156619: active!
156620Waiting for 0
157168: finished inactivity -- chuck is active
Nunchuck is active!
Read autoCruise from EEPROM: 255; ignoring, leaving autoCruise = 0.05
y=-1.0000, c=0, z=0, -1.0000
INACTIVE!!
157260: handling inactivity
157260: freaking out
157493Waiting for 0
157641: finished inactivity -- chuck is active
y=-1.0000, c=1, z=1, 0.0000
y=-1.0000, c=0, z=0, -1.0000
y=-0.8906, c=1, z=1, 0.0000
y=-1.0000, c=0, z=1, -1.0000
y=-0.8125, c=0, z=1, -0.8125
y=-1.0000, c=1, z=0, 0.0000
y=-0.0234, c=1, z=0, 0.0120
y=-1.0000, c=1, z=1, 0.0090
y=-1.0000, c=1, z=1, 0.0060
y=-1.0000, c=1, z=1, 0.0030
y=-1.0000, c=1, z=1, 0.0000
y=-1.0000, c=0, z=1, -1.0000
y=-0.9062, c=0, z=0, -0.9062
y=-0.5391, c=1, z=1, 0.0000
y=0.5984, c=1, z=1, 0.0018
y=0.5984, c=0, z=0, -0.6401
y=0.2441, c=1, z=1, -0.6281
y=-0.3125, c=1, z=1, 0.0000
y=-1.0000, c=0, z=0, -1.0000
INACTIVE!!
158147: handling inactivity
158147: freaking out
158380Waiting for 0
160318: finished inactivity -- chuck is active
y=-1.0000, c=1, z=1, 0.0000
y=-1.0000, c=0, z=1, -1.0000
y=-0.9687, c=1, z=1, 0.0000
y=-1.0000, c=0, z=1, -1.0000
y=-0.6953, c=1, z=0, 0.0000
y=-0.0234, c=1, z=0, 0.0120
y=-1.0000, c=1, z=1, 0.0090
y=-1.0000, c=1, z=1, 0.0060
y=-1.0000, c=1, z=1, 0.0030
y=-1.0000, c=1, z=1, 0.0000
y=-1.0000, c=0, z=1, -1.0000
y=-0.9062, c=0, z=0, -0.9062
y=-0.5391, c=1, z=1, 0.0000
y=0.5984, c=1, z=1, 0.0018
y=0.5984, c=0, z=0, -0.6401
y=0.2441, c=1, z=1, -0.6281
y=-0.3125, c=1, z=1, 0.0000
y=-1.0000, c=0, z=0, -1.0000
INACTIVE!!

after i switched off the controller took 10 second to show that is disconnected.
 
ick. If the controller is sitting on a table during that sample, your controller is hosed.

156229 Waiting for activity ... 156619: active!
156620Waiting for 0
157168: finished inactivity -- chuck is active
Nunchuck is active!
Read autoCruise from EEPROM: 255; ignoring, leaving autoCruise = 0.05
y=-1.0000, c=0, z=0, -1.0000
INACTIVE!!

That says the chuck started up (we sent a signal to get it moving, read some data from it), the chuck sent a good Y signal quickly (in ~300ms) at a neutral position, somewhere around 120-130, and saw motion -- stick moving, accelerometers changing, etc.

Then it shows no buttons and Y at 0 (-1.0000 angle), and INACTIVE -- that same signal for at least 100 reads.

After that it gets nutty with the stick buttons. I think you might have found a bum controller.

I was just talking to a guy in Brazil who seemed to have two bad ones -- a Kama + Memorex. Now I'm about to go test the two Kamas I still have boxed outside :/
 
I got 2 different controller and both have the same output! is (impossible) to get 2 broken...
 
bgvsan said:
I got 2 different controller and both have the same output! is (impossible) to get 2 broken...

Do you have any controllers that work correctly? Maybe your wiiceiver is fried?

The i2c protocol with the nunchucks is kinda simple: it sends a startup sequence, then reads back 6 bytes / 48 bits. It's possible you're getting random noise on the i2c bus, and wiiceiver is just interpreting that like activity.

you could try and I2C scanner like http://playground.arduino.cc/Main/I2cScanner and see if the nunchuck is talking correctly, or if you're just getting random garbage.

I used i2c_scanner, changed setup() to power up the nunchuck on wiiceiver:

Code:
void setup()
{
  Wire.begin();

  Serial.begin(9600);
  Serial.println("\nI2C Scanner");
  pinMode(11, OUTPUT);
  digitalWrite(11, HIGH);
}

when running, it says:

Code:
I2..
I2C device found at address 0x52  !
done


and I confirmed, 0x52 is the slave address for a nunchuck.
 
Code:
Scanning...
I2C device found at address 0x52  !
done

the device seem to be there.
 
tried again but same problem..instable to read also with the bus pirate.
i think is a joystick problem. can you suggest me one to buy?
 
hey guys -- I'm testing a 2.0 release, see https://endless-sphere.com/forums/viewtopic.php?f=35&t=72989 for details.

Also I'm offering a free upgrade (in the form of a programmed ATmega328 + replacement heat shrink) for anyone who bought a wiiceiver kit from me or torqueboards -- free shipping too (in the US) -- as a special thanks for your support.

austindavid.com/wiiceiver, scroll to the bottom for the "buy it now" upgrade button, or PM me with your address.
 
hi guys, so i have gotten the nunchuk_mod remote that vedder and i worked on to work with the wiiceiver/uno/nano basically this gives the the option for those who don't use the VESC to still use this remote and or use the VESC with ppm but have the arduino receiver to do other functions.

the remote will function the same as a wired or nyko kama with the wiiceiver.

iv sent a nunchuck pcb to austin hopefully he will get that soon to complete testing and debugging.

code https://drive.google.com/file/d/0Bym9XrdeViekamhqVHphRmpwdWc/view?usp=sharing
next step is to port code for the remote from chibios to arduino for the stm32f103 line but won't finish this until i have usb bridge from the remote to the vesc working (code almost finished)
 
BadWolf said:
Cool, cause I found your video with you prototyping the wiiciever on an attiny84 and I was curious why you decided to move on to the 328. But now I know =)

Got my wireless nunchuck this morning, I had found a black "Big Ben"-brand that had a nice design. I really wanted something a black transmitter so it would match the rest of the board. It was super easy to open up the receiver and connected it up to an arduino pro mini-clone. One change I did was to move the cruise control to the bigger Z button, I will be doing some test later today hopefully..

large_de10126b370da6fe791798058d7a6b45.jpg.jpg
I'm thinking of buying the Big-Ben as well because both memorex and nyko kama are difficult to get a hold of where I live. Did it work out well for you? I'm not really sure what problems there would be with other manufacturers, seems like if they all hook up to the same wii controller (under normal use), they also need to follow the same protocol!?
 
Hi, I have purchased and received a kit for self assembly. Reading the manual I'm confused, does the atmega chip which comes with the kit already have a usable boot loader burnt in or do I need to do it myself?

Thanks
 
Pontation said:
Hi, I have purchased and received a kit for self assembly. Reading the manual I'm confused, does the atmega chip which comes with the kit already have a usable boot loader burnt in or do I need to do it myself?

If you got it from me, it does. It should have a silver dot on it (I use that to mark the ones I've set a bootloader on) and a "2" (v 2.x).
 
Back
Top