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

Wiring check before starting up ? Any ideas about the code?

Discussion in 'New users start here - FAQ' started by dr.Evil, Sep 13, 2020.

  1. dr.Evil

    dr.Evil New Member

    Joined:
    Aug 26, 2020
    Messages:
    15
    Balance:
    66Coins
    Ratings:
    +1 / 0 / -0
    My Motion Simulator:
    2DOF
    Hi,
    I need some help with more experience to check my connections/setup to 2DOF rig.

    basically a 2DOF with one motor( and pot on it)-driver-PSU for each axis.
    Motors, PSU and Driver are already connected properly, I want to see if I wired the arduino to the driver and POT ok.
    setup

    34HS59-5004S MOTOR====>DM860T driver ===== S-350-60 PSU

    I want to try ONE motor via SMC3 or anything else is going to be suggested.
    As far as I understood connection via SMC3 needs a motor shield that accepts PWM signals.

    I was thinking of using myStepper = AccelStepper(AccelStepper::DRIVER, STEP_PIN, DIRECTION_PIN);

    PUL- and DIR- to pwr9 and 10
    PUL+ and DIR+ to 5V

    Is this feasible?



    Additional info

    This is a XY 2DOF rig. Everything is wired correctly and was functional for analog inputs. Above are the components listed.
    I would like to make it accept SimTools datafeed. I've been searching for days, almost all post are using shields. Does anyone know a way to get this working with the current config or should I buy shields?




    The driver has 6 pins DIR-/+, PUL-/+ , ENA -/+/.
    Pin Function Details

    DIR-DIRsignal: In single- pulse mode,this signal has low/high voltage levels,representing two directions of motor rotation; in CW/CCW mode (set by inside jumper J3),this signal is counter-clock(CCW)pulse.For reliable motion response,DIR signal should be ahead of PUL signal by 5μs at least. 4-5V when DIR-HIGH,0-0.5V when DIR-LOW. Please note that rotation direction is also related to motor-drive wiring match. Exchanging the connection of two wires for a coil to the drive will reverse motion direction.

    PUL- PUL+ Pulse signal: In single pulse(pulse/direction)mode,this input represents pulse signal, each rising edge active;4-5VwhenPUL-HIGH,0-0.5VwhenPUL-LOW. In CCWmode(setbyinsidejumperJ3),this input represents clockwise(CW)pulse.For reliable response,pulse width should be longer than 2.5μs.

    ENA- ENA+ Enable signal: This signal is used for enabling/disabling the drive.High level ( NPN control signal, PNP and differential control signals are on the contrary, namely low level for enabling.) for enabling the drive and low level for disabling the drive. Usually left UNCONNECTED(ENABLED).


    How should I connect it to the Arduino?

    In the SMC3 thread the diagrams are for motor shields only.
    Last edited: Sep 13, 2020
  2. yellofella

    yellofella Member

    Joined:
    Aug 8, 2011
    Messages:
    94
    Occupation:
    builder
    Location:
    UK
    Balance:
    743Coins
    Ratings:
    +84 / 0 / -0
    My Motion Simulator:
    3DOF, SimforceGT
    Hi buddy. The SMC3 software is for dc motors only and requires a H bridge motor driver to be connected to the arduino. It cant drive stepper motors or servo motors. Simtools can output the data but you may have to write your own arduino code to control stepper motors but there may be some examples to get you started.
    Also stepper motors dont need a pot on them for feedback. They work by sending pulses to the motor to control the position. Hybrid stepper motors use an encoder for closed loop control but not a pot.
    • Like Like x 2
  3. dr.Evil

    dr.Evil New Member

    Joined:
    Aug 26, 2020
    Messages:
    15
    Balance:
    66Coins
    Ratings:
    +1 / 0 / -0
    My Motion Simulator:
    2DOF
    thank you for stating that,I could find this info on the thread. I treat servos and steppers as motors also.
    If you could point me to some of those examples would be great, thank you. I am quite busy trying to do that.
    Idk what to say, in my mind they are all transducers, some analog some digital. I'm a bio-engineer so I treat everything from down to up, all simple to advanced. To me, it all sums up to what is needed by IO logic.

    My plan now is to start figuring out what I should keep and what I should add in order to make it work. of there is a way i could get the existing HW setup get moving from a single Uno.
    I have no clue if there is another sub forum where I can ask even more advice.
    My hardship comes from the situation I am in. I got a 2DOF sim that, imho, has a decent quality build and a nice perspective for future. For now, it's just controlled by the analog signal it gets from steering wheel and pedals ( not a nice experience in my ). So, to me,I need to find a solution on something that i didn't build. It's like you need to build something mainly using this parts and only using this frame.
    I made a 2 dof and a 3 dof platform with adapted code. On the 3 dof I really worked to come up with a solution that took some good time only to find on a subforum someone who made a post about his failure with something similar in 2014 and retract that statement in 2016, this pointing me to an address where i found a needed library.

    The sim has this stepper motors for each axis with pots on them linked to ?good? divers and psu/s/. The motors have an Arduino assigned for each set of controls. I am thinking of making a code that uses 2 hall sensors as stop limiters and some kind of closed loop Driver by using the one already there. i could also upgrade the drivers to hybrid ones if that;s a good step in a good direction/ for me time is more valuable than money.
    I have two ways; i'll concentrate more on coding the motors if I can get more useful directions about similar HW setups.
    number two is to build an array of transducers with a dedicated arduino that only initializes and gets the calibration done , hands over control to t 2nd one (runs the code for motors) keeps providing data at end of each command. I don;t even know if that's feasible.

    I would post photos of the setup but I don;t know if it's allowed and ppl could get questioned about internals of commercial products.
    Last edited: Sep 14, 2020
  4. cityparker

    cityparker Member

    Joined:
    Sep 14, 2020
    Messages:
    35
    Balance:
    125Coins
    Ratings:
    +2 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor
    but I can not write arduino code,so what can I do。
  5. moaale

    moaale IAN MRTIN

    Joined:
    Jun 29, 2011
    Messages:
    168
    Occupation:
    NN
    Location:
    ARGENTINA
    Balance:
    124Coins
    Ratings:
    +41 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, SimforceGT
    You would have to look for 12v electric cricket motors or electric winches, those go well, they lift a ton and others more ... those motors would come to your hair or if not look for a pair of controllers for the motors that you have 20200914_230722.jpg
    Last edited: Sep 15, 2020
  6. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    20,551
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    145,124Coins
    Ratings:
    +10,778 / 52 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    Use hardware that has existing code available in the FAQs.

    Please check the FAQs for the answers to common questions before starting or commenting thread.
    • Like Like x 1
  7. matej

    matej New Member

    Joined:
    Sep 15, 2020
    Messages:
    2
    Balance:
    36Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    Arduino
    make sure there are no fingers in between when starting hese motors almost leatrned the hard way!!