This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

want to run the two servo motor using nrf52832

Hi... folks .. i am using nRF52840 development kit , i need to control the two servo motor using ble commands . I need to control the angle and speed of two motors , suggest me how to archieve this ...i tried with pwm_library i can able to control the speed only and not the angle .  sugegest me an idea

Parents
  • What do you mean by "i tried with pwm_library i can able to control the speed only and not the angle ."? What observations have you made? Does the output of the PWM library not match what you'd expect, if so show us how it differs?

  • look , pwm_library example , i am using this function     APP_ERROR_CHECK(app_pwm_channel_duty_set(&PWM1, 1, value) to vary the speed . Now my question how to control the angle of the motor ? i need to set the motor at varies degree

  • That Is how you set the angle, you need to continuously vary the angle in order to control the speed. 

Reply Children
  • Yes I understood but I need accurate angle.. 

  • How accurate?

    Or did you mean higher resolution? If so you need to use the PWM peripheral, or create one with a TIMER and GPIOTE. 

  • Timer in the sense ? what do you mean ..can you explain me clearly .. and one more   (app_pwm_channel_duty_set ) in this function what is meant by channel ? what is difference between giving channel as 0 or 1 ..

  • A TIMER based PWM, by connecting a TIMER's COMPARE event to a GPIOTE's OUT task, you can create a PWM. You can search Devzone for implementation details as this question has been asked lots of times.

    app_pwm_channel_duty_set, the channel number is linked to a specific pin, each app_pwm instance can serve multiple outputs, given they share the same period. 

  • can you share some post related to that..timer based pwm .. i am finding very difficult to control the angle of the motor