Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 13 of 13

Thread: ClearPath - Teknic servos

  1. #1
    Senior Member
    Join Date
    Jan 2013
    Location
    Brisbane Australia
    Posts
    104

    ClearPath - Teknic servos

    Hi

    I am looking at using the ClearPath - Teknic servos on a project. At the moment I use a Sangiuolo to run our steppers. I would like to use a Teensy to run the servos because of the higher CPU clock speed.

    I downloaded Teensyduino 1.41 and installed it in Arduino 1.8.5
    I installed the ClearPath library. Here is a link to the zip file
    https://www.dropbox.com/s/f86fn3bscr...epGen.zip?dl=0

    Here is a link to their github
    https://github.com/Teknic-ClearPath


    When I compile I get the following error with Teensyduino
    I get the same for all the Teensy boards except Teensy++ 2.0. Teensy 2.0 has even more failures
    C:\Users\xxx\OneDrive\Documents\Arduino\libraries\ ClearPathStepGen\ClearPathStepGen.cpp:55:4: error: expected constructor, destructor, or type conversion before '(' token

    ISR(TIMER2_COMPA_vect)

    ^

    Error compiling for board Teensy 3.6.






    When I compile it with Arduino 1.8.5 for Arduino Uno WIFI that has not been patched with Teensyduino it doesn't give any errors
    Build options changed, rebuilding all
    Archiving built core (caching) in: C:\Users\xxx\AppData\Local\Temp\arduino_cache_7349 12\core\core_arduino_avr_unowifi_e8a08f31ef0f32d5a 2a2bcdf8022c9b6.a
    Sketch uses 5024 bytes (15%) of program storage space. Maximum is 32256 bytes.
    Global variables use 333 bytes (16%) of dynamic memory, leaving 1715 bytes for local variables. Maximum is 2048 bytes.

  2. #2
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    9,417
    Teensy 3.x are ARM chips which work very different from AVR. This library is not compatible and needs adjustments to work with Teensy 3.x

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,222
    Quote Originally Posted by taskman View Post
    Here is a link to their github
    https://github.com/Teknic-ClearPath
    When I click this link it shows me 6 different libraries. Which one are you using?

  4. #4
    Senior Member
    Join Date
    Jan 2013
    Location
    Brisbane Australia
    Posts
    104
    Quote Originally Posted by PaulStoffregen View Post
    When I click this link it shows me 6 different libraries. Which one are you using?
    Sorry about that. I am looking at using this one

    https://github.com/Teknic-ClearPath/...earPathStepGen

  5. #5
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,222
    Looked at the library code. It seems to just use timer2 to generate interrupts at 2kHz rate, which is pretty easy to replace with IntervalTimer. It also directly accesses PORTB.

    Here's a quick (untested) attempt to replace the timer stuff with IntervalTimer and PORTB access with digitalWriteFast().

    https://github.com/PaulStoffregen/Cl...-And-Direction

  6. #6
    Senior Member
    Join Date
    Jan 2013
    Location
    Brisbane Australia
    Posts
    104
    Thank you for that. I will have a look at it this week.

  7. #7
    Hello askman.
    Have you tried Paul's library? Did it work for you?
    Thanks.

  8. #8
    Senior Member
    Join Date
    Jan 2013
    Location
    Brisbane Australia
    Posts
    104
    Hi

    I decided to go to the full Teknic setup so that I have fewer variables to worry about.

    Controller, power supply and cables. It does mean the servo upgrade will have to cost a bit but I will figure out how to add it into the current pricing of the machines. I will see how I can use my 12V power supplies vs their 75V on our cheaper machines maybe.

    I can now replace the following on my machine
    3 controllers (master controller, wiper, accessories)
    12 nuts and bolts for the controllers
    5 fans and 20 nuts and bolts for fans
    3 Controller covers and 12 nuts and bolts
    H bridge and 4 nuts and bolts

    It is worth it for me to pay $100 for the single controller because 3 x Sanguinololu or 3 x Teensy or 3 x Arduino Megas will cost me about the same + a cost of $0.5 per minute that assembly costs me + powder coated steel plates to cover the controllers.

    You can see the prints here.
    https://www.instagram.com/reel/CHcos...d=lepozlu7qqdc

    Everything from the Hulkbuster suit and on was printed with Clearpath at 25 micron Z. Very accurate. No need to activate Z axis compensation like I have to do with a stepper. I am within 50 micron Z and 25 micron XY of the STL.

    I printed a frame for glasses for a customer in 36 minutes vs her machine at 14 hours. No missed steps. No overheating.

    I am looking at changing all my machines to Teknic. Less assembly time, works first time, no messing around.

  9. #9
    The video looks very interesting. Good job !

    Am i right to assume that Paul's teensy version of the original ClearPath Arduino Step+Dir library was used in your setup?
    Just wondering how easy it was to move from Arduino to Teensy.
    I usually use the teensy 3.2 for my projects and would hope to also do it for the ClearPath SD project.

    Thank you.
    Stephan.

  10. #10
    Senior Member
    Join Date
    Jan 2013
    Location
    Brisbane Australia
    Posts
    104
    Thank you

    No I used all the Teknic components. So their controller
    https://www.teknic.com/products/io-motion-controller/

    I had to rewrite the whole controller code. At the moment I only needed Z so it wasn't too difficult.

    I think you can get a 30 day return if you use Clearcore to see if you can convert the code. Their pins are completely different and also the way to activate the servo is completely different than a stepper.

  11. #11
    I am using the ClearPath SD motor (step direction) and had it working well with an Arduino Uno and this Arduino Library

    I now moved over to the teensy3.2 and had to make a few changes to get the motor moving.
    A:
    comment out all digitalWriteFast call but pin 11 (step pin)
    https://github.com/PaulStoffregen/Cl...epGen.cpp#L124
    B:
    change `myTimer.begin(isr, (float)(time + 1) * 2e-6);` here: https://github.com/PaulStoffregen/Cl...epGen.cpp#L356
    I think (float)(time + 1) * 2e-6 translates to 0.0005micro = 2kHz ?
    But this seems way too fast.
    Anything lower than 700 prevents the library from functioning. `myTimer.begin(isr,800);`

    Any idea why?
    Thanks for any advice.

  12. #12
    The ClearPath-MSP monitor app does report "step input timing error".

    I found these points here:

    A step input timing error in a ClearPath motor is caused when the motor detects electrical noise on the step input. Generally this error is caused by one of the following:

    -The controller is outputting less than 4VDC and is unable to reliably turn on the ClearPath motor's optically isolated input.

    -The controller uses open collector outputs and the resistor specified in the ClearPath manual (link) is not installed correctly. Generally this will only affect machines with cable runs longer than 10ft, however, in applications with a large amount of electrical noise (such as plasma cutting applications), the resistors may be needed on shorter cable runs. The Acorn uses 24VDC open collector outputs, so 10Kohm resistors across the Step outputs and Direction outputs would be appropriate.

    -The Controller's maximum step pulse frequency is higher than 700kHz or the minimum step pulse time is less than 715 nS (link). These settings are typically configurable in the controller.


    - My cable is about 10 feet, so pretty long, but it did work with an Arduino Uno and slower intervalTimer intervals.
    - maybe the direction pin (which is not set inside the ISR) and the step pin (which IS set inside the isr() ) are out of sync at higher HZ?
    - I am taking the 5V to my SN74ABT125N from the teensy Vin, which comes from my computer. Maybe that's too low for higher HZ?

  13. #13
    Removing this cil() and the related sei()
    https://github.com/PaulStoffregen/Cl...tepGen.cpp#L65

    But reading about the purpose of cil() and sei() here makes we worried about not using them. Especially since I am still planning to add RS484 serial communication to the firmware.

    FYI:
    Code:
    myTimer.begin(isr,200);
    works and moves the motor much faster than using the Arduino Uno.
    Code:
    myTimer.begin(isr,10);
    causes a "Tracking error limit" as shown by the ClearPath-MSP monitor app.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •