1. You must be a registered member to be able to access this page and to download game plugins. Please register here. It´s for free.
  2. 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
  3. 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!
  4. 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
  5. 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
RacingMat

Ultrasonic PWM with Arduino 1.0

generate silent 20kHz PWM

  1. RacingMat
    Some Hbridge can accept up to 20KHz PWM:
    because these ultrasonic frequencies are inaudible, you don't hear anymore the humming sound of your motor at low speed.

    This code allow the Arduino UNO/Nano to increase its standard poor 490Hz PWM up to 20kHz superman.gif

    The code has to be adapted if you're using MEGA board for instance.
    pin pwn.jpg


    Check the datasheet of your Hbridge if it can accept ultrasonic PWM.
    - For example VNH2SP30 chip can do this (but is limited to 16V) like Motomonster.
    - Unfortunatly, 36V VNH3SP30 chip cannot reach 20kHz PWM

    Hear the difference:


    Some more information brought by Pipis2015
    thanks for this feedback !

    If you want to use Pololu_Dual_VNH5019 stacked onto the Arduino:
    you only need to change

    ultrasonic code:
    Code:
    int inApin[2] = {
    7, 4}; // INA: Clockwise input
    int inBpin[2] = {
    8, 5}; // INB: Counter-clockwise input
    
    into this:
    Code:
    int inApin[2] = {
    2, 7}; // INA: Clockwise input
    int inBpin[2] = {
    4, 8}; // INB: Counter-clockwise input