Welcome to OpenBuilds Community

Signup today and join in on the fun!

Sign Up

TinyG (v8) and PWM ESC Control

Discussion in 'Controller Boards' started by Lee Saferite, Jun 25, 2014 at 9:38 AM.

  1. Lee Saferite

    Lee Saferite Well-Known Builder

  2. dddman

    dddman Journeyman Builder

    Don't forget that you'll have to arm your esc to be able to drive your motor.
  3. Lee Saferite

    Lee Saferite Well-Known Builder

    Dang. Good point. Likely I'll have to send them a pull request for that feature (luckily I'm a programmer with embedded experience). Seems like an oversight in the code.
  4. Lee Saferite

    Lee Saferite Well-Known Builder

    Actually, thinking about it, I can just send an M3 with the max RPM followed by an M5 right? As the ESC init only happens during power up, it'll be like the homing sequence and only done once on startup.
  5. dddman

    dddman Journeyman Builder

    It depends on what you ESC wants... I don't know if they all want the same thing... Here is the code I use for my arduino to arm it (found on youtube actually):

    here is the link to download the code: https://www.sendspace.com/file/jrtfu0

    void initialize_motor()
    {
    Serial.print("Arming the motor! \n");
    delay(3000);
    Serial.print("Setting low speed! \n");
    myMotorBR.write(5);
    delay(4000);

    Serial.print("Setting high speed! \n");
    myMotorBR.write(180);
    delay(4000);


    myMotorBR.write(10);
    Serial.print("MOTOR IS READY! \n");
    delay(2000);
  6. Lee Saferite

    Lee Saferite Well-Known Builder

    Every ESC I've ever used has the same power on calibration sequence. The quad copter board I use can calibrate all of my ESCs at once knowing this. So, I think I can write some Gcode to calibrate the ESC. I'll hopefully let you guys know after the weekend.

    Thanks for the reminder in any case. :)
  7. Tweakie

    Tweakie OpenBuilds Team Staff Member Builder

    I don't know if this is of any help to you http://openbuilds.com/builds/software-speed-control-of-a-brushless-dc-bldc-motor-from-mach3.762/

    Tweakie.
  8. Lee Saferite

    Lee Saferite Well-Known Builder

    Yeah, I saw that build, but the TinyG has the ability to control the PWM output pulse size/duration with enough control to run a servo/ESC directly. The only issue I see is the one mentioned above about calibrating the low/high range for the ESC on startup.

    The TinyG phase low/high controls the min/max pulse width. That is used in conjunction with the speed low/high and the M3 value to set the pulse width. So, unlike a 0-100% PWM signal, this is able to generate the exact pulses needed. Or so it seems. :)

    I do like your board in that you can manually control the speed though.

Share This Page