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

Tronic's AMC motor motion-controller with pwm/servo output

Discussion in 'SimTools compatible interfaces' started by tronicgr, Aug 30, 2007.

  1. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    BEWARE: This 1.5 version is obsolete now! You can find the new version, the AMC1.6USB on the following link:
    Thanos AMC1.6 USB Motion Controller.

    AMC1.6 complete1.JPG


    ------------------------------------------------------------------------------------------------------------------------------------

    The AMC1.5 AVR controller supports 2 full H-bridge PWM channels to drive the motors. The connections will be made in the same ports and its function will be selectable by dip switches.


    The major features are:

    - 10bit (1024) motor speed resolution
    -2 actuators/motors support (in latest firmware 1.0)
    -2 full PWM channels, 2 - 8bit pwm channels (Not implemented yet the extra channels lack of timers).
    -4 potentiometer inputs (that sets the max travel angle and the proportional speed.)
    -LCD support

    MANUAL FOR AMC / DSMHb with X-simulator software
    https://rapidshare.com/files/1960710485/AMC_DSMhb_Manual_Word_97-2003.pdf

    AVRmotioncontroller1_5_fix_pcb.gif

    (EDIT: I HAVE NEW IMPROVED PCB PLANS FOR THE AMC1.5 HERE: post7978.html#p7978 )

    Below you can see the layout I made to be able to follow the RN-VN2 connection standards. PCB plans are included to built this board if you want. Over this layout I’ll add the rest software features to make it able to fit to every type of motion simulator. Other PWM motor controller can be used too since they use the same basic connections (PWM, Enable1, Enable2) just different layout of the connection stripe.


    AVRmotionsimulatorcontroller1_5_aa.pdf

    And here is only the bottom side layout:

    [​IMG]avrmotionsimPCBbottom_only_1_5_a.pdf (100.25 KB)

    Here is the new part list for version 1.5 of the AVR controller PCB:
    avrmotioncontrollerparts1_5c.pdf

    And here in text format only:
    AVRmotioncontrollerpartlist1_5c.txt


    Notice: If you can't find the molex connectors or you found them in too high prize, you can use pairs of simple DIP pin headers in place of the base connector or to create the data cable between avr controller and RN-VN2 motor controller. But you have to be carefull about the orientation of the connection if you plug - unplug them often. One full set of molex connectors for an AVR controller PCB, costs around 3.30 euro (14 connectors, male/female)... at least, this prize I buy them localy in Greece...








    --------------------------------------------------------------------------------

    Some technical details about the AVR motion controller:

    Motor 1,2 run on 9bit PWM on 23,47Khz (9bit = 512)
    Motor 3,4 run on 8bit PWM on 23,47Khz (8bit =256) (not implemented)
    Has 8 ADC channels with 10bit resolution (10bit=1024)

    Actually I drive the motor on 10-bit resolution! 0-511 for one direction of the motor and 512-1023 for the other direction!!! Same double resolution is used for motors 3,4 (9-bit)!


    --------------------------------------------------------------------------------

    Here is a schematic on how to do wirings for two RN-VN2 controllers to support 4 motors in the future... Only the first header in used for now.

    avr_controller_2_RVNV2_wiring.gif


    --------------------------------------------------------------------------------
    FIRMWARE 1.0

    This is the first official release v1.0. It replaces all the previous beta versions!
    For this reason I included the code for the two motion styles (Joyrider & SimforceGT) in it, and made it selectable between them with a jumper.

    fmv1_joyr.JPG

    fmv1_sfgt.JPG

    But his isn't the only feature. I also decided to give to the users the ability to change the servo motor KP proportiality values thru simple terminal connection:

    terminal.gif


    Anyway you can read all about it in the manual I made for it:

    PWM_AMC15_2DOF_v1_manual.pdf


    And of course the firmware that cames in four files, each one for the crystal speed you are using:

    [strike] PWM_AMC15_2DOF_v1 firmware.zip[/strike] (Retired, sorry!!)
    (20.38 KiB) Downloaded 4611 times
    (You can find a working firmware for the new AMC1.6USB version following the link on the top of this post!!! Join http://www.x-sim.de ).


    You can try using this interesting alternative firmware for AMC1.5:
    Alternative software and firmware for the controller board AMC1.5



    I connected a simple pot on directly on the motor axis and had enough precision on positioning without much ringing. So using multiturn pots is not always necessary.
    You can connect two dual h-bridge motor controllers on it and control four motors but with a small restriction. The last two motor channels will run on 8bit PWM. This is a restriction of the Atmega8535, as it has only one 16bit timer that is shared on the channels for the two first motors. Anyway 8bit PWM isn’t that bad and can be used in heave or rotation that precision isn’t so critical.


    Some description of the features of that Firmware v1.0 has:

    -It uses only the first two motors for now: The pin header on the bottom (named rn-vn2) that can be connected to the JP1 header of an dual h-bridge motor controller.

    -It uses only two the first two pots. Pot1 is position feedback for the motor1 and Pot2 is position feedback for the motor2.

    -Don’t forget to align the position pots with the motor or the motion travel route to successfully have position feedback.

    -When powered both motors should move to center position. If not immediately disconnect the power and reverse the motor +,- connections to turn to the opposite.

    -It runs on serial speed of 115200 and you have to enter the setting of the following photo in the profiler USO to get it connected right:


    USObeta001.gif


    The format of the output string is “AB~255~~y~~x~”
    The ~255~ is there for compatibility reasons to be able to also test with Ian’s BFF 3DOF driver!!


    Since the AVR controller has its own serial programmer included (ISP) you can use ponyprog to easily program the flash firmware on it and set the proper fuses for the crystal speed. You can see on the bottom of this post how you can use ponyprog.


    I also developed the SimforceGT (frex-like) motion included in this version for Egoexpess and everyone else with simular motion cockpit!!!

    Notice: This is a coupled motion version for two motors. Meaning the two motors are cooperate to lean to sides and back-forward.

    Motor assignments are as follow:

    Motor1 connection (on first DSMhb) is the right motor on the simulator.
    Motor2 connection (also on first DSMhb) is the left motor on the simulator.

    Again potentiometers are used for feedback on the motors: Motor1 --> Pot1 , Motor2 --> Pot2

    The motion is limited in half for left-right as I reserved the rest motion capability for front-back motion!



    --------------------------------------------------------------------------------

    NOTICE TO ALL: This is still a BETA version and I’m not held responsible of any damage happens to your motors, simulator structure, you, etc. Use it on your own Risk!! You should know that motion simulators can be very dangerous if not handled with care!


    --------------------------------------------------------------------------------

    In case you don't know how to program the firmware on it, here is a small guide on how to use Ponyprog2000 to program the board:

    [​IMG]Thanos_ponyprog_guide1_1.pdf (500.13 KB)

    --------------------------------------------------------------------------------

    If you are looking for a suitable alternative of RN-VN2 you can use this:

    Part#0708, Dual VNH2SP30 motor driver carrier

    http://www.pololu.com/products/pololu/0707/

    And here is a schematic of the wirings you need to do to use the Polulu motor driver:

    AMC1_4_with_pololu.gif

    Its Yobuddy's design with a minor fixes on the pots connection.


    --------------------------------------------------------------------------------

    Another solution instead of buying a ready commercial motor controller is to make yourself the H-bridges to fit them on the amp/voltage rate of your motors. Then you can build this DIY Dual simple H-bridge motor controller!


    dual_simple_hbridge_1_2_photo.gif

    You can learn more about it here:

    http://www.x-simulator.de/forum/tronic-s-diy-dual-mosfet-h-bridge-t820.html

    --------------------------------------------------------------------------------

    I decided to make some video guides to help people understand the basics about my AVR motion controller.

    I have made four video parts so far, that shows the cable connections, the ponyprog programming procedure, and the connection with x-sim software.

    Here is the link to download all these videos:

    http://rapidshare.com/files/106829488/AMC_video_guides_parts1_to_4.zip

    ---------------------------------------------------------------------------------------------------------------
    Take a look a the following thread!!!! :gl:
    Here is a some help for people that already have the old now AMC1.5 board and face problems with programming it or have serial communication problems: amc-1-5-missing-device-or-unknown-device-24-t1390-30.html#p38437


    Thanos

    ----------------------------------------------------------------------------------------------------------------
    some useful links:
    http://www.x-simulator.de/forum/viewtopic.php?f=25&t=559&p=6138&hilit=multiturn+pot#p6138
    http://www.x-simulator.de/forum/tro...er-with-pwm-servo-output-t559-620.html#p14488
    http://www.x-simulator.de/forum/tro...ontroller-with-pwm-servo-output-t559-630.html
    http://www.x-simulator.de/forum/tro...er-with-pwm-servo-output-t559-510.html#p11967
    http://www.x-simulator.de/forum/tro...er-with-pwm-servo-output-t559-510.html#p12154
    http://www.x-simulator.de/forum/tro...ler-with-pwm-servo-output-t559-430.html#p9780
    http://www.x-simulator.de/forum/tro...ler-with-pwm-servo-output-t559-420.html#p9129
    http://www.x-simulator.de/forum/tro...ler-with-pwm-servo-output-t559-420.html#p9258
    http://www.x-simulator.de/forum/tro...ler-with-pwm-servo-output-t559-410.html#p9045
    http://www.x-simulator.de/forum/tro...ler-with-pwm-servo-output-t559-370.html#p8922
    http://www.x-simulator.de/forum/tro...ler-with-pwm-servo-output-t559-360.html#p8644
    http://www.x-simulator.de/forum/tro...ler-with-pwm-servo-output-t559-330.html#p8163
    http://www.x-simulator.de/forum/tro...ler-with-pwm-servo-output-t559-320.html#p7978
    http://www.x-simulator.de/forum/tro...ler-with-pwm-servo-output-t559-290.html#p7350
    http://www.x-simulator.de/forum/tro...ler-with-pwm-servo-output-t559-170.html#p6138
    http://www.x-simulator.de/forum/tro...ing-simulator-using-x-sim-t471-20.html#p10318

    Attached Files:

    • Like Like x 1
    • Winner Winner x 1
  2. Ads Master

    Ads Master

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
  3. egoexpress

    egoexpress Active Member

    Joined:
    Dec 13, 2006
    Messages:
    3,842
    Location:
    Germany - Frankfurt/M
    Balance:
    418Coins
    Ratings:
    +7 / 1 / -0
    Hi Thanos,

    I am impressed how fast you implemented the additional features. Even your interface was great before, it made a great step forward regarding to be a really universal motor controller!

    With the pwm/servo and pot/encoder options your interface will be usable for any motor and feedback setup!

    Everyone could decide by himself, what type and size of motor driver fits his purposes (and wallet ;) )

    With the pwm and encoder support, those, who have either direct driven motors or motors with strong gearboxes, could simulate rumble, while driving over curbs, engine vibrations and all the rest of the ForceFeedback effects which require fast movements in short distances.

    Keep at it! Great work!

    Concering the encoder centering. I think that most motors, which are not linear actuators dont have end switches. Perhaps it could be realised that way, to set your simulator to center position in all axes. Then you would have to take this point as axis1=0, axis 2=0, axis3=0 and axis4=0
    From this center point, the offset (encoder lines) should have to be able to set. For example -1000000/+1000000. One could arise these values until the desired DOFs are reached (surely limited by the setup ;) )

    The idea with endswitches is good as well, but would fit only for those who have them attached on the actuators.
    Another option could be to add some end-switches to the simulator. I think that they work autonomous, and dont have to be connected to the interface.
    In this case, calibration would work that way, that the simulator would drive until end-switches, and the interface would have to store these values.
    Center and DOF calibration could be made by simply moving the end-switches positions.
    This could be done either with motor power, or manually.

    Dont know which method would be best. What do you guys think?

    ego
  4. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    Thanks, but I haven't done much yet. I still have to assemble a prototype and put toggether some code parts I have and start intensive testing it before I get back to you workable results...

    But your feedback give me new ideas on how to proceed in this.

    motor_quadrature_enc2.jpg motor_quadrature_enc1.jpg

    It happens to have some quadrature encoders at home and one of them is fixed on a DC motor:



    The disk looks like 256 cpr or more!!!

    The only thing that troubles me though, is the centering of the motors, while using quadrature encoders, that has to be done during power-on with full travel of the frames until limit switches are reached... Any suggestions?


    In my oppinion I now find the limit switch idea unnesessary... I could program it in such way that it will do some training by itself about the limits in all axis, the first time it power up. Then if re-training is required I could program it to detect if you pressed two or three times the reset button to start over again. To detect the limit of its travel I could program it to monitor the encoders during slow moving the motor. As the motor will be physically limited it will forced to stop by itself and the controller can see this stop because the encoder is stop moving too and this will be marked as limit. And the center will be between the two forced stops of the motor.

    I could even detect how many motors are connected on it this way too!


    Any comments on this are welcome.

    Thanos
    • Agree Agree x 1
  5. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    Update:

    Just finished making the homemade PCB!!!

    Thanos AVRcontrollerPCBcloseup.jpg AVRcontrollerPCBphoto.JPG

    Next is soldering the parts to start programming it...
  6. egoexpress

    egoexpress Active Member

    Joined:
    Dec 13, 2006
    Messages:
    3,842
    Location:
    Germany - Frankfurt/M
    Balance:
    418Coins
    Ratings:
    +7 / 1 / -0
    Hi Thanos

    Nice to see some progress!

    If the implementation of the LCD and IR-remote would take too much time, I'd appreciate if you could release the pcb without this features. They could be implemented via a firmware update later as well.

    I have ordererd a dual motor-driver, and looking forward to use it with your interface ;)

    regards
    ego
  7. 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,717Coins
    Ratings:
    +1,731 / 10 / -0
    My Motion Simulator:
    2DOF, DC motor, SimAxe, SimforceGT
    Hi Thanos,

    i ordered the same Dual-Motor-Driver as Ego (hope it arrives today) and i am very exciting for your next updates. The whipper motors still arrived this week.

    I haven´t told it up to now, but it is really really cool, that you adapt your interface to the Atmel :wink:

    Will you publish the source code for the Atmel later, for making own changes? I don´t wanna call it improvements, because it is very impressive what you have done so far. :D

    regards
    René
  8. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    Hi Rene,

    What model is the dual motor driver that you and Ego ordered? I might buy the same to do tests on my own on them instead to relay on you feedback for the results...

    Using AVR will be many times better than BS2 for sure...

    I can do an exception for you and share the code if you are able to point any improvements on it... :)

    Just be patient on it, as I have to start from ground-up, as the code I already have for BS2 is useless in the new design...

    Regards, Thanos



  9. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    Hello Ego,

    The LCD will be there for debugging reasons (for start) and will be fully supported only after I finished with the servo motor driving features...
    the same apllies for the IR receiver...

    Regards
    Thanos



  10. 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,717Coins
    Ratings:
    +1,731 / 10 / -0
    My Motion Simulator:
    2DOF, DC motor, SimAxe, SimforceGT
    Jassou Thanos,

    we have ordered that PCB:
    http://www.shop.robotikhardware.de/shop ... cts_id=112

    It is available as kit, or complete ready built. It uses the driver VNH2SP30 which tolerates up to 30A and 41 Vmax , when the driver gets an additional good cooler, and some modifications of the resistors. Due to the standard non-cooling of the board, it is rated for 16V.
    http://www.shop.robotikhardware.de/shop ... cts_id=108

    Here is a diagramm:

    If you need some translation for the site and further specifications for the driver, please ask me, i will do it.

    I don´t know, if shop.robotikhardware.de will ship to greece. If not, tell me which components do you need (compelte kit, ready assembled, only the VNH2SP30 etc. ), and i will order it and send it to you.

    Thank you for your code exception. Bad word for an programmer:)

    so long
    René

  11. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    Hi Rene,

    This motor controller is awesome... in fact it uses the same chip (VNH2SP30) as the HB-25 are using! And costs the half money with two VNH2SP30 chips on the same board! I have bought the two HB-25 for 150euro last year. I want one of these RN-VN2 DualMotor!!


    [​IMG]

    Can you check if they can sent to Greece cause I can't translate all their pages... If they not, I would be very obligee if you ordered it for me (I could sent you the money for the board and the shipment costs to your Bank account or something...).


    Regards, Thanos
  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,717Coins
    Ratings:
    +1,731 / 10 / -0
    My Motion Simulator:
    2DOF, DC motor, SimAxe, SimforceGT
    Hi,

    have asked them, if the would send to greece, but doesn´t matter if the do or not. I will order it for you...do you want the ready assembled board for 49.80EUR?

    Please write me a PM with your adress

    regards
    René
  13. egoexpress

    egoexpress Active Member

    Joined:
    Dec 13, 2006
    Messages:
    3,842
    Location:
    Germany - Frankfurt/M
    Balance:
    418Coins
    Ratings:
    +7 / 1 / -0
    Yes, this driver is very well done driver. In particular its price ;)
    It is reduced to the essential parts to save space and weight. But I think I'll mount some copper to the driver chip.
    It is made by members of the german robotics forum http://www.roboternetz.de
    They use to sell the results of their projects for fair prices.
  14. egoexpress

    egoexpress Active Member

    Joined:
    Dec 13, 2006
    Messages:
    3,842
    Location:
    Germany - Frankfurt/M
    Balance:
    418Coins
    Ratings:
    +7 / 1 / -0
    @Thanos

    Would it be possible to provide a PWM frequency above 16kHz?

    Afaik, motors drive more quiet, when driven in these high frequencies, because humans cannot hear above 16kHz.

    The RNV2-Dual driver supports up to 20kHz PWM.

    And a high Encoder resolution would be important as well. Would 16bit be possible?
  15. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    @ Ego

    I must research more to see about the PWM speeds supported on the Atmega8535. I have seen otherAVR that support high-speed PWM like the ATtiny26 but it has limited ports and no hardware Uart support.

    I don't either want to hear the high pitch sounds from the motors too but when low PWM pulses sended I think it will produce some noise. My HB-25 does produce noice during low PWM signals...

    As for the encoders resolution I was thinking something like 10bit resolution (0 to 1024) unless more resolution needed.


    @ Rene

    Got your PM with the bank transfer details, tommorow morning I will make the transfer. Thanks for your help.

    Regareds, Thanos
  16. egoexpress

    egoexpress Active Member

    Joined:
    Dec 13, 2006
    Messages:
    3,842
    Location:
    Germany - Frankfurt/M
    Balance:
    418Coins
    Ratings:
    +7 / 1 / -0
    Which PWM frequency do you use currently?

    1024 steps is borderlined.

    In the datasheet of the Atmega8535, I found these specs:
    – Two 8-bit Timer/Counters with Separate Prescalers and Compare Modes
    – One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture

    How to get 4 Encoder inputs with 10bit resolution?

    Perhaps an external decoder IC could be a solution?

    10bit is not enough for sure :(
  17. EvanF

    EvanF Member

    Joined:
    Jun 10, 2007
    Messages:
    199
    Occupation:
    Multimedia Producer
    Location:
    New Zealand
    Balance:
    423Coins
    Ratings:
    +1 / 0 / -0
    I've read that Brushed DC PM motors are low passive devices and not capable of passing high frequency energy.
    The higher the frequency and you start to lose torque.
    Generally up to 20k period for medium sized motors but each motor is different.
    Generally lower frequency periods are better for torque..but more noise!
    The lower the frequency, the higher the ripple current and the greater the heating.
    RF emissions: these increase with increasing frequency.

    http://www.epanorama.net/links/motorcontrol.html
    http://www.4qdtec.com/pwm-01.html
  18. EvanF

    EvanF Member

    Joined:
    Jun 10, 2007
    Messages:
    199
    Occupation:
    Multimedia Producer
    Location:
    New Zealand
    Balance:
    423Coins
    Ratings:
    +1 / 0 / -0
    Thanos,

    I would like to use this motor controller board with your upcoming design. I will get 2 of these to control 3 axis.
    KT-5198 Dual Bidirectional DC Motor Speed Controller.
    Could you let me know if it will be compatible with your design.
    Factors why is because supply is close to me, just being in Australia, and it is affordable.
    http://www.oceancontrols.com.au/motor_c ... ollers.htm


    PWM freq of this controller up to 10khz. Is it possible that your new design is not limited to too high a freq else problems with motor type compatibility may arise. Perhaps some frequency dividers in the firmware set to dip switches so that different users can select PWM freq suitable for them?

    Just some thoughts before I go out and buy more toys!

    Evan
  19. egoexpress

    egoexpress Active Member

    Joined:
    Dec 13, 2006
    Messages:
    3,842
    Location:
    Germany - Frankfurt/M
    Balance:
    418Coins
    Ratings:
    +7 / 1 / -0
    @Evan

    We could order some RNV2-Dual for you as well ;)

    ego
  20. EvanF

    EvanF Member

    Joined:
    Jun 10, 2007
    Messages:
    199
    Occupation:
    Multimedia Producer
    Location:
    New Zealand
    Balance:
    423Coins
    Ratings:
    +1 / 0 / -0
    ego

    I will think on that, thanks for the offer! :D

    But I do like the fact that supply of the KT-5198 Dual Bidirectional DC Motor Speed Controller is very close to me and the mosfets should be easily replaceable (even I could solder them!)...I guess question mark could be the switching speed of the mosfet.

    If Thanos makes his great design as flexible as possible, for different components, then more people can benefit from his good work!

    BTW. On PWM freq,
    I tested 4khz PWM last night on 12V/3A and ripple was a bit 'gravelly'. Hopefully tonight I will find time to test on 24V and 'feel/hear' what happens. But first I must wire up the 4xSLA cells (4x12V/9A) and floating 24V charger. Remember this is with Tripod platform design and not Cradle motion.
  21. 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,717Coins
    Ratings:
    +1,731 / 10 / -0
    My Motion Simulator:
    2DOF, DC motor, SimAxe, SimforceGT
    like the idea, i imagine a dynamic PWM frequency, setable via poti and the frequency can be seen at a little matrix lcd.
    That should be suitable for every possible combination of motor and motordriver ;-)

    I understand that you prefer to buy near of you. The voltage and Current of the driver are higher than from our RNV2-Dual, too and price is nearly the same, without shippingcosts.

    I think Thanos is on the right way to make a universal X-Sim interface.

    regards
    Ray