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

Tutorial SMC3 Arduino 3DOF Motor Driver and Windows Utilities

Discussion in 'SimTools compatible interfaces' started by RufusDufus, Dec 1, 2013.

  1. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    14,538Coins
    Ratings:
    +975 / 8 / -1
    Hi Eric, sorry can't think why that would be, You don't have a large deadzone set in SMC3 by any chance... although that would also effect SMC3 Utils.

    I haven't used that part of simtools much, but did you know against each axis DOF there is a button that pops up a window and there is a Deadzone setting in there are you sure there is nothing set in here - I think you need to check the default profile?

    Capture2.JPG
    • Like Like x 1
  2. ericRacer

    ericRacer You get old because you stop playing ! Gold Contributor

    Joined:
    Jun 11, 2009
    Messages:
    234
    Occupation:
    Pilot
    Location:
    Canada, Quebec
    Balance:
    9Coins
    Ratings:
    +143 / 2 / -0
    My Motion Simulator:
    3DOF, Arduino, Motion platform
    I checked the settings and the "Deadzone" in SMC3utls is settled to "0".
    It is like my engine is glued with SMC3utls signal, so my problem is surely with Simtools setting is not it?
    • Like Like x 1
    Last edited: Jan 9, 2014
  3. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    14,538Coins
    Ratings:
    +975 / 8 / -1
    Hi Eric, did you solve the problem? Are you saying that motion is smooth and consistent if you drive the motors using SMC3utils but has a step response if driving through sim tools?
    I still cant think of anything specific that would cause this... Could you post a screenshot of your interface settings in sim tools.
    • Like Like x 1
  4. ericRacer

    ericRacer You get old because you stop playing ! Gold Contributor

    Joined:
    Jun 11, 2009
    Messages:
    234
    Occupation:
    Pilot
    Location:
    Canada, Quebec
    Balance:
    9Coins
    Ratings:
    +143 / 2 / -0
    My Motion Simulator:
    3DOF, Arduino, Motion platform
    Hi @RufusDufus
    Exactly :)
    • Like Like x 1
    Last edited: Jan 9, 2014
  5. ericRacer

    ericRacer You get old because you stop playing ! Gold Contributor

    Joined:
    Jun 11, 2009
    Messages:
    234
    Occupation:
    Pilot
    Location:
    Canada, Quebec
    Balance:
    9Coins
    Ratings:
    +143 / 2 / -0
    My Motion Simulator:
    3DOF, Arduino, Motion platform
    @RufusDufus ,
    In the device manager, serial comport driver, i don't have 500kbauds option ! then, i selected 115200bauds and uploaded the Arduino software with 115200bauds "serial.begin(115200)"

    I tried too with an other PC , USB cable, i reinstalled Simtools , i don't understand but every time it is works fine with SMC3utls ! o_O

    setting of SimTool :
    serial : 115200b, 8N1
    10bits range, binary type, 10 msec.
    filters: smoothing, washout, deadzone, boundery = 0%
    axis limiting = 0%

    deadzone in Arduino = 0

    thanks for your help ! :)
    Eric
    • Like Like x 1
  6. ericRacer

    ericRacer You get old because you stop playing ! Gold Contributor

    Joined:
    Jun 11, 2009
    Messages:
    234
    Occupation:
    Pilot
    Location:
    Canada, Quebec
    Balance:
    9Coins
    Ratings:
    +143 / 2 / -0
    My Motion Simulator:
    3DOF, Arduino, Motion platform
    Is that the problem could come from the FTDI driver but does not influence with SMC3utls
    • Like Like x 1
  7. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    14,538Coins
    Ratings:
    +975 / 8 / -1
    Hi Eric, If your using the latest version posted then you need to have Simtools setup with 500K baud also. This is one of the options in the simtools dropdown list. I think that is the problem.

    All your other settings look OK.

    You shouldn't have to worry about the device manager in windows - the application (simtools or SMC3utils) typically sets up the serial port parameters.

    What do you mean by "serial.begin(115200)" - did you change the Arduino code? I wouldn't recommend that as it will just create confusion as the other apps will need to change to match.
    • Like Like x 1
  8. ericRacer

    ericRacer You get old because you stop playing ! Gold Contributor

    Joined:
    Jun 11, 2009
    Messages:
    234
    Occupation:
    Pilot
    Location:
    Canada, Quebec
    Balance:
    9Coins
    Ratings:
    +143 / 2 / -0
    My Motion Simulator:
    3DOF, Arduino, Motion platform

    I started with this option (500kb) first and I thought the problem was the communication speed between Arduino Demilanove and Simtools . It is for this reason that I decreased the speed to 115200 and 9600. I think the problem is between the Arduino with FTDI driver and simtool, I found this yesterday: o_O
    http://forum.arduino.cc/index.php/topic,23000.0.html

    The easiest solution for me is to buy a Arduino Uno, it is not really expensive :cool:

    Thanks :)
    • Like Like x 1
  9. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    14,538Coins
    Ratings:
    +975 / 8 / -1
    Hi Eric, You could give it a try but to me that won't fix the problem, If you say it works nicely directly from SMC3utils then the interface must be OK. We must have missed something else in the setup.

    If you don't mind fiddling you could try monitoring the output of Simtools using SMC3utils (I think you may be the first to try other than me so you would be a guinea pig :)) It is explained in Post #29 of this thread. If you do it on the same computer then the IP address is 127.0.0.1 if you have a second computer it makes everything easier.

    If you get this working you will see if the output from Simtools is smooth and can even monitor if the motors are tracking well.

    If you want to try, give it a go and let me know if you need any more details in the instructions. I will probably be posting a new version this weekend with a few optimisations as well - probably nothing noticable to the user though.
    • Like Like x 1
    • Useful Useful x 1
  10. ericRacer

    ericRacer You get old because you stop playing ! Gold Contributor

    Joined:
    Jun 11, 2009
    Messages:
    234
    Occupation:
    Pilot
    Location:
    Canada, Quebec
    Balance:
    9Coins
    Ratings:
    +143 / 2 / -0
    My Motion Simulator:
    3DOF, Arduino, Motion platform
    Hi Rufusdufus,
    ok, i will give it a try with a second computer for monitoring...

    and i just received my usb-to-ttl converter !
    • Like Like x 1
  11. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    14,538Coins
    Ratings:
    +975 / 8 / -1
    @ericRacer, I have just posted a new version. If you use it make sure you check the MODE you want in the Arduino code. Also need to make sure the SMC3Utils.ini has the correct comm port number (you can use your old ini file if you want)

    I see you have your usb-ttl converter... unfortunately I have temporarily disabled the second comm port in this version as it was conflicting with the code to change the PWM frequency - the Arduino has limited resources so it is a bit of a juggle getting everything to work together, I will look at this further for a later release.

    In the meantime if you get the UDP method working I think you will find it better than the second serial port. UDP is all I use these days. Basically you get the Simtools to talk to SMC3Utils via UDP and then SMC3Utils talks to the Arduino via comm port. Then when every thing is working just take SMC3Utils out and get Simtools to talk direct to the Arduino again.

    Hope I'm not getting you too confused with the updates. ;)
    • Like Like x 1
    • Informative Informative x 1
    • Useful Useful x 1
  12. ericRacer

    ericRacer You get old because you stop playing ! Gold Contributor

    Joined:
    Jun 11, 2009
    Messages:
    234
    Occupation:
    Pilot
    Location:
    Canada, Quebec
    Balance:
    9Coins
    Ratings:
    +143 / 2 / -0
    My Motion Simulator:
    3DOF, Arduino, Motion platform
    Hi RufusDufus,:)

    I tried SMC3utls with UDP method on a second PC and on the same PC ,
    SMC3utls seems to freeze with both methods when I use the "UDP through" function, but the other functions (square, sine ...) Arduino and SMC3utls works very well.
    (it is with the 0.63 version :cool:)

    and here :


    Maybe my problem is my computer, I noticed that SimTools not written correctly ip address, here's a picture
    ip_simtool.jpg
    • Like Like x 1
  13. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    14,538Coins
    Ratings:
    +975 / 8 / -1
    Hi, SMC3Utils is not receiving any data from Simtools (you should see the pks/sec value under the UDP passthru selection change probably to about 80) when the UDP data is getting through. I would guess that either Simtools or SMC3Utils is being blocked by your firewall? Make sure they are let access the network through you firewall even when on same computer. I am pretty sure this will fix the problem.

    Settings in Simtools look correct - I can't comment on the strange IP address.
    • Like Like x 1
  14. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    14,538Coins
    Ratings:
    +975 / 8 / -1
    Actually just noticed in the video what you mean by SMC3Utils seems to hang. This is odd its like the timing routine has halted... and it sounds like the motor moves once when you are in UDP passthrough?

    I notice you have Simtools set to High priority? Perhaps while testing put this back to Normal to make sure it is not stopping SMC3Utils from working.

    What sort of computer and windows is it?
    • Like Like x 1
  15. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    14,538Coins
    Ratings:
    +975 / 8 / -1
    @ericRacer, I have been doing some testing... I have never used the Simtools output testing before, so I gave it a try. I actually noticed the strange step response you were experiencing in the DOF output. So you definitely aren't alone and I am sure it is coming from Simtools. I can't tell you why at this stage. We may have to ask @yobuddy for help here - I wonder if the default Tuning center values have any impact?

    If you switch to the Axis output in Simtools (see image) you should notice the effect goes away and the motors move smoothly - note in this mode one slider maps to one motor, so you will only get one moving at a time. Also note this step effect isn't present in game motion so it only effects the DOF output testing.

    output testing.JPG
    • Like Like x 2
    • Old Old x 1
  16. RaceRay

    RaceRay Administrator Staff Member SimAxe Beta Tester

    Joined:
    Nov 8, 2006
    Messages:
    4,654
    Occupation:
    Self-employed | Web and application development
    Location:
    Hamburg, Germany
    Balance:
    25,031Coins
    Ratings:
    +1,690 / 10 / -0
    My Motion Simulator:
    2DOF, DC motor, SimAxe, SimforceGT
    @ericRacer are you using ipv6 on your computer? The ip looks like such a one. Deactivate ipv6 in your network control panel and than restart. Check if a ipv4 ip address is than recognized in simtools.
    • Like Like x 1
  17. ericRacer

    ericRacer You get old because you stop playing ! Gold Contributor

    Joined:
    Jun 11, 2009
    Messages:
    234
    Occupation:
    Pilot
    Location:
    Canada, Quebec
    Balance:
    9Coins
    Ratings:
    +143 / 2 / -0
    My Motion Simulator:
    3DOF, Arduino, Motion platform
    Hi RufusDufus :)
    To be sure, I uninstalled my anti-virus and disabled my firewall, I also put priority to "Normal". I have a UDP communication 28-30 pks / sec. but it continued to hang. :confused:


    Exactly ! :cool: and as soon as i reselect "Square" or "Motion" or something else, everything come back normal and works fine. :sos

    I think the same thing, if you noticed in my first video(at the beginning), I choose "Axis output" but I still weird step response. o_O

    i didn't noted that in game motion...i am gonna to try it :cheers

    thanks :grin:grin:grin :thumbs
    • Like Like x 1
    Last edited by a moderator: Jan 12, 2014
  18. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    14,538Coins
    Ratings:
    +975 / 8 / -1
    I believe there may be something not right with your computer/windows setup. Something seems to be preventing SMC3Utils from getting sufficient time to receive and process the data. Lowering the priority of Simtools gave a bit more time to SMC3Utils as the packet rate increased somewhat... but it should be up around 80-90 pks/sec.

    What version of windows are you running and what is the specs of the computer?
    Very strange... I have tested on three different computers both together with Simtools and on separate machines and always sits at 80-90 pks/sec with a 10ms delay in simtools.

    Attached is a simple console program that tests for received UDP data on port 20017. You could give it a run on the computer normally used to run SMC3utils and see what it displays.... the delay between packets should be around 10ms if that is what is setup in simtools. See image:

    packettest.JPG

    Attached Files:

    • Like Like x 3
  19. ericRacer

    ericRacer You get old because you stop playing ! Gold Contributor

    Joined:
    Jun 11, 2009
    Messages:
    234
    Occupation:
    Pilot
    Location:
    Canada, Quebec
    Balance:
    9Coins
    Ratings:
    +143 / 2 / -0
    My Motion Simulator:
    3DOF, Arduino, Motion platform
    Hi @RufusDufus ,:)

    Wonderful, this little program.:cheers
    here is my spec. :
    spec.jpg
    UDP communication seems normal like you.:think
    simtool_receive.jpg


    But against, I think the step response problem comes from simtool with manual mode. I made a small video, we see the Data change but the Datas stops change when the slider is around the middle !:sos



    thanks again :D
    Eric

    edit : I have 2 others computer, i am going to try with those this evening....
    • Like Like x 1
    Last edited: Jan 13, 2014
  20. ericRacer

    ericRacer You get old because you stop playing ! Gold Contributor

    Joined:
    Jun 11, 2009
    Messages:
    234
    Occupation:
    Pilot
    Location:
    Canada, Quebec
    Balance:
    9Coins
    Ratings:
    +143 / 2 / -0
    My Motion Simulator:
    3DOF, Arduino, Motion platform
    Hi @RufusDufus ! :grin

    I'm happy, the hang problem is from my laptop, I tried SMC3utls (with UDP) on another PC and it works fine, I get 60-64 pks / sec, not as fast as you but it works very well and fluid. I can see the signal from simtool through UDP, and I can see the same step response in manuel mode o_O

    thanks a lot :thumbs:cheers
    Eric :D
    • Like Like x 2