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

Question Simtools+SMC3 startup position and PWM speed

Discussion in 'SimTools compatible interfaces' started by Lin166, Dec 13, 2018.

  1. Lin166

    Lin166 New Member

    Joined:
    Jul 25, 2018
    Messages:
    9
    Balance:
    142Coins
    Ratings:
    +1 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, AC motor, Arduino, Motion platform, 6DOF
    I just started my model of 3DOF simulator, based on Arduino+L298N drive+ DC motor+Potentiometer. Now the model can work with SMC3 code and Simtools v2.o. The wire connection and communication is good. Great thanks to @RufusDufus and @yobuddy .

    But I had two further questions in Axis Testing:

    1. startup position
    In SMC3 code, the initial value for target and feedback is 512, the mid value of the potentiometer. But when I turn on Axis Testing in Simtools, the motor shaft startup goes much lower. Actually, the position feedback from potentiometer is about 335. Why big gap? Does Simtools reset the initial value?

    SMC3 code
    SMC3_Position.png
    Actual Startup in Axis Testing
    335position.jpg

    2. PWM speed
    In SMC3 code, the PWMmax and PWMmin is 200 and 100 separately. And when I test the motor by manual mode in SMC3 Windows Utility, the actual speed is correct. The motor moves fast. But when I run Axis Testing in Simtools, the motor is very slow. The max speed looks like about pwm 100+. Does Simtools reset the PWM value?

    SMC3 code
    SMC3_PWM.png

    SMC3 Windows Utility
    smc3 utility.jpg


    At last, my settings in Simtools is below for reference.

    Interface Setting
    interface setting.jpg

    Axis Assignment
    axis assignment.jpg

    Axis Testing
    axis testing.jpg
  2. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    20,538
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    145,046Coins
    Ratings:
    +10,776 / 52 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    Just so you are aware, in your Axis Assignments the actual full movement range is 100 total, and you are trying to allocate 300 total, something it can't physically do.
    • Agree Agree x 1
  3. yobuddy

    yobuddy Well-Known Member Staff Member Moderator SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Feb 9, 2007
    Messages:
    5,161
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    48,164Coins
    Ratings:
    +5,036 / 16 / -0
    What keeps the models top platform from twisting clockwise and collapsing?
    I think you need some sort of anti-twist setup for the model.
    Like even a cardboard hinge maybe.
    (drawing terrible but I could not find a pic of a real sim with a hinge setup)
    335position.jpg
    • Agree Agree x 2
    • Like Like x 1
  4. Lin166

    Lin166 New Member

    Joined:
    Jul 25, 2018
    Messages:
    9
    Balance:
    142Coins
    Ratings:
    +1 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, AC motor, Arduino, Motion platform, 6DOF
    Hi @yobuddy , thanks for suggestion. Actually, I am also thinking about how to keep the model from twisting ~40 degree clockwise. I will try the hinge setup. Any thoughts about the questions above about the startup position and speed in SimTools Axis Testing?
  5. yobuddy

    yobuddy Well-Known Member Staff Member Moderator SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Feb 9, 2007
    Messages:
    5,161
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    48,164Coins
    Ratings:
    +5,036 / 16 / -0
    Nope, SimTools has no way to change these setting in the Arduino.

    I can't speak for the SMC3 settings, as I have not used it for a bit, but SimTools works like this:
    The startup position SimTools sends depends on your output bit settings.
    If you select 8 bit output, with 256 position possible (0 to 255), you can get the center location buy 256 / 2 - 1 = 127
    So for 10 bit 1024 position possible (0 to 1023) you would go 1024 / 2 - 1 = 511.
    SimTools will send a 511 for the center location for 10bit.

    Hope that helps,
    yobuddy
    • Informative Informative x 1
  6. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,574Coins
    Ratings:
    +1,831 / 32 / -1
    Simtools has nothing to do with pot values.

    Simtool doesn't control the PWM value either. When you make changes with smc3 utilities they are saved to the arduinos eeprom including the PWM settings. So the default values at the top of the sketch are overwritten when the eeprom is read if you made changes. Btw, why PWMmin set to 100? That means when your motors start they run at 39% full power for minimum speed. If you need much you've got bigger problems.
    • Informative Informative x 1
  7. Lin166

    Lin166 New Member

    Joined:
    Jul 25, 2018
    Messages:
    9
    Balance:
    142Coins
    Ratings:
    +1 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, AC motor, Arduino, Motion platform, 6DOF
    Hi noorbeast, thanks for reminding. Do you mean allocate 300 total such as pitch heave? Based on my understanding, the percentage of the force of the axis should depend on the value range of the potentiometer. Yes, the model physically can't do something. For example, when the motor turns to the lowest position (zero degree), the potentiometer reading isn't the minimum value. But if I adjust the percentage as 70% or 80%, both the highest position and the lowest, which the motor is able to get , will change. The motor avoids the physically impossible part, meanwhile it cannot reach the top (180 degree). It's a little dilemma for me.
  8. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    20,538
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    145,046Coins
    Ratings:
    +10,776 / 52 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    I mean SimTools presumes an axis total movement is 100%, hence if you allocate more than one axis force it gets a partial allocation of the 100% that is available. So if you have pitch, roll and heave allocated to one axis, and you hit a huge embankment that triggers all 3 simultaneously, then the allocation for each should not really exceed 100% or clipping can result. In practice you can get away with a little over the 100% total, but not the 300% you have allocated.

    See here for tips on creating and refining a motion profile: https://www.xsimulator.net/community/faq/steps-to-create-a-motion-profile.228/
  9. Lin166

    Lin166 New Member

    Joined:
    Jul 25, 2018
    Messages:
    9
    Balance:
    142Coins
    Ratings:
    +1 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, AC motor, Arduino, Motion platform, 6DOF
    Thanks for description, Yobuddy. My understanding is 100% same as yours. The startup position depends on output bit setting. I select 10 bit output, so the position range is 2^10=1024 (0-1023). The center should be 511. But it's weird when I turn on Axis Testing, all motors go lower position with potentiometer reading ~350... Even I set Startup-Output <512> in interface, the result is same...

    小Q截图-20181219132702.jpg
  10. yobuddy

    yobuddy Well-Known Member Staff Member Moderator SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Feb 9, 2007
    Messages:
    5,161
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    48,164Coins
    Ratings:
    +5,036 / 16 / -0
    I think you should set these to 511.
    SMC3 code
    [​IMG]
    Please open your axis assignments and load the preset for XD Motion. (remember to click Save)
    It should work pretty well for that platform.
    Are you by any chance using any axis limiting?

    Chat soon,
    yobuddy
  11. Lin166

    Lin166 New Member

    Joined:
    Jul 25, 2018
    Messages:
    9
    Balance:
    142Coins
    Ratings:
    +1 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, AC motor, Arduino, Motion platform, 6DOF
    Got it, thanks, BlazinH. Yes, I have to set PWMmin 100. In the model, the friction force from the pot is too big for the gear motor (6V 30RPM). If the PWMmin is smaller, sometimes the motor is stalled in motion.
    • Informative Informative x 1
  12. yobuddy

    yobuddy Well-Known Member Staff Member Moderator SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Feb 9, 2007
    Messages:
    5,161
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    48,164Coins
    Ratings:
    +5,036 / 16 / -0
    Also for a simple test, in Output Testing (in GameEngine), select "(a) Axis Output" in the Output Type drop-down box.
    (This skips all the dof testing and allows for direct output to each axis)
    take care,
    yobuddy
  13. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,574Coins
    Ratings:
    +1,831 / 32 / -1
    Just as I suspected but good thing its just a model. :thumbs If that happens on your full size build however it will be severely under-powered, at least for most racing.
  14. Lin166

    Lin166 New Member

    Joined:
    Jul 25, 2018
    Messages:
    9
    Balance:
    142Coins
    Ratings:
    +1 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, AC motor, Arduino, Motion platform, 6DOF
    Got it, thanks. I will try it. Currently I am not using the axis limiting.
  15. Lin166

    Lin166 New Member

    Joined:
    Jul 25, 2018
    Messages:
    9
    Balance:
    142Coins
    Ratings:
    +1 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, AC motor, Arduino, Motion platform, 6DOF
    Absolutely, I will pay attention on the full size simulator. It's my next step.;)
  16. Lin166

    Lin166 New Member

    Joined:
    Jul 25, 2018
    Messages:
    9
    Balance:
    142Coins
    Ratings:
    +1 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, AC motor, Arduino, Motion platform, 6DOF
    I'm afraid the Output Type drop-down box (Output Testing->Axis Testing) is in locked. There is only "DOF Output" in the box. I cannot see the selection you mentioned. :( My SimTools version is 2.3.1 demo.
  17. yobuddy

    yobuddy Well-Known Member Staff Member Moderator SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Feb 9, 2007
    Messages:
    5,161
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    48,164Coins
    Ratings:
    +5,036 / 16 / -0
    You have to turn it on first buddy, then you can select it.
  18. MrDemon

    MrDemon New Member

    Joined:
    Mar 20, 2020
    Messages:
    12
    Balance:
    - 80Coins
    Ratings:
    +5 / 0 / -0
    My Motion Simulator:
    2DOF
    Hello. How did you solved this problem? I have the same trouble (((
    The SMC and SIMTOOLS "centers" are different.
    When I take the slider in simtools to minus, it works from zero of simtools . When I take the slider to plus, it seems to work from zero SMCUtil. The difference between zero of simtools and zero of SMCUtil is this jerk. :sos

    As I see it - the problem is just in different centers between the simtools and SMC .
    SOLVED You have to change Win Regional Settings to English )))))
    Last edited: Jul 6, 2020
  19. marco cristopulos

    marco cristopulos New Member

    Joined:
    Apr 30, 2021
    Messages:
    23
    Balance:
    139Coins
    Ratings:
    +3 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Arduino
    What is the layout config to join h bridge l298n to anduino, pls help me
  20. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    20,538
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    145,046Coins
    Ratings:
    +10,776 / 52 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    An l298n is only rated 2Amp, what do you plan using it with?