how to control Hobby Servo through pwm?

Home Forums TinyG TinyG Support how to control Hobby Servo through pwm?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #6969
    tpp
    Member

    Hi,

    As I newbie in cnc machine diy.

    I searched lot but not able to find solution for my problem

    As i have synthetos tinyG v8.0 with four motor controller.

    I need to use dual motor settings for x , 1 for y and 1 for A rotary axis.

    So i dont have extra motor driver available on board to use for z axis up and down movement and again i can not use spindle/coolant on off pin for z axis because they are used for other purpose.

    So Can you please let me know
    how to use hobby servo with pwm?
    how to control degree movement of servo from Gcode or what will be the gcode for the same?
    What special configuration i have to do for doing such job?

    Your help is highly appreciated

    Waiting for your kind reply soon

    Thanks with the best regards!

    #6970
    cmcgrath5035
    Moderator

    Here are some items to think about, I have not implemented but would probably head down this path if trying myself. An underlying assumption is that you want to run ‘stock’ tinyG FW, rather than do massive tweaks to the internals.

    First, the way I read your statement

    …. i can not use spindle/coolant on off pin for z axis because they are used for other purpose.

    is that both the Spindle ON/OFF pin and the Coolant ON/OFF pin are used by other functions under Gcode control.
    Be aware that the pwm signal, intended to drive an external spindle driver, is logically connected to Spindle ON/OFF; e.g. Spindle ON – PWM active, Spindle OFF, PWM not active.

    Since you are needing to drive, with precision, a Z axis, I don’t see how a crude implementation via spindle on/off would work for you even if the PWM signal were logically available.

    I would suggest your best bet is to free up one of the Motor channels in tinyG, by driving your two X axis steppers from one channel, with one motor reversed by wiring it so. Two possible implementations:
    1. If NEMA 17 motors, it should be possible to drive two motors wired to one tinyG driver. This technique was used early on by experimenters building dual X machines but having only 3 drivers available, such as GRBL/Gshield. You might have to turn up the current pot on that channel. Be mindful of device cooling if you run it hard.
    2. A more robust method would be to pick off the Stepper driver signals ahead of the drivers (header on tinyG), perhaps buffer them (they are 3.3V logic) and use 2 external driver devices, one for each X motor. Several folks use external drivers for higher power steppers. A place to start might be to review Pololu individual drivers, there are many similar sub-assemblies available.

    TinyG schematics are available on GIThub.

    #6972
    tpp
    Member

    Thanks cmcgrath5035
    Regards!

    #6973
    jpistorino
    Member

    I had the same issue of needing dual axes and an orientation. Here is a link to the thread discussing this. https://www.synthetos.com/topics/networking-two-tinygs/ While I have not tried it yet, the solution of using J17 and external drivers seems like it should work.

    Regards,
    James

    #6974
    cmcgrath5035
    Moderator

    tpp
    The link provided by jpistorino is a good one to review as it touches several topics for you to consider. I’ll highlight a couple:

    First – you see comments relative to the limitations of the current tinyG hardware to processss complex 6 axis control. As the tinyG firmware has evolved, the limitations of the current underlying compute engine have become evident, requiring careful and coordinated firmware refinement. For this reason, I would not recommend attempting to tweak the tinyG code to implement anything additional.

    Second – You’ll see reference to G2, a current w.i.p. project that will likely be you best solution in a future time frame. Good to review for background. G2 may or may not be a viable path for you.
    Be aware that, among other issues still being worked, the Due platform does not has non-volatile storage on-board, so keeping settings up to date requires a bit of effort.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.