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

Arduino UNO/Duemilanove 2dof firmware

Discussion in 'SimTools compatible interfaces' started by prilad, May 29, 2013.

  1. RacingMat

    RacingMat Well-Known Member Gold Contributor

    Joined:
    Feb 22, 2013
    Messages:
    2,086
    Location:
    Marseille - FRANCE
    Balance:
    19,039Coins
    Ratings:
    +1,970 / 20 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Yep, 10kOhm has to be linear (not log)
    and prefer CERMET (ceramic metal) track than cheap CARBON plastic track
    • Like Like x 1
  2. trust928

    trust928 Member

    Joined:
    Sep 19, 2013
    Messages:
    153
    Location:
    brazil
    Balance:
    405Coins
    Ratings:
    +7 / 3 / -0
    My Motion Simulator:
    2DOF, Arduino
    prilad.. i have downloaded ur code,, and uziped it.. it has 7 hex files i think... is it all the same? i have uploaded the 28800 to the arduino.., so,,its all wired up, with this hex file.. should i do anything else? or its all?
    theres an easy way to test if is all working?
  3. prilad

    prilad Well-Known Member SimAxe Beta Tester SimTools Developer

    Joined:
    Apr 29, 2012
    Messages:
    378
    Location:
    Dubna, Russia
    Balance:
    9,261Coins
    Ratings:
    +493 / 1 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino
    For testing my FirmWare you can use test soft "xSimCtrl".
    After connecting Arduino to USB you should start xSimCtrl.exe and setting up COM-port (virtual COM-port for Arduino) baud rate from menu.
    Than turn on checkboxs "Sending data to AMC" and "Receiving Data".

    After you can Turn On "Osscillator" and soft will send test data to Arduino.

    You can found "xSimCtrl" v2.2 here
    http://www.xsimulator.net/community/threads/revolution-firmware-and-software-for-amc1-5-1-6.3912/
    • Like Like x 3
    • Useful Useful x 1
  4. trust928

    trust928 Member

    Joined:
    Sep 19, 2013
    Messages:
    153
    Location:
    brazil
    Balance:
    405Coins
    Ratings:
    +7 / 3 / -0
    My Motion Simulator:
    2DOF, Arduino
    hey guys wants to know the news,, they are bad news loll

    i followed ur instructions to make the motor move...
    at the beginning i was hearing a little noise.. like (bad contact) so i thought it was the atx...but it wasn't the atx
    it was my bc47 burning.. loll seems funny but its boring to change it.. why its burning? simple

    1) its burning coz is coming signals from both wires IN1 and IN2 at the same time.. now just one side of the hbridge is working loool i will fix it later....

    2) i coudnt change the motor speed with potentiometer or in the slide of oscillator...

    3) the motor turns one way (coz of the burning process) but if i turn off the sittings it keeps running and even if i remove arduino from usb it still keeps running haha its crazy...

    (arduino-------small circuit (5v from external power)-----(h-bridge, IN1 and IN2, )
    the ground pin of h-bridge is going direct to arduino is it right?) com6 and baud rate 9600

    well i hope with the help of you guys makes this h-bridge works:sos
  5. trust928

    trust928 Member

    Joined:
    Sep 19, 2013
    Messages:
    153
    Location:
    brazil
    Balance:
    405Coins
    Ratings:
    +7 / 3 / -0
    My Motion Simulator:
    2DOF, Arduino
    i forgot maybe this is the problem.... i have uploaded the hex file 28800 to arduino
    but in the software simctrl i put baud rate 9600 maybe thats the problem?or whatever?
    I'm running out know can't test but later i will try again..
  6. prilad

    prilad Well-Known Member SimAxe Beta Tester SimTools Developer

    Joined:
    Apr 29, 2012
    Messages:
    378
    Location:
    Dubna, Russia
    Balance:
    9,261Coins
    Ratings:
    +493 / 1 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino
    Hi, trust928

    I think it will be better to go "step-by-step"

    -Step 1-
    Check connection between PC and Arduino. For this step you should use only Arduino with uploaded firmware, USB cable, PC with "xSimCtrl" software.
    -- Connect Potentiometers to Arduino (only pots, without other parts (h-brifge ets)
    -- Connect Arduino to USB port of PC
    -- Run xSimCtrl.exe
    -- Try to getting feedback data from Arduino to PC. On the Graph panels you should see signals from pots. Change post position and check signals on xSimCtrl.

    -Step 2-
    If you have Oscilloscope - check PWM signals on Arduino pins by him. If you haven't - you can use Multimeter to measure voltages on this pins. You should see something like on this video:


    -Step 3-
    -- Disconnect Arduino from USB
    -- Connect your extra_pcb with 74hc08 to Arduino (connect PWM, DIR, VCC and GND wires). Without H-Bridge.
    -- Connect Arduino to USB, run xSimCtrl.exe and check output signals IN1 and IN2. For checking you can use Oscilloscope or Multimeter or two LEDs with resistors about 300 Ohms.

    Let me know when you passed this three steps.

    Regards.
    • Like Like x 3
  7. trust928

    trust928 Member

    Joined:
    Sep 19, 2013
    Messages:
    153
    Location:
    brazil
    Balance:
    405Coins
    Ratings:
    +7 / 3 / -0
    My Motion Simulator:
    2DOF, Arduino
    im goona test it know just curiosity,, i have to upload any firmware? or firmware is the (sketch code?)
  8. trust928

    trust928 Member

    Joined:
    Sep 19, 2013
    Messages:
    153
    Location:
    brazil
    Balance:
    405Coins
    Ratings:
    +7 / 3 / -0
    My Motion Simulator:
    2DOF, Arduino
    I WILL BE FOLLOWING STEP BY STEP. here are the first step

    i have uploaded the hex 9600 ok..baud rate 9600 too and data bit 8 bits..
    arduino with pots... after start xsimctr,, i checked data receiving send receiving and display data
    so the arduino starts to blink... when i move pot 1 it moves a bit the slider when i move pot2 it move a lot as u can see in photo.. only the first slider shows signal the second don't move.. whtas may be wrong?

    i havent checked the pwm voltage yet i will fix it first as u said step by step loool
    and how to know when its working correct.... thanks

    Attached Files:

    Last edited: Sep 29, 2013
  9. prilad

    prilad Well-Known Member SimAxe Beta Tester SimTools Developer

    Joined:
    Apr 29, 2012
    Messages:
    378
    Location:
    Dubna, Russia
    Balance:
    9,261Coins
    Ratings:
    +493 / 1 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino
    Ok, trust 928. First step is completed.

    About pots - check, please, connection diagram.

    potentiometer.jpg
    • Like Like x 2
  10. trust928

    trust928 Member

    Joined:
    Sep 19, 2013
    Messages:
    153
    Location:
    brazil
    Balance:
    405Coins
    Ratings:
    +7 / 3 / -0
    My Motion Simulator:
    2DOF, Arduino
    hey prilad still no luck, look.. my pot 5v and gnd was inverted i fixed it but still the same
    if i change A0 and A1 the first slider stop.. and the second works,, i have tried all combinations
    I'm using arduino uno r3 in the picture below u see how my pots wiring

    Attached Files:

    Last edited: Sep 29, 2013
  11. prilad

    prilad Well-Known Member SimAxe Beta Tester SimTools Developer

    Joined:
    Apr 29, 2012
    Messages:
    378
    Location:
    Dubna, Russia
    Balance:
    9,261Coins
    Ratings:
    +493 / 1 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino
    Looks too noisy. What power supply do you use? Only USB power? What length of pots wires? Can you make a test with short (as possible) wires? As you can see in my video - signals must be not so noisy
    • Like Like x 2
  12. trust928

    trust928 Member

    Joined:
    Sep 19, 2013
    Messages:
    153
    Location:
    brazil
    Balance:
    405Coins
    Ratings:
    +7 / 3 / -0
    My Motion Simulator:
    2DOF, Arduino
    I'm using only usb power.. the cables have i think 1 meter, i will test it now
  13. prilad

    prilad Well-Known Member SimAxe Beta Tester SimTools Developer

    Joined:
    Apr 29, 2012
    Messages:
    378
    Location:
    Dubna, Russia
    Balance:
    9,261Coins
    Ratings:
    +493 / 1 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino
    If you use "long" wires - you should use "screened cable".
    • Like Like x 3
  14. trust928

    trust928 Member

    Joined:
    Sep 19, 2013
    Messages:
    153
    Location:
    brazil
    Balance:
    405Coins
    Ratings:
    +7 / 3 / -0
    My Motion Simulator:
    2DOF, Arduino
    well good news,, now its working as it should i think. each pot moves one slider....
    i didn't know about the wires...
    i me sure the voltage in ard pins,, it goes like that

    from pin 11 to 10 ,9 it gives 5v.... from pins 8 to 9, 10 it give 5v theres no current between pins 8 and 11 is it right?

    Attached Files:

  15. trust928

    trust928 Member

    Joined:
    Sep 19, 2013
    Messages:
    153
    Location:
    brazil
    Balance:
    405Coins
    Ratings:
    +7 / 3 / -0
    My Motion Simulator:
    2DOF, Arduino
    hey i discovered one thing and that goes to all who are starting.. after i mounted the pcb I've connected it to my h-bridge,, and thats was sufficient to burn it.. but it wasn't fault of h-bridge or the pcb...
    it was my fault... i haven't take attention when soldering some wires.. and i forget one really really small point when soldering.. and it sends 5 v direct in line 1 and 2.. now i have to fix the h-bridge and the pcb is now fixed..
    so take attention and makes revision before tests
  16. Historiker

    Historiker Dramamine Adict Staff Member Moderator Gold Contributor

    Joined:
    Dec 16, 2010
    Messages:
    1,935
    Occupation:
    Retired
    Location:
    Michigan USA
    Balance:
    9,492Coins
    Ratings:
    +1,824 / 13 / -1
    My Motion Simulator:
    3DOF, DC motor, Arduino, Motion platform, 6DOF
    It is always a good idea to check continuity between circuits before applying power ;)

    I too learned this the hard way.
    • Like Like x 2
  17. trust928

    trust928 Member

    Joined:
    Sep 19, 2013
    Messages:
    153
    Location:
    brazil
    Balance:
    405Coins
    Ratings:
    +7 / 3 / -0
    My Motion Simulator:
    2DOF, Arduino
    we stay angry because we don't know whats happening.. but when we found the problem. we start to smile haha even if the circuit has gone away haha its fun..... but boring loool
  18. prilad

    prilad Well-Known Member SimAxe Beta Tester SimTools Developer

    Joined:
    Apr 29, 2012
    Messages:
    378
    Location:
    Dubna, Russia
    Balance:
    9,261Coins
    Ratings:
    +493 / 1 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino
    trust928.

    Sorry I've been busy...
    But before we will go to next step I recommend you to change (reduce) coefficients KpLo and KpHi for both channels. In editing fields you should set KpLo to "2" and PRESS "ENTER" key on keyboar for sending new value to Arduino. ( if this operation was correct, you was see new values in the right of editing field)

    Edit all four parameters and then click "Save setting to EEPROM" button.

    After this your PWM signal will controlled more smoothly.
    • Like Like x 2
  19. trust928

    trust928 Member

    Joined:
    Sep 19, 2013
    Messages:
    153
    Location:
    brazil
    Balance:
    405Coins
    Ratings:
    +7 / 3 / -0
    My Motion Simulator:
    2DOF, Arduino
    ok it goes like this.. should i edit some thing else?

    Attached Files:

  20. prilad

    prilad Well-Known Member SimAxe Beta Tester SimTools Developer

    Joined:
    Apr 29, 2012
    Messages:
    378
    Location:
    Dubna, Russia
    Balance:
    9,261Coins
    Ratings:
    +493 / 1 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino
    I see that KpLo/Hi set = 2 (marked by RED) but get from Arduino = 3 (or 20) (marked by BLUE)
    But this values should be equals...

    nova configuracao 2.JPG

    Be careful ;) Try again.

    And next you can change PWM signal by pots and check voltage on PWM pins (9,10) of arduino. Voltage should smoothly changed from 0 to 5 volts. On DIR pins (8 and 12) voltage should changed abruptly, when PWM signal changed sign.
    • Like Like x 2