X sim support?

hi guys i am thinking about getting 2x jrk12v12 motor controlers to power a motion sim.

using software from x-simulator.de/forum/viewtop … lit=#27528 but he only got the motor to go in one direction.

can you confirm if it will be compatable before i buy them.

peter

Hello,

We do not have any plans to support X-simulator, but we welcome any attempts to do so, and we would be happy to assist anyone who is trying to make them work. We provide complete documentation for the virtual COM port interface to our USB products as well as a USB SDK that shows how to do native USB communication with the devices, so it should be straightforward for a programmer to connect any software to the devices.

-Paul

has anyone used this with xsim as i have been trying for two weeks and cant get any movement at all.

my motors work fine with the config file for the 12v12 i downloaded i just cant get the xsim software to turn the motor at all

Hello,

We still do not know of anyone using the jrk with X-simulator, but if you are trying to make it work, we could try to help you. Are you trying to use the jrk’s serial interface on a virtual COM port?

-Paul

gday peter and admin,
peter ya proberly read the xsim post all good we can talk directly to the card via the command port.

Basic commands Ive worked out for xsim

~221~~x~ 221 set low resolution position to the the value of x being 1 to 125.
~255~ to stop the controller.

Still trying to get my head around the command to set high resolution position and the values of x.
Maybe paul could answer this please.

My sim chair owes it movement to two Jrk12v12’s so thanks greatly Pololu ya hardware rules.

Hope this helps for any further seekers of using Jrk’s to power a motion platform.

Hello,

You need to ask a question if you want me to answer! I assume you have looked over the command documentation?

-Paul

sorry paul for posting here on peters question just thought to keep the x-sim stuff in one place.
The question is that I’m sending information to the jrk via command port in 8bit ,binary.

at the moment the uso parser is ~22163 in decimal to set my motor to centre,
i beleive that im sending 221 to set target to low resolution and 63 is the position half of 127.

so what i’ve read is that to send set target in high resolution i would have to change to 12bit ,binary

eg ~170~~(value in decimal 0-x)~

x is were i just cant get my head around.Not a programmer, Fabricator/Draftsman

thank from x-sim users. :blush:

Hello,

You still have not given me any indication that you have read the command reference in the user’s guide, and you have not asked a question. By the way, I do not know where you got the numbers you are using now, but your “low resolution” command is actually an instance of the high resolution command, and 170 is the baud rate detect byte.

-Paul

thanks paul,

Yes read the bl*&dy manual for the last 12 months, i must be thick.

So to set target to low res - 225,(0-127) - sent as a 8bit command.
to set target to high res - 221,(0-127) - sent as a 12bit command, not sure how this worked for me
as xsim can only send 8bit,16bit,32bit commands.
So again paul have we got the values right now seems to move a lot smoother in low res.
Thanks for ya help mate.

hi, wonder to see x-simer here. I used polulu as hbridge to my controller…i use microchip to translate USO command before send it to polulu. :smiley:

Uploaded with ImageShack.us

Hello,

Robbie_73, I thought that you had solved your problem because I did not see any questions, you said it was moving smoother, and you ended by thanking me. But I just realized that “So again paul have we got the values right now seems to move a lot smoother in low res.” was probably intended as a question! Is there some reason that you are not using the question mark in your posts? It would really help me figure out what you are trying to communicate.

Anyway, my impression is that you do not understand the Set Target High Resolution command, so can you read over that section in the User’s Guide and tell me what part of it gets you confused? If you actually understand it, you will be able to tell me, for example, what bytes to send to set the target to 2000.

-Paul

Hi Paul
The command documentation above actually covers Motor Off, Set Target High Resolution, Set Target Low Resolution Forward, Set Target Low Resolution Reverse, Get Error Flags Halting, Get Error Flags Occurred, Variable Reading Commands. Obviously there must be other commands as well, e.g. Set Feedback Mode, Set Proportional Coefficient, etc.
Is there a full command reference available?
Thank you
Thomas

Hello,

Is your command related to X-sim? If not, please post it in a new thread.

Anyway, no, there are no such commands on the jrk’s serial interface. If you want to access those commands, you will have to use the native USB interface as shown in our USB SDK. But you should avoid adjusting these settings over and over again in a loop, since that could quickly wear out the jrk’s EEPROM memory.

-Paul

If it helps, I command the Jrk’s SetTargetHighResolution, -LowResolution and magnitude like this from C++.
Software example is available at https://github.com/poes-weather/Sensor-Benchmark. It is built using Qt and linux.

bool TJRK::setTargetHiRes(int target)
{
    if(!port->isOpen() || target < 0 || target > 4095)
        return false;

    iobuff[0] = 0xaa;
    iobuff[1] = (unsigned char) devid;
    iobuff[2] = (unsigned char) (0x40 + (target & 0x1F));
    iobuff[3] = (unsigned char) ((target >> 5) & 0x7F);

    qDebug("set target hi res: 0x%02x%02x%02x%02x", iobuff[0], iobuff[1], iobuff[2], iobuff[3]);
    if(port->write((const char *) iobuff, 4) != 4)
        return false;
    else
        return true;
}

//---------------------------------------------------------------------------
bool TJRK::setTargetLowRes(int magnitude)
{
    if(!port->isOpen() || magnitude < -127 || magnitude > 127)
        return false;

    iobuff[0] = 0xaa;
    iobuff[1] = (unsigned char) devid;
    iobuff[2] = magnitude < 0 ? 0x60:0x61;
    iobuff[3] = (unsigned char) (magnitude < 0 ? -magnitude:magnitude);

    qDebug("set target low res: 0x%02x%02x%02x%02x", iobuff[0], iobuff[1], iobuff[2], iobuff[3]);
    if(port->write((const char *) iobuff, 4) != 4)
        return false;
    else
        return true;
}

//---------------------------------------------------------------------------
quint16 TJRK::magnitude2target(int magnitude, bool analog)
{
    quint16 rc = 2048;

    if(analog)
        rc = 2048 + 16 * magnitude;
    else
        rc = 2048 + (600 / 127) * magnitude;

    return rc;
}

//---------------------------------------------------------------------------
int TJRK::target2magnitude(quint16 target, bool analog)
{
    int rc = 0;

    if(analog)
        rc = (target - 2048) / 16;
    else
        rc = (target - 2048) * (127 / 600);

    return rc;
}

Hi Paul. My question is x-sim related but if you wish I can happily ask my question again in a new thread.

My question is if the commands listed by me above are all the available commands in serial mode (communication via virtual comport) or if there are others I have missed?

Is there a command reference (“cheatsheet”) available for the native USB interface? I know I can plough through the source code and pick them up individually but there might be a summary table like for other µP.

Thanks ptast for your help. This might be a good snippet of code for me :slight_smile:

Hello,

The command reference should list all of the serial commands. There are no serial commands to change settings, since we expect them to be able to use the Configuration Utility to adjust settings, and we do not want the risk of accidentally changing settings or changing them repeatedly in a loop. There is no better reference for these commands than the source code, but compared to actually implementing USB communication, reading our source code should be pretty easy. I recommend starting out by looking over JrkCmd.cs.

Why do you want to access settings, anyway?

-Paul

Oh, by the way, if you get the USB SDK and look at Jrk/protocol.h, that is basically a summary table of all the serial commands, USB commands, parameters, and values available used by the jrk. We also have a C# version of the same stuff in Jrk/Jrk/Jrk_protocol.h. So those files might be good places to look if you want to know what is available. I would be happy to help explain anything in there if you have questions!

-Paul

I would prefer using libusb and not a serial (COM) connection, using libusb gives you much more freedom. Sample code howto control Jrk:s (native C/C++) are also included in the sensor-benchmark package.

Thanks Paul. That’s a nice reference, good enough for me.