1. This Software is no longer supported by us. Please download the new motion control software SimTools.
    Dismiss Notice
  2. Do not share user accounts! Any account that is shared by another person will be blocked and closed. This means: we will close not only the account that is shared, but also the main account of the user who uses another person's account. We have the ability to detect account sharing, so please do not try to cheat the system. This action will take place on 04/18/2023. Read all forum rules.
    Dismiss Notice
  3. For downloading SimTools plugins you need a Download Package. Get it with virtual coins that you receive for forum activity or Buy Download Package - We have a zero Spam tolerance so read our forum rules first.

    Buy Now a Download Plan!
  4. Do not try to cheat our system and do not post an unnecessary amount of useless posts only to earn credits here. We have a zero spam tolerance policy and this will cause a ban of your user account. Otherwise we wish you a pleasant stay here! Read the forum rules
  5. We have a few rules which you need to read and accept before posting anything here! Following these rules will keep the forum clean and your stay pleasant. Do not follow these rules can lead to permanent exclusion from this website: Read the forum rules.
    Are you a company? Read our company rules

Debug values for USO

Discussion in 'Force-Profiler Simulator Control' started by Cubane, Apr 3, 2008.

  1. Cubane

    Cubane New Member

    Joined:
    Apr 2, 2008
    Messages:
    8
    Occupation:
    Programmer
    Location:
    Australia
    Balance:
    327Coins
    Ratings:
    +0 / 0 / -0
    Hello,

    I am new here and I am experimenting with the x-sim software and interfacing it to a micro controller to find out how easy and possible it is to make a motion controller system. I currently have a race base cockpit but after seeing tronicgr's motion videos I have been inspired to investigate building my own. I am using an Arduino board for my micro controller and currently have some LEDs lighting up based on the X value being received from the x-sim software using the USO interface. The first time I got that working I was very happy. My suggestion for improvement is that it would be nice to have 2 debug windows that display the stream of data being send of the USO and any data that the micro controller sends back. It would certainly make things a lot easier to debug if things are working or not. Once I get a rc servo based model motion platform working I will have to decide if I should got ahead and build the full sized thing. It certainly wouldn't be possible without the x-sim software.

    Regards,
    Alistair
  2. egoexpress

    egoexpress Active Member

    Joined:
    Dec 13, 2006
    Messages:
    3,839
    Location:
    Germany - Frankfurt/M
    Balance:
    421Coins
    Ratings:
    +10 / 1 / -0
    Hi Alistair,

    Welcome!

    If you asked me, i'd propose you to build a frame with motors controlled by Tronicgr' AMC 1.5 interface, as it works well. If your frame will be set up and running, you could work out an additional one still, in case you will be thinking that you could design a better controller.

    Have a look at the SimforceGT. You could alter your racebase with some jacks and Tronicgr' controller.

    Regards
    Christian
  3. Cubane

    Cubane New Member

    Joined:
    Apr 2, 2008
    Messages:
    8
    Occupation:
    Programmer
    Location:
    Australia
    Balance:
    327Coins
    Ratings:
    +0 / 0 / -0
    To see how easy it was to get things working it was easier to use a micro controller that I already had available with some servos I have to create a mini motion platform. I was only 40 lines of code to get the Arduino to initialise the servo and serial connection and read the data from the USO and set a servo to the right position. It might end up being easier to use my code and a motor driver board to do an initial motion controller platform and then add in Tronicgr's once he has all the bugs out of it. I would like to be able to set parameters to the code in the init USO data like speed of change in the pitch and roll and maximum rotation for +ve and -ve for each of those too. That way the controller can be easier altered without having to burn a new program to the micro controller. I am not sure if Tronicgr supports something like that and it would be very easy for him to add. Now that I have mini prototype going I have to make the difficult decision as to spend lots of $$ to build my own frame or let the dream go for a bit longer.
  4. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    Hi Cubane

    I'm working on it right now. Just must think the easiest way for a typical user interface for this purpose. What I'm going to implement first is a user selectable proportional acceleration constant that can be different for each axis. Then this selection can be saved in AVR's flash memory to be used directly next time its powered up!

    The maximum rotation can be limited from the software or by mechanically limiting the course of the feedback potentiometers to your needs...

    Thanks to the feedback from various people around the world, that attempted to also build my interface, I now have cleared all the problems (and difficulties of the construction) and I'm trying to compile a guide that can be used from anyone (even from a heart doctor... ;-) )

    I've seen the Arduino before. It's also an AVR device, but with bootloader to program it without the need of external circuit... Atmega168 I think?

    Regards, Thanos
  5. Cubane

    Cubane New Member

    Joined:
    Apr 2, 2008
    Messages:
    8
    Occupation:
    Programmer
    Location:
    Australia
    Balance:
    327Coins
    Ratings:
    +0 / 0 / -0
    Yes that is right and it also only takes a USB cable to connect to it which is useful as not all computers these days have a serial port output. I like the idea of saving the user data in the EEPROM then you can have an application on the PC which just sets the variables. It would be very easy to knock something like that up in C# in a short amount of time.
  6. sterex

    sterex New Member

    Joined:
    Dec 26, 2009
    Messages:
    34
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    Hello Cubane,

    I too have been playing with the Arduino since its the only interface I have as of yet. I have to wait for sometimes untill I can get my hands on the stuff I need to build the AMC and H-bridge...Man when I saw those videos I can only imagine how wonderful it will be. AMC and the drive is so smooth and powerful.
    Anyway, since I have to wait for a while (which I can't) I have been experimenting with the Arduino in many ways. I haven't been that succesfull in reading the speed values from USO so far. Can you please show me the code for that. I only managed to read ascii characters 'x' and 'y'. But I wanted to get the speed values like for the RC servo you know.. from 0 to 255; Any help here would be greatly appreciated.
    Thanks.
  7. Poppius

    Poppius New Member

    Joined:
    Nov 10, 2010
    Messages:
    14
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    Hi all!
    Could someone using Arduino share his serial parser code for testing purposes?
  8. johnr

    johnr New Member

    Joined:
    Nov 7, 2009
    Messages:
    26
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
  9. juniou

    juniou New Member

    Joined:
    Jan 8, 2011
    Messages:
    12
    Location:
    Brazil
    Balance:
    271Coins
    Ratings:
    +0 / 0 / -0
    @Poppius, i can read data from USO with this code below... thanks --> (c) 2008 C. A. Church - www.dronecolony.com

    void loop() {
    // aguardando dados via comunicacao serial
    //check_input();
    //Recebe dados via serial COM
    while(Serial.available() > 0)
    {
    kind_of_data = Serial.read(); //string from USO --> L~a01~ A~a02~ 8bit resolution\decimal output
    if (kind_of_data == 'L' ) Read_Lateral();
    ok = 0;
    if (kind_of_data == 'A' ) Read_Aceleracao();
    ok2 = 0;

    }
    }

    void Read_Lateral(){
    delay(1);
    int Lateral100 = Serial.read()- '0';
    delay(1);
    int Lateral10 = Serial.read()- '0';
    delay(1);
    int Lateral1 = Serial.read()- '0';

    //Verifica se e centena dezena ou decimal... =]
    if (Lateral1 < 0) { lateral = Lateral10 + 10*Lateral100; }
    if (Lateral1 < 0 && Lateral10 < 0) { lateral = Lateral100; }
    if (Lateral100 < 0) { lateral = 127; }
    if (Lateral1 >=0 && Lateral10 >= 0 && Lateral100 >= 0) { lateral = 100*Lateral100+10*Lateral10+Lateral1; }

    // Verifica se o valor anterior é o mesmo ou mudou..
    if (MAX != map(lateral,0,255,10,710)) { MAX = map(lateral,0,255,10,710); }
    if (MIN != map(lateral,0,255,10,710)) { MIN = map(lateral,0,255,10,710); }

    cur_reading = analogRead(0);

    //Seta os limetes para que o motor pare de funcionar..
    if (cur_reading > MAX && map(lateral,0,255,10,710) != MAX_ant) {go_left();} else
    if (cur_reading < MAX && map(lateral,0,255,10,710) != MAX_ant) {go_right();}

    //Atualiza leitura anterior com a atual...
    MAX_ant = MAX;
    MIN_ant = MIN;

    // Serial.println(cur_reading);
    }

    i think this code will help you, to give you some idea..
    sorry for my english gramatical errors..
  10. Deleted member 4666

    Deleted member 4666

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    I installed a Serial-Interface-Sniffer to montior what gets send via USO.
    Too bad one can't read Serial writes from the controller back to the Profiler cause the Profile doesn't read any, which would be needed.

    Sniffer used: http://www.heise.de/software/download/f ... itor/26030