petoi-camp-logo.png
Chinese
ZH
Chinese
ZH
English
EN
  • 主页

  • 论坛

  • Shop

  • 简介

  • 图鉴

  • 资源

    • Documentation Center
    • GitHub 源代码
    • 教程视频
    • NyBoard V0_1 手册
    • NyBoard V0_2 手册
    • Smartphone App
    • GitHub/CatMini
  • 社区

    • 成员
  • More

    Use tab to navigate through the menu items.
    Rafael Marín
    2 ngày trước

    Error moving joints simultaneously in Mobile app

    5
    0
    Tomi Ade
    5 ngày trước

    Trouble Uploading to Nyboard - stk500_recv(): programmer is not responding

    3
    0
    Phillip Brush
    8月09日

    On Definition Rule Issues

    4
    0
    若要查看作用方式,請前往您的即時網站。
    • 類別
    • 所有文章
    • 我的文章
    R T
    2021年4月04日

    Pin number of NyBoard

    在 Software

    I'm trying to input signals directly onto NyBoard, and I noticed there are 0 to 15 on the board. So I tried to write a simple code to test on a servo:


    #include <Servo.h>

    Servo panServo;

    int pos = 0;


    void setup() {

    panServo.attach(2); # test with pin 2

    Serial.begin(115200);

    }


    void loop() {

    panServo.write(pos);

    pos++;

    Serial.println(pos);

    delay(2000);

    }


    From the Arduino serial monitor, I can confirm my IDE is communicating with NyBoard, but there is no response from the Petoi servo when I connect it with pin 2 (I have tested the servos and they are not faulty). I have also confirmed I do not have the greg/black/white pins mixed up. What do I miss?

    3 則答覆0 則回覆
    0
    3 則留言
    Benoit FANCHON
    2021年4月12日
    最佳解答

    First, be sure tu use the battery, the USB doesn't deliver power to the motors.


    The servos aren't connected directly to the processor (the Atmel 32 chip), but to a multi-PWM driver (PCA9885 chip).

    If you think in terms of Arduino board, the motors aren't connected to the PWM pad of the Arduino (pins 9 /10 for UNO) but to a servo shield.


    So you can't use the Servo.h library, you have to use some dedicated library, such as Adafruit_PWMServoDriver.h which appears in the OpenCat sources.


    I don't know if this answer makes sense to you. It will depend on your background.

    I can elaborate more and/or write an example if you need.

    2
    R T
    2021年4月13日
    回覆

    Thank you Benoit, I managed to work around using PWM (instead of servo.h) by mimicking the original source code, now with your explanation it all makes sense!


    If I dig a bit deeper, I tried to find the lowest and highest PWM of the Petoi servos (lowest around 100 and highest around 600), until the horns do not move any further. For some reason, the horn range is around 270 degrees, which is not the usual 180 degrees of most servos, such that I have to scale down all my movements accordingly. Is it for the same "PWM driver" reason, or just the Petoi servos being different?

    按讚

    R
    Rongzhong Li
    2021年4月13日
    回覆

    @R T We customized the servos to have a wider range. And there's a PWM factor (=4) in the code. So the actual PWM range is about 400 to 2400.

    按讚
    3 則留言
    相似文章
    • nyboard v0
    • Nyboard schematic?
    • Need to order new NyBoard

    Pittsburgh, PA, USA | info@petoi.com 

    © 2019 Petoi LLC

    © 2019 Petoi LLC