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

Tronics AMC 4xPWM channels

Discussion in 'DIY Motion Simulator Projects' started by stowaway, Feb 17, 2012.

  1. stowaway

    stowaway New Member

    Joined:
    Mar 16, 2009
    Messages:
    213
    Location:
    Gold Coast - Australia
    Balance:
    1Coins
    Ratings:
    +0 / 0 / -0
    There is probably an simply solution for this, But how does Tronics AMC board have these features:
    - Motor 1,2 run on 9bit PWM on 23,47Khz (9bit = 512)
    - Motor 3,4 run on 8bit PWM on 23,47Khz (8bit =256)

    When the ATMEGA8535 only has 3 timers, 2 8-bit timers and 1 -16bit timer.

    wouldnt this mean it can only handle 4 PWM at 8bit?

    also is 8bit enough resolution? as my board will have to control 3 motors so with my current,very limited, understanding I will need to have 2 of the pwm channels runnign at 8pit.
  2. yobuddy

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

    Joined:
    Feb 9, 2007
    Messages:
    5,307
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    49,490Coins
    Ratings:
    +5,109 / 18 / -0
    Your only option at present is to run 2 AMC's for more motors.

    The AMC specs show that it technically could do all that is stated, but there got a point in the project where it no longer made sense to run 4 from one AMC.

    In order for the AMC to be able to handle 4 motors, it would run the 3rd and 4th motor in 8 bit as I remember and you loose the use on the LCD.

    Before that ever happened thou, X-Sim was changed to support multiple interfaces at the same time. So it made more sense to make it work the best it could with 2 motors and then use 2 AMC's if you want more motors.

    With that said, I’m sure thanos could produce a HEX for the AMC to be able to run 4 motors, but do you know how many people would send him My LCD is Not Working emails?
  3. stowaway

    stowaway New Member

    Joined:
    Mar 16, 2009
    Messages:
    213
    Location:
    Gold Coast - Australia
    Balance:
    1Coins
    Ratings:
    +0 / 0 / -0
    But due to the hardware limitations , how can it even run 2 9bit PWM's? unless its done in software and not hardware?

    there is only 1 16bit pwm available and 2 8bit PWM... ?
  4. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    Solution is simple!

    For 2 motors:
    - Motor 1,2 run on 9bit PWM on 23,47Khz (9bit = 512)

    For 4 motors:
    - Motor 1,2 run on 8bit PWM on 23,47Khz (8bit = 256)
    - Motor 3,4 run on 8bit PWM on 23,47Khz (8bit =256)

    If you studied the registers you would see that the 16bit timer consists of two channels... so to have them run in PWM 9bit mode you use an extra timer i.e. timer0 or both timer0 and timer2 for 10-bit resolution on timer1!!! Confusing?? :lol:

    And another thing, the resolution on the motors affect the points of acceleration to each direction, not the positioning resolution that depends on the potentiometer (is 10-bit or 1024positions). Using Quadrature encoders you can get even better positioning resolution like 16-bit or more...

    Thanos
  5. stowaway

    stowaway New Member

    Joined:
    Mar 16, 2009
    Messages:
    213
    Location:
    Gold Coast - Australia
    Balance:
    1Coins
    Ratings:
    +0 / 0 / -0
    Thanks for your response.

    I understand about the PWM controlling motor speeds not the positions...

    However is 255 different speeds enough speed control for efficient PID control? (Im assuming that 0 to 128 is forward and 128 to 255 is backwards or something like that? *haven looked into this yet.

    Or would you recommend having 2 AVR chips if I want to control 3 (or 4) motors for more efficent movement?
  6. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    Well... isn't 512 speed points enough? (for 8bit pwm, yes its 512 points)... theoretically anyway... You will have smaller available KP/KI/KD/ values to play with and less time to react to changes... Hmm you haven't done your homework... look closer how a PID works....

    Thanos
  7. stowaway

    stowaway New Member

    Joined:
    Mar 16, 2009
    Messages:
    213
    Location:
    Gold Coast - Australia
    Balance:
    1Coins
    Ratings:
    +0 / 0 / -0
    yeah, learning as i go :) .. im not sure how a bit pwm gets 512 points rather than 256 i'll keep researching.

    I thought i had an understanding of PID but ill go back to it.
  8. stowaway

    stowaway New Member

    Joined:
    Mar 16, 2009
    Messages:
    213
    Location:
    Gold Coast - Australia
    Balance:
    1Coins
    Ratings:
    +0 / 0 / -0
    OHHH... I think i get it..

    Becuase you have 1 pin for Direction (forward/backward) the PWM pin for speed.

    thats where the extra bit comes from? right?