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

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
    Hi to all,

    If you are going to order the PCB for the v1.4 of my avr controller, don't do it yet! :eek:

    I found that I used too little compoments on the max232 circuit to reliably run on 115200bps speed!! From quick tests and debugs I found out the some rc filters are needed for the inteferences and to loopback a few connections on the DB9 connector. :(

    With the minimum compoments I used, either it will receive erratic serial data or either it won't recieve data at all!

    When I use the max232 circuit located on my STK500 development board all works ok, so I confirmed that this is the problem. I need to build a small prototype with all extra filter compoments on it since I don't want to assemble a new PCB board yet.

    For those that already builded the PCB, I will show how you can build this small extra fix board on a protoboard piece. Then you can connect the RX header from the AVR controller PCB on this extra board to receive the data from there.

    I already prepared a layout with the nessasary changes and I will post as soon as I be sure it will work to avoid getting you into trouble for repairs later.

    Regards, Thanos
  2. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    Some update on serial comm problems:

    I might change the Max232 chip to a Max202. My STK500 development board has a max202 chip on it and I wonder if this is the problem... The max202 is pin to pin compatible with max232 just a few specifications are changing between them.

    I will do more tests with max202 these days so be patience.

    Regards, Thanos
  3. 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,864Coins
    Ratings:
    +2,007 / 13 / -0
    My Motion Simulator:
    2DOF, DC motor, SimAxe, SimforceGT
    Hi Thanos,

    as i understand when i change the baud rate to a lower value than 115200bps,
    there are no inteferences and loopback and i can use the board for testing purposes, and for first tryouts? I don´t want to wait longer, so i want to order today the electronic parts i need :)

    So far, thanks a lot for all those informations!
    Even absolute beginners should be able to build up your interface, that´s what i like the most! Engineering is one thing, the faculty writing good documentations distinguishes the good engineer from the better engineer :)

    kind regards, René
  4. 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,864Coins
    Ratings:
    +2,007 / 13 / -0
    My Motion Simulator:
    2DOF, DC motor, SimAxe, SimforceGT
    Full shoppingcart with some spare parts with the possibility to order and change the quantum can be found here:

    http://www.reichelt.de/?ACTION=20;AWKID ... ROVID=2084

    Please take care: At the shoppingcart there are some items double (for spare parts) and there is the Max232 AND Max202 in it. (you only need one of them,but until now, it is not confident which one we need)
  5. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    The problem that I'm facing now is that after the fix the interface receives correct data for about 3 seconds before the AVR chip is reseting itself!!
    This doesn't happen when I use the STK500 serial port. I builted an exact replicate of the STK500 serial port but the problem remains. I need more tests with a new atmega8535 chip and perhaps changing some of the firmware code comm part.

    I also tried baud rates down to 9600bps with correct data but resetting situation after a few seconds again. Tried with many different firms Max232 chips and with ADM202 chip that is rated with 250Kbps (double than max232) with no luck!

    I must figure why the reset is occouring, before ordering the parts. With the fix I made, there are some capacitors and resistors to be added on the list also. And using max232 or max202 is irrelevant as from what I seen their difference is that the Max202 has CMOS lines to the AVR side and ESD protection from static electricity protection.

    Just wait a while if its possible.

    Regards, Thanos
  6. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    I have good news!!!

    I finally figured out a way to fix it for good! Its very stable now! An additional simple Led did the trick! :D

    The way I see it, the signal from the max232 is active low but the low time was too little. So I decreaced the high time to equal them and produced a clean signal!!!

    The fix involves additional circuit that consists of a several compoments that I must fit toggether on the next version of the PCB.

    Here is a small list of them:


    Resistors:
    - 220 Ohm 1/4w
    - 470 Ohm 1/4w
    - 1 kOhm 1/4w
    - 39 KOhm 1/4w
    - 47 KOhm 1/4w


    Capacitors:
    - 1n2 ceramic (1.2 uf)
    - 103 ceramic (100nF)
    - 22 pF ceramic


    Other:
    - LED (yes it takes active part too!!)
    - 2x transistors BC547

    It worked ok now with MAX232, so we keep it!

    I will prepare a handmade protoboard with it and give you the layout of this fix as soon is possible. And the final layout on the whole AVR controller PCB soon. 8)


    Thanos
  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,864Coins
    Ratings:
    +2,007 / 13 / -0
    My Motion Simulator:
    2DOF, DC motor, SimAxe, SimforceGT
    Good morning Thanos,

    very good news! So, the max232 was the delinquent after all?
    I realize, when you said, you copied the max circuit, you used a max232 and not a 202 as on your testingboard?

    I am impressed, that you found the solution with a LED. I deny me the question how you come to that conclusion :D ...but would be interesting nevertheless ;-)

    regards René
  8. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    I tested both max202 and max232 chips, but since they are the same in operation I choose to keep max232 that is commonly available.

    The Led fix was more something like lucky shot! It can be used also as an indication that the serial comm is powered! :wink:

    (edit): I could have placed a 4148 diode in its place but the Led looks more cool!

    Still additional circuitry is needed besides the led anyway!

    Regards, Thanos
  9. Alle

    Alle Member

    Joined:
    Sep 16, 2007
    Messages:
    34
    Location:
    Italy
    Balance:
    283Coins
    Ratings:
    +2 / 0 / -0
    Nice job Thanos!

    Very good news.

    Alle
  10. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    I prepared a layout of the small PCB board that replaces the existing max232 circuitry. I designed it in such way to be able to use the existing 9-pin serial connector, in case you want to solder it on a pre-drilled protoboard instead of eching it.


    serialcommfix.gif


    [​IMG]serialcommfixPCB_bottom.pdf (24.87 KB)

    [​IMG]serialcommfixPCB_silk.pdf (22.23 KB)


    You can mount some legs on bottom of the this board on the 16pin connector and place it on the existing ic header of the original max232 circuit on the AVR controller.


    To be able to place it on the old max232 ic header, you must desolder the existing RX - TX molex headers on the max232 circuit side. Then solder one of them on the PCB fix board so they won't go wasted.

    To secure the PCB fix board into place, you can use the existing two large holes on the avr controller with some distance holders.

    I haven't found the time to solder this board yet but you can see it working on the testing breadboard!


    serialcommfix1.jpg

    serialcommfix2.jpg


    And a small preview of the new v1.5 PCB of the AVR motion Controller. PDF layouts will be available after I verify that I didn't make any mistakes on the layout...

    AVRmotioncontroller1_5pcb_beta.gif


    Thanos
  11. egoexpress

    egoexpress Active Member

    Joined:
    Dec 13, 2006
    Messages:
    3,839
    Location:
    Germany - Frankfurt/M
    Balance:
    421Coins
    Ratings:
    +10 / 1 / -0
    Hi Thanos

    To be honest. I'd rather like to assemle the new version, instead of soldering the additional pcb.

    Let me know when you think the 1.5 is ready for etching, and I'll order it for us :)

    One thing more. Would it be possible to replace the RX-TX connectors with some pin-headers with jumpers? Just because the molex are so damn expensive here^^ :)

    regards
    ego
  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,864Coins
    Ratings:
    +2,007 / 13 / -0
    My Motion Simulator:
    2DOF, DC motor, SimAxe, SimforceGT
    Hi Thanos,

    as fast as the firefighter :)

    I wonder, that the cirquit was getting so much more complicate and i really don´t understand why is such modification necessary if you have cloned the cirquit from your devBoard. Don´t missunderstand me, i belive in function of your modification, i only want to understand, why your devBoard works without it.

    It a really cool patch with the possibility to hook up the pcb on the original max232 socket. I think i will do it excactly that way, seem to be the easiest one.

    Can i safe the 1uF capacitors on the old 1.3 board and solder bridges?

    regards René
  13. 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,864Coins
    Ratings:
    +2,007 / 13 / -0
    My Motion Simulator:
    2DOF, DC motor, SimAxe, SimforceGT
    Sure, but we have to take care not to hot-wire the cables :twisted:

    The prices of the molex connectors are a pitty. Maybe Thanos could make a molex order for us ;-)
  14. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    Its easier for me to solder a fix board as I don't want to solder a new board yet. I will later to host the second version of the AVR controller that will use the ATmega644!!

    In the place of molex headers you can use simple SIP headers or just wires. I will add the jumpers you wanted, in the final design, in case you want to use simple wires for the connection, so you un-jumper them and use other external circuit in place of max232 (if needed).

    Thanos
  15. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    The STK500 development board does use all these extra compoments! Except from the led! The simple circuit I made on the earlier 1.3 & 1.4 versions was a simplified one that can be found all around the internet in relative applications. Just didn't worked for me and tried to copy to complicated circuit of the STK500.

    After seeing that either this didn't worked I started to search the differences in the output signal. And added the led to see whether the output was on or off. It somehow made it a little more stable so I decided to reverse it so it can sink the signal. This did the trick! I was getting a clean serial signal after that.

    I couldn't find why there is such difference between the two circuits but I guess they must have implemented some trick not mentioned on their manuals!


    I changed the 1uF capacitors with 10uF capacitors and you must solder them on the fix PCB board instead on their original place on the AVR controller PCB. As you can see I only retrieve the signal line and the ground from the old max232 socket.

    Regards, Thanos
  16. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    Here is the AVR Motion Controller v1.5 !!


    AVRmotioncontroller1_5pcb.gif


    [​IMG]AVRmotionsimulatorcontroller1_5.pdf (408.8 KB)

    And here is only the bottom side layout:

    [​IMG]avrmotionsimPCBbottom_only_1_5.pdf (99.49 KB)


    I fixed all issues on it including larger holes for easier insertion of some compoments along with various other minor designing issues. Serial communication should work fine in this version.


    Regards, Thanos
  17. RoVoR

    RoVoR New Member

    Joined:
    Sep 12, 2007
    Messages:
    19
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    Hi Thanos,

    I'm a real newbee/dummy in elektronics so forgive me asking.
    I guess the pcb - 1.5 version will be the final version that uses the ATmega8538. As you mentioned the new version will be equiped with the ATmega644.I want to start etching and building version 1.5 now, have you updated the parts list or should we add the above components to the parts list ourself?

    What are the benefits of using the ATmega644 over the ATmega8538?

    Anyway, lots of RESPEKT to you for sharing this awesome project with us.

    RoVoR
  18. tronicgr

    tronicgr

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

    Yes, you need the above list of compoments too... I'll update the part list to agree with v1.5 during weekend.

    The PCB v1.5 accepts both atmega8535 and atmega644 in the same socket. I will use Atmega644 a little later as for now atmega8535 can do the things we need.

    Some of the benefits of the Atmega644 is increased memory size and four high resolution PWM channels. And some other minor things not usefull to us.


    Regards, Thanos
  19. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    I fixed the list of parts that is used now on the v1.5 of the avr controller:

    [​IMG]AVRmotioncontrollerParts_v1_5.pdf (870.97 KB)

    [​IMG]AVRmotioncontrollerpartlist1_5.txt (1.6 KB)

    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)... atleast, this prize I buy them localy in Greece...

    Thanos
  20. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    I prepared the small fix board that solves the lack of reliable serial communication for the old versions of the avr controller (v1.3 & v1.4).

    [​IMG]


    I placed the compoments on a protoboard, following the layout that I given before. I used the long legs of some of the compoments to create the lines. As I was building it, I decided to cut the upper part the of layout and to use some wires to connect the signal from the serial port and the ground because I couldn't find proper distance holders, only some short ones. But is still it looks cool, and most important, it works fine now!



    [​IMG][​IMG][​IMG]

    [​IMG][​IMG]


    Can't wait to solder the new AVR motion controller v1.5 PCB that is perfect in all aspects!



    As all hardware problems seems to be solved its time to have some progress on the programming side too! Many features are waiting to be added on the AVR controller so please give me some feedback on the effectiveness of the first two beta firmwares, I've given, to set some standards and build over them. For now I'm adding HB-25 servo motor control (and all R/C compatible motor controllers, like i.e. the KT-5198), for uncoupled and coupled SimforceGt motion style.


    Regards, Thanos