This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sound when connecting liniair actuator on pypilot
#4
Hmm, can you point me in the right direction? Not sure which part of motor.ino I need to adjust for the khz, found this part but not sure:

  
Code:
  if(pwm_style == 1) {
        TCNT1 = 0x1fff;
        //Configure TIMER1
        TCCR1A=_BV(COM1A1)|_BV(WGM11);        //NON Inverted PWM
        TCCR1B=_BV(WGM13)|_BV(WGM12)|_BV(CS11); //PRESCALER=8 MODE 14(FAST PWM)
        ICR1=40000/DIV_CLOCK;  //fPWM=50Hz (Period = 20ms Standard).
        TIMSK1 = 0;
    } else if(pwm_style == 2) {
        TCNT1 = 0;
        TCCR1A=_BV(COM1A1)|_BV(WGM11);        //NON Inverted PWM
        TCCR1B=_BV(WGM13)|_BV(WGM12)|_BV(CS10); //PRESCALER=0 MODE 14(FAST PWM)

        // use 1khz safe at all speeds.   20khz is nice to avoid
        // audible sound, but you need to set minimum speed to 20-30%
        // or it will overheat the part at very low speeds.
        ICR1=16000/DIV_CLOCK;  //fPWM=1khz
        TIMSK1 = 0;
Reply


Messages In This Thread
RE: Sound when connecting liniair actuator on pypilot - by jamos.tan@gmail.com - 2020-03-25, 01:08 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)