1. 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
  2. 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!
  3. 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
  4. 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

6 dof master developing corner

Discussion in 'Miscellaneous' started by Robin, Jun 10, 2009.

  1. Robin

    Robin New Member

    Joined:
    May 8, 2009
    Messages:
    44
    Balance:
    51Coins
    Ratings:
    +0 / 0 / -0
    Hi all, here is the post where I'll give some explanations on the 6 dof master source code. See here about this software:
    http://www.x-simulator.de/forum/new-6dof-stewart-platform-for-a-school-project-t1622-10.html

    You can edit the file 6dofDlg.cpp to change:
    Go to void C6dofDlg::InitConst() to change platform's design:
    PB[3][6] is the center of rotation of the servo (coordinates in millimeter)
    L1 is the lenght of the servo arm (millimeter)
    L2[6] are the length of the rods. (millimeter)
    beta[] is the orientation of the servo around z axis (radians)
    Servo[] are the angular position of the servos (radians)
    PFO[3][6] are the platform points at position zero. (coordinates in millimeter)

    Go to void C6dofDlg::SetupCommPort()
    here begins the section of the code which handle the communication with the serial port. The code is commented itself so I won't duplicate it here.

    Miscellaneous tips:
    In the 3D simulation the servo number 0 is red, servo number 1 is purple.


    Please pm me if you want to adapt the code to fit your design your servo controler etc.. I'll then send the source code to you. Any questions in this topic are welcome, there's no stupid question.

    Regards,
    Robin

    BTW: I like the name 6dof master for the software. What do you think?
  2. mboRacing

    mboRacing Member Gold Contributor

    Joined:
    Sep 16, 2007
    Messages:
    231
    Occupation:
    Automatiker
    Location:
    Switzerland -Eiken
    Balance:
    - 151Coins
    Ratings:
    +0 / 1 / -0
    Hello Robin

    Thanx for your Post. Im a noob in programming on PC Programms. So the question is: to change this settings you wrote i have to do this with a compiler or can i edit this things just with the editor? (i dont have a Compiler :( )

    EDIT: And how to change to send Axis informations without control if SD84 is conected or not (is there a real communication betwen SD84 -> PC)

    Greets Martin
  3. Robin

    Robin New Member

    Joined:
    May 8, 2009
    Messages:
    44
    Balance:
    51Coins
    Ratings:
    +0 / 0 / -0
    Yes you'll need a compiler. I use Visual Studio C++ 2008, the express edition do not work unfortunately.

    If you wanna skip initializing your hardware and skip checking whether it is still connected or not via the com port simply change the method OnBnClickedRunHardwareButton() by:

    void C6dofDlg::OnBnClickedRunHardwareButton()
    {
    if (!HardwareRunning){
    ResetPosition(); //Initialize the 3D model to default position.
    SetDlgItemText(IDC_RUN_HARDWARE_BUTTON,Stop Hardware);
    }else{
    SetDlgItemText(IDC_RUN_HARDWARE_BUTTON,Run Hardware);
    }
    HardwareRunning = !HardwareRunning;
    }

    Then you have to give the good setup (which com port for example) to output what you want via the com port, that I'm not an expert about.
    Once done change the RunHardware() method to output datas while in simulation. You may wanna check ScaleServoForOutput() method too for correct Servo calibration.

    See ya,

    Robin
  4. mboRacing

    mboRacing Member Gold Contributor

    Joined:
    Sep 16, 2007
    Messages:
    231
    Occupation:
    Automatiker
    Location:
    Switzerland -Eiken
    Balance:
    - 151Coins
    Ratings:
    +0 / 1 / -0
    Hello Robin

    So i can open up the Project with the Express version. Then i have NOTHING changed and i do the debug (F5). And this give me an error:

    ...6dofsource\6dof\stdafx.h(15) : fatal error C1083: Datei (Include) kann nicht geöffnet werden: afxwin.h: No such file or directory

    Or ist this the wrong way to get the .exe file?

    Greets, Martin
  5. wannabeaflyer

    wannabeaflyer Active Member

    Joined:
    Jul 31, 2008
    Messages:
    248
    Location:
    UK - London area
    Balance:
    971Coins
    Ratings:
    +34 / 0 / -0
    Hi Robin Now i know why i prefer hardware and electronics to software LOL:) just spent the last few hours looking at the source code ... and boy when i say looking i mean looking, in visual basic i stood a chance of understanding what was going on and how the software was ment to function, Visual CPP scares the hell out of me. am making some progress towards understanding how the Various parts of the software function and i suppose because a lot of the code is event driven once i understand the function of the different code blocks things should hopefully fall into place, Am now trying to look at the elements that could be modified to drive My POLOU servo controller ...I am using notepad at the moment to look at the code for the CPP listings. i can honestly say that we should never underestimate the work that software guys do and always be gratefull when a member releases his code for people to learn from, there is a Bucketfull of work thats gone into what you have done and its great to finally see just how hard it must have been to get this far er? :rofl: your name is not Einstien by any chance is it LOL:)
  6. Robin

    Robin New Member

    Joined:
    May 8, 2009
    Messages:
    44
    Balance:
    51Coins
    Ratings:
    +0 / 0 / -0
    @mboRacing
    go to Project->Properties-> Develop Linker -> Input -> Additionnal Dependencies -> add opengl32.lib glu32.lib odbc32.lib odbccp32.lib

    this should do I hope.

    @wannabeaflyer

    I just got lucky when Arnaud and I found the reverse kinetics equation. Everything fell up from there. My advice: first try to change beta[6] angles to fit your platform design. See if you can compile and run the software after that.
  7. mboRacing

    mboRacing Member Gold Contributor

    Joined:
    Sep 16, 2007
    Messages:
    231
    Occupation:
    Automatiker
    Location:
    Switzerland -Eiken
    Balance:
    - 151Coins
    Ratings:
    +0 / 1 / -0
    Nope- they're already there :(

    EDIT: So i searched for a solution, it seems that this problem is not only to me. So the Express versions dont have a MCF (wathever this is). I download now the VS2008 Professional edition and get a countdown of 90 days to do this things :happy: - if this works...

    EDIT II: With the VS2008 Pro Demo Edition it work fine... (for 90 Days :) )

    EDIT III: First step communication to SPS works fine.

    I have changed:

    The Com Settings:

    // Here is to set the com port
    void C6dofDlg::SetupCommPort( LPCTSTR comport)
    ...
    dcb.BaudRate = CBR_38400;
    ...
    dcb.ByteSize = 8;
    dcb.Parity = NOPARITY;
    dcb.StopBits = ONESTOPBIT;
    ...
    GetCommTimeouts(hCom, &ct);
    ct.ReadIntervalTimeout = 50;
    ct.ReadTotalTimeoutMultiplier =50;
    ct.ReadTotalTimeoutConstant = 0;
    SetCommTimeouts(hCom, &ct);
    ...
    (one more time thx to SirNoname for helping me with com setting!!)

    And i send this:

    //Here's where we output the servo poition to the serial port.
    void C6dofDlg::RunHardware(){
    ...
    sbuf[0] = 0xFF; // send SET_SERVO command
    sbuf[1] = ServoChannel; // idx
    sbuf[3] = pos1&255; // pos low byte
    sbuf[2] = (pos1>>8)&255; // pos high byte
    WriteFile(hCom, &sbuf, 4, &n, NULL);
    ...


    greets, mbo
  8. mboRacing

    mboRacing Member Gold Contributor

    Joined:
    Sep 16, 2007
    Messages:
    231
    Occupation:
    Automatiker
    Location:
    Switzerland -Eiken
    Balance:
    - 151Coins
    Ratings:
    +0 / 1 / -0
    Hello again

    Here we got a Version to Control the Pololu Interface in MiniSCC Mode.

    !!!!!!! But be carefull !! If you reach the message out of range the servo's do a scarry movement !!!!!!!!!

    So the question to robin; what does the servos, controled by sd84 when you got the out of reach message?

    Greets, mbo

    6dof.exe.txt
  9. Robin

    Robin New Member

    Joined:
    May 8, 2009
    Messages:
    44
    Balance:
    51Coins
    Ratings:
    +0 / 0 / -0
    Hi mboRacing glad you made so much progress and so fast! :clap:
    When the program shows the out of reach message, the servo shouldn't move at all and the values of Servo[] angles don't change. How did you construct your pos1 variable?
    Have you got a chance to calibrate your servos yet? The values you send to the servo must be in a specific range, typically 800- 2200 us.
    Maybe if you sent me your source code in pm I can have a look.

    I think I know from where that could come from too: try to lower the Max deplacement limiter to prevent the servos to do huge movements.
  10. mboRacing

    mboRacing Member Gold Contributor

    Joined:
    Sep 16, 2007
    Messages:
    231
    Occupation:
    Automatiker
    Location:
    Switzerland -Eiken
    Balance:
    - 151Coins
    Ratings:
    +0 / 1 / -0
    Hello Robin

    Thx - but it's how have done the Work! I'm just learn by doing C++ Programming :lol:

    For Servo Controler Pololu:
    I didnt change the construct. Only the Com Port and Servo Calibration (MiniSCC got only 0-254 for Position) and so i send only the lower byte.


    For SPS Mode i have another question: If i wonna do a 6DoF without gear, but something simular to this:
    how to do the construct?
    I have realy no idea aboud that :blush:

    BtW: of course for Pololu Controler and SPS Control i use different Project's - so don't mix togheter :D

    Greets, mbo

    PM is on the way
    • Disagree Disagree x 1
  11. wannabeaflyer

    wannabeaflyer Active Member

    Joined:
    Jul 31, 2008
    Messages:
    248
    Location:
    UK - London area
    Balance:
    971Coins
    Ratings:
    +34 / 0 / -0
    Hi Robin Sorry to be a pain but when i open the Polou Version of the 6dof.exe.txt file i only get rubbish on the screen Whne i use Notepad or word ?? is this a text file or a exe ? :blush: :cheers:
  12. RaceRay

    RaceRay Administrator Staff Member SimAxe Beta Tester

    Joined:
    Nov 8, 2006
    Messages:
    4,656
    Occupation:
    Self-employed | Web and application development
    Location:
    Hamburg, Germany
    Balance:
    23,862Coins
    Ratings:
    +1,999 / 13 / -0
    My Motion Simulator:
    2DOF, DC motor, SimAxe, SimforceGT
    Hi guys,

    Just rename 6dof.exe.txt to 6dof.exe and easily execute it.
    Files with the ending *.exe are not allowed on the server, so mboRacing used a trick and just renamed the file ;D

    regards
    René
  13. Robin

    Robin New Member

    Joined:
    May 8, 2009
    Messages:
    44
    Balance:
    51Coins
    Ratings:
    +0 / 0 / -0
    Would you believe me if I told you that's the best way to learn?

    @wannabeaflyer

    You're not a pain at all. Have you had a chance to try out the polulu 6 dof software with your servos?
  14. wannabeaflyer

    wannabeaflyer Active Member

    Joined:
    Jul 31, 2008
    Messages:
    248
    Location:
    UK - London area
    Balance:
    971Coins
    Ratings:
    +34 / 0 / -0
    :hi: Robin tried to load the Polou version which i uploaded yesterday but got error message will try again on my PC at work (at lunch time ) if no luck will post a picture of the error message later :cheers: cant wait to have a play
  15. Robin

    Robin New Member

    Joined:
    May 8, 2009
    Messages:
    44
    Balance:
    51Coins
    Ratings:
    +0 / 0 / -0
    I think Martin have released the polulu 6 dof master in debug mode.
    Martin you have to compile in release mode and go to the Release folder of your project. There will be an executable file which in runable on every WinXp computer.
    To compile in release mode just select release in the drop down menu at the top of visual studio.
    Since I got your source I did it and attached the .exe for wanabeaflyer ;)

    Attached Files:

  16. mboRacing

    mboRacing Member Gold Contributor

    Joined:
    Sep 16, 2007
    Messages:
    231
    Occupation:
    Automatiker
    Location:
    Switzerland -Eiken
    Balance:
    - 151Coins
    Ratings:
    +0 / 1 / -0
    Yea Robin you're right :blush: as i sayd: i'm learning :D THX
  17. wannabeaflyer

    wannabeaflyer Active Member

    Joined:
    Jul 31, 2008
    Messages:
    248
    Location:
    UK - London area
    Balance:
    971Coins
    Ratings:
    +34 / 0 / -0
    No Bull Crap guys Big thank you for all your input and help . Thanks to your assistance and hard work i should now be able to play with my frankenstien platform LOL:) fingers crossed .. :cheers:
  18. Robin

    Robin New Member

    Joined:
    May 8, 2009
    Messages:
    44
    Balance:
    51Coins
    Ratings:
    +0 / 0 / -0
    Hi everyone, answering Martin's querry about building a full size 6 dof platform. Here how I would procced:

    First step: Establish your specifications
    * size of the platform, max load....
    * very important: establish a budget.
    * which games? which use?

    Second step: find the good actuators to fit your specifications.
    * you have to consider: noise level, price, torque, linear or angular?, electric pneumatic etc etc....

    Third step: Design and Conception
    * conceive the platform, may need simulation.
    * establish parts list.

    Fourth step: Realisation
    * purchase parts.
    * construct.

    Fivth step: Validating and testing
    * test and validate what's working, report what's not.

    Sixth: Debugging
    * correct what's not working eventually by going back to step 3.

    At the end you got your platform.
  19. mboRacing

    mboRacing Member Gold Contributor

    Joined:
    Sep 16, 2007
    Messages:
    231
    Occupation:
    Automatiker
    Location:
    Switzerland -Eiken
    Balance:
    - 151Coins
    Ratings:
    +0 / 1 / -0
    Hello Robin

    Could you complete / correct the image of the platform design image? And are you thinking about a possibility to a program feature to change the platform settings / com settings into 6DoF Master Software without getting a compiler, so its possible to change the design for everyone use's your software...

    Greetings mbo

    Attached Files:

  20. Robin

    Robin New Member

    Joined:
    May 8, 2009
    Messages:
    44
    Balance:
    51Coins
    Ratings:
    +0 / 0 / -0
    Very correct graphic. I've drafted a little more information on it, if it can help. I'm working on the software to enable to edit its own platform and base points, but it's useless if you can not save your settings, so I got to enable that too.

    Attached Files: