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. 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 Download Package Now!
  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 here. Do not following these rules will lead to permanent exclusion from this website: Read the forum 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 to increase its standard poor 490Hz PWM up to 20kHz superman.gif

    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