New run of orbshields

SpaceOrb drivers and software discussions
Forum rules
kenyee
Posts: 51
Joined: April 02 2013, 8:33 AM

Re: New run of orbshields

Postby kenyee » July 24 2013, 16:58 PM

[quote="Tehrasha"][quote="kenyee"]
While chords may be possible with the 5000, I dont know if it is exactly practical. :)

Are you able to get all 10 buttons to work?[/quote]
[/quote]


True...You'd have to have super big hands to get it to work one-handed :lol:

You could shift w/ the other hand though.



All 9 buttons work, but they're shifted like this:

1 (on Spaceball5000) -> 2 (on windows control panel)

2 -> 3

9 -> 1 (note the rollover of some variable or mask)

A -> 2

B -> 3

C -> 4

So it's offset there too.

vputz
Posts: 339
Joined: March 25 2006, 20:21 PM
Contact:

Re: New run of orbshields

Postby vputz » July 25 2013, 18:38 PM

Well, the chording is in orbotron_translator.h ... the processing is handled in three stages and thus three files.



Basically, orbotron_buffer.h handles processing from the orb and makes an internal model of what the physical orb is doing -- the buttons pressed, etc. So in orbotron_buffer.h, you'll find


[code]
void process_magellan_buttondata( void )
{
if ( crunch_magellan_nibbles() )
{
physical_buttons = (buffer[1] << 1)
| (buffer[2] << 5)
| buffer[3];
}

}
[/code]


...which is basically taken from the linux magellan.c driver in magellan_process_packet:


[code]
case 'k': /* Button data */
103 if (magellan->idx != 4) return;
104 if (magellan_crunch_nibbles(data, 3)) return;
105 t = (data[1] << 1) | (data[2] << 5) | data[3];
106 for (i = 0; i < 9; i++) input_report_key(dev, magellan_buttons[i], (t >> i) & 1);
107 break;
[/code]


So orbotron_buffer.h handles a model of what the orb is doing. Orbotron_device.h handles the "how it appears to the computer" side of things--in other words, how to send messages to the logical orb that the computer sees. This used to be bigger when we had to handle our own processing of the USB packets, but that's mostly handled by the Arduino Caterina bootloader with a few minor mods.



The filling in the sandwich is orbotron_translator.h. That handles the translation from the model of the physical orb to the computer model. And that's important, because obviously e.g. the orbs don't really have 16 buttons etc. So in orbotron_translator.h you find all the gain and scaling and mapping to buttons and chording and such.



So mapped_buttons is the function that handles the buttons.


[code]
unsigned short mapped_buttons( Logical_orbotron& orb )
{
unsigned short result;
// work chording here
if ( chording )
{
int chord_page = orb.physical_buttons & 3;
result = ( orb.physical_buttons >> 2 ) << ( 4*chord_page);
}
else
{
result = orb.physical_buttons;// & 63;
}
return result;
}
[/code]


So the weird thing is, if you look at process_magellan_buttondata and mapped_buttons if chording is off... well, you're basically reporting what the orb gives. So if the buttons are remapped weirdly--that may be what it's saying. We can add code to make it look more normal, and that's probably a good idea.



As for the axes on the 5000, it's a little weird that it requires a smaller sensitivity, because what SHOULD happen is that the greater sensitivity just firewalls it to the edges faster. So I should take a look at that.



Next set of boards is on order, so even though I'm about out of stock, we'll be back in a bit.

A Future Pilot
Posts: 14
Joined: February 26 2013, 22:12 PM

Re: New run of orbshields

Postby A Future Pilot » August 09 2013, 13:29 PM

OK, so I've gotten my Orbotron and my Spaceball 4000FLX and I'm trying to get it working. I downloaded Arduino 1.0.3 and copied the files to hardware and libraries like the readme says. I also set the board to Orbotron 9000. Then I loaded up BasicJoystick and changed SpaceOrb360 to SpaceBall4000. But when I try to upload it, I get the error: buffered memory access not supported. Maybe it isn't a butterfly/AVR109 but a AVR910 device? What should I do?

vputz
Posts: 339
Joined: March 25 2006, 20:21 PM
Contact:

Re: New run of orbshields

Postby vputz » August 10 2013, 14:07 PM

Sorry for not seeing this until today--you did well getting everything up!



There is some bad news: this is apparently a problem with the Leonardo (and thus the Orbotron, which is based on it) which affects a small fraction of people--which is why I hadn't heard of it until now. Were you able to install the driver?



It's not clear what exactly causes the problem is or what the fix is. It seems related to the fact that the bootloader at first appears as one COM port, then "resets" itself to the new device layout (the Orbotron proper) and changes COM ports, with the result that the computer gets a little confused.



Some trends I see in web posts on this topic (do some search).


[list]
  • [*] It seems to affect USB 3.0 ports more than others

  • [*] One fix seems to be simply trying a different port, which can reinstall the driver.

  • [*] Another fix, which is trickier, is to use the reset circuit. It's tricky for the Orbotron because I left off the reset button (there didn't seem to be a need for it). There could be a workaround if we get brave.
  • [/list]




    So in the short term: First, make sure the drivers are installed (you may have to manually update them), and second try plugging it into a different port. Let me know how those work. The worst thing that happens is I refund you, but I'd rather find a way to get it working.



    V

    A Future Pilot
    Posts: 14
    Joined: February 26 2013, 22:12 PM

    Re: New run of orbshields

    Postby A Future Pilot » August 10 2013, 19:43 PM

    OK I got it working :) Switching ports did it. Thanks!



    So I pulled up Descent and started messing with it...DANG this thing is hard to control!

    vputz
    Posts: 339
    Joined: March 25 2006, 20:21 PM
    Contact:

    Re: New run of orbshields

    Postby vputz » August 12 2013, 16:32 PM

    Excellent that it works!



    And as for hard to control--yes, yes it is! It's definitely not trivial. I will say that it gets a lot better with practice, but it's also worth playing with the game controllers applet and configuration to see why it's difficult and if there are any tweaks that can help.



    For example--is the dead zone too small so that it moves when it should be released? You can increase that. Do some axes seem too sensitive (ie do you need lots of response in pitch and yaw but you want roll to be a lot less sensitive?) You can change that too.



    In the end, no lie, it's tough to control and precision aiming is just plain hard. But with some tweaking, it's still a neat device!

    kenyee
    Posts: 51
    Joined: April 02 2013, 8:33 AM

    Re: New run of orbshields

    Postby kenyee » August 13 2013, 15:53 PM

    [quote="vputz"]
    [code]
    if ( crunch_magellan_nibbles() )
    [/code]


    ...which is basically taken from the linux magellan.c driver in magellan_process_packet:


    [code]
    case 'k': /* Button data */
    103 if (magellan->idx != 4) return;
    104 if (magellan_crunch_nibbles(data, 3)) return;
    [/code]

    [/quote]


    Sorry...back on this after being tied up a bit on another project.

    Why did you rewrite crunch_magellan_nibbles so it doesn't take a buffer ptr + count? Just wanted to make sure this is ok. Looks like you're just stripping nibbles for the bytes you read in automatically from this so it seems ok:
    [code]
    for ( unsigned short i = 1; i < (cursor-1); ++i )
    if (buffer[i] == nibbles[buffer[i] & 0xf])
    [/code]


    I decided to look at the packet data via the serial dump to COM6.

    buttons 1-9 return

    107 65 48 48 13 107 48 48 48 13

    107 66 48 48 13 107 48 48 48 13

    107 68 48 48 13 107 48 48 48 13

    107 72 48 48 13 107 48 48 48 13

    107 48 65 48 13 107 48 48 48 13

    107 48 66 48 13 107 48 48 48 13

    107 48 68 48 13 107 48 48 48 13

    107 48 72 48 13 107 48 48 48 13

    107 48 48 65 13 107 48 48 48 13



    buttons A-C return

    107 48 48 66 13 107 48 48 48 13

    107 48 48 68 13 107 48 48 48 13

    107 48 48 72 13 107 48 48 48 13



    So each byte goes through 65, 66, 68, 72 before going to the next one.

    This translates to 0x41, 0x42, 0x44, 0x48. The crunch nibbles function seems to just strip off the top 4 bits (the 0x40 part) so this becomes 0x1, 0x2, 0x4, 0x8.

    The 107 is a button change so it's a 5 byte packet (the 2nd 107 packet is me releasing the button).



    Given the byte pattern above, I don't get how process_magellan_buttondata would work because of the weird left shifting increments that aren't a multiple of 4 :-P
    [code] physical_buttons = (buffer[1] << 1)
    | (buffer[2] << 5)
    | buffer[3];[/code]


    So I re-did the code to merge the nibbles and it seems to work ok.

    Also added a chording option for button C, but ran into some weird Arduino weirdness w/ unsigned shorts. If you hit the C button to chord w/ buttons 4/5, they get translated to buttons 15&16 so there's obviously some sign/unsigned issue. I tried casting to a 32-bit unsigned long before the left shift but that didn't make a difference and it would have in a real C compiler :p

    Sent you a pull request via github w/ the changes.



    p.s., I managed to re-solder the adapter's popped off microusb port over the weekend. It was as bloody annoying as you mentioned. Shorted internally after I soldered the pins on and ended up shoving a piece of solderwick underneath and sitting a pencil iron tip on it until it sucked off most of the solder. Whoever decided to put the pins underneath the microusb shield should be tied to an ant farm and covered w/ honey :evil:

    While I was handling it, capacitor C11 fell off too...you might want to jiggle test all the chips to make sure the reflow worked well enough...

    rayz007
    Posts: 12
    Joined: March 24 2013, 8:10 AM
    Location: New York City, NY USA

    Re: New run of orbshields

    Postby rayz007 » August 20 2013, 18:58 PM

    Hi all, haven't been around for awhile and thought I'd take a look at what progress has been made. I received one of the first prototypes from vic so thanks again vic! I had a spaceorb 360 and it works

    well. I bought a pair of IBM rebranded 4000 FLX spaceballs off ebay for $10 and they work strangely like the issues others are having with their 5000's. The ball axis response is strange(very low axis number range) in the native windows joystick calibration app. I am going to try the two changes mentioned (use new orbotron_translator.h and include chart_1 and sensitivity changes) in the ino file. I actually tried making my own sensitivity charts because I thought the chart wasn't sensitive enough, was using chart_5 but no good. Will report back on my findings. And Vic, I did the mod on the Wacom 12x12 serial I had using the Teensy board and it works extremely well now attached via usb and reports to windows as a usb intuos 2. The mod was simple (like 4 wires to solder, and removal of a chip off the original wacom board. Cost like $16 for the teensy! Anyways wish you well and be back soon.



    rayz007

    Tehrasha
    Posts: 26
    Joined: May 19 2013, 19:37 PM
    Location: Midwest, USA
    Contact:

    Re: New run of orbshields

    Postby Tehrasha » August 20 2013, 19:32 PM

    [quote="rayz007"] I did the mod on the Wacom 12x12 serial I had using the Teensy board and it works extremely well now attached via usb and reports to windows as a usb intuos 2. The mod was simple (like 4 wires to solder, and removal of a chip off the original wacom board. Cost like $16 for the teensy! Anyways wish you well and be back soon.[/quote]

    Neat! Can you share the details of what you did? I have an old 12x12 Calcomp and a Teensy 2.0 kicking around.

    Might be a little more work at the software end, since the tablet is Apple's ADB serial bus, but I would think I should be able to translate -something- out of it.

    It would be great to make it somewhat functional again. :)
    [color=#BF0000][b][url=http://spacemice.org/]Spacemice[/url] -- Input Devices for a 3D World[/b][/color]

    rayz007
    Posts: 12
    Joined: March 24 2013, 8:10 AM
    Location: New York City, NY USA

    Re: New run of orbshields

    Postby rayz007 » August 20 2013, 20:09 PM

    Well some good news. I changed the new orbotron_translator.h file by copying the gain commands from the 5000 section to the 4000 section and changed the joystick.ino to use chart_1 sensitivities and voila, the 4000 FLX's work flawlessly in Retrovirus. I am using the 4000 on my left and the mouse on right for fine grain aiming. Works awesome. Really better than using a spaceorb 360 on its own. Can't aim worth a damn with the spaceorb 360. Also the calibration in windows shows full range of values now for all the axis.(ie: -512 to +512). Awesome fix. Thanks again Vic. I now need to test the WASD sketch with the 4000.



    As for the Wacom Teensy Mod, check out the second post by Bernard in this link. It covers the whole Mod. Really basic stuff, but the tablet response is perfect. Tilt and Pressure work but the button strip at the top of the tablet is non functional at this time. Check it out here:



    http://forum.bongofish.co.uk/index.php?topic=1930.0



    rayz007

    vputz
    Posts: 339
    Joined: March 25 2006, 20:21 PM
    Contact:

    Re: New run of orbshields

    Postby vputz » August 21 2013, 1:07 AM

    Good stuff, gents! Sorry I'm not participating more; having a bit of a personal-life wallow and playing with some other projects. Finding time to consolidate the recent orb stuff has been slow.



    Rayz: Yep, I like the 4k+mouse combo, but the problem is I start running out of buttons! Even so it works very nicely; glad it's up and running.



    Good lord, there's some duplication going on to work around the serial for the Wacom tablet. If it's a DB9 serial device I should just ebay one and take a weekend; there's no reason you couldn't reflash the Orbotron to do that without having to hack the tablet. I don't have a particular need, but it should be doable without much difficulty...



    The next version of the Orbotron seems to be working and I have a few more in stock now finally. Reducing the thickness of the solder stencil helped a bit with bridges, and the new USB connector still tends to bridge and require annoying fixes--but at least the holes line it up and the additional strain relief will be a good thing. I'll be surprised if there are any more hardware revisions; I think this is about where I want it. Now I just want the software support to be better and increase the number of devices it supports (not limited to orbs).

    rayz007
    Posts: 12
    Joined: March 24 2013, 8:10 AM
    Location: New York City, NY USA

    Re: New run of orbshields

    Postby rayz007 » August 25 2013, 4:43 AM

    Hi Vic. I'm using a Razer Naga mouse. It has 12 programmable buttons on side plus 2 on top. enough buttons for me, plus the 12 on the 4000. I tested the WASD sketch and works fine. Since i'm using with a mouse, I disabled all the mouse axis emulation in the sketch. A bit more stable in the movement. I usually use a Razer Nostromo on my left and will probably stick with that. I actually do some 3d animation and would love to use the 4000 in 3dsmax. Cant use the connexion driver obviously. I have to figure out how to get it to work. Anyways speak to you soon.



    rayz007

    vputz
    Posts: 339
    Joined: March 25 2006, 20:21 PM
    Contact:

    Re: New run of orbshields

    Postby vputz » August 27 2013, 0:39 AM

    Rayz:



    I wrote the Waxbee author and while he doesn't have time to work on Orbotron integration, he did relate that it relies on the Teensy's half-K bootloader (as opposed to the 4k Leonardo bootloader). That probably means it'll work fine if it's hard-flashed (ie remove the "program over USB" mode and use an ISP programmer) but we'll see. I'm going to try and lay hands on a Wacom tablet over here and see if it's doable...

    kenyee
    Posts: 51
    Joined: April 02 2013, 8:33 AM

    Re: New run of orbshields

    Postby kenyee » August 31 2013, 9:23 AM

    [quote="rayz007"]would love to use the 4000 in 3dsmax[/quote]

    I *think* you can do this:

    http://www.3dbuzz.com/forum/threads/154442-Joystick-controlled-camera!

    http://docs.autodesk.com/3DSMAX/15/ENU/3ds-Max-Help/index.html?url=files/GUID-89367E0E-8D43-48A5-ABC1-BD1119B25F77.htm,topicNumber=d30e224179



    I've been trying to figure out what CAD software to learn for 3D printing for custom electronics enclosures (that look more moulded than lasercut pieces screwed together) but everything is multiple $K...3DSMax, solidworks, rhino, etc. :shock:



    BTW, anyone interested in a spare Spaceball 5000 controller w/ orbotron? Nice to have a spare, but I probably don't need it :)

    rayz007
    Posts: 12
    Joined: March 24 2013, 8:10 AM
    Location: New York City, NY USA

    Re: New run of orbshields

    Postby rayz007 » October 20 2013, 13:13 PM

    Thanks kenyee for that info.

    Hey Vic, a quick question. How do i make windows sww the orbotron as a joystick? Right now it is seeing the orbotron as a keyboard. Any ideas?

    Hope your well. It's been pretty quiet around here.



    rayz007


    Return to “Spaceware Software”

    Who is online

    Users browsing this forum: No registered users and 1 guest