Giter Site home page Giter Site logo

janelia-arduino / tmc429 Goto Github PK

View Code? Open in Web Editor NEW
31.0 6.0 8.0 3.54 MB

The Trinamic TMC429 is a triple-axis dedicated step and direction motion controller for both position and velocity control with acceleration and deceleration trapezoidal ramps.

License: Other

C++ 100.00%
trinamic stepper step direction controller motor stepper-controller stepper-motor

tmc429's Issues

Remove Streaming.h include from TMC429.h

Nothing in the TMC429 library itself requires the Streaming.h file to be included (only the examples use it). It would be nice to remove this dependency from the core library.

Can't specify spi bus

ESP32 has multiple spi busses but this library doesn't allow specifying which bus to use.

Possible solution: make all spi functions virtual and allow a subclass to override them.

Compatibility issue with Arduino portenta C33

Hello,

I am trying to use an arduino pro portenta c33 with 2 TMC429.

Currently i am only trying to get the TMC429 on a breakout board(specifically the TMC429-BOB https://www.analog.com/media/en/technical-documentation/user-guides/tmc429-bob-user-manual.pdf) to communicate with the C33.

I have a 16 MHz quartz oscillator for the CLK on the breakout board as well as all SPI pins connected correctly. The TMC429 is connected in the 3,3V operating mode.

When using the “TestConnection” example that comes with the library i get this:

23:47:02.466 -> communicating: 0
23:47:02.466 -> version: 801918
23:47:02.466 -> velocity_max_upper_limit: 406051
23:47:02.498 -> setLimitsInHz: 100, 100000, 40000
23:47:02.498 -> acceleration_max: 322341919
23:47:02.498 -> acceleration_max_upper_limit: 19
23:47:02.498 -> acceleration_actual: 0
23:47:02.498 -> velocity_min: 0
23:47:02.498 -> velocity_max: 0
23:47:02.498 -> set target_velocity: -50000
23:47:02.498 -> target_velocity: 812500
23:47:02.498 -> actual_velocity: 0
23:47:02.532 -> set target_position: 12345
23:47:02.532 -> set target_position: -8388608
23:47:02.532 -> actual_position: -8388608
23:47:02.532 -> at_target_position = 1
23:47:02.532 -> at_target_velocity = 0
23:47:02.532 -> After disabling, right switches enabled = 0
23:47:02.566 -> After enabling, right switches enabled = 0
23:47:02.566 -> After disabling, switch soft stop enabled = 0
23:47:02.603 -> After enabling, switch soft stop enabled = 0
23:47:02.603 -> After disabling, left switch stop enabled = 1
23:47:02.603 -> After enabling, left switch stop enabled = 1
23:47:02.603 -> After disabling, right switch stop enabled = 1
23:47:02.644 -> After enabling, right switch stop enabled = 1
23:47:02.644 -> left_switch_active = 1
23:47:02.644 -> right_switch_active = 1
23:47:02.644 -> latch_position_waiting: 0
23:47:02.644 -> latch_position: -8388608
23:47:02.644 -> status.at_target_position_0 = 0
23:47:02.644 -> status.switch_left_0 = 1
23:47:02.681 -> status.at_target_position_1 = 0
23:47:02.681 -> status.switch_left_1 = 0
23:47:02.681 -> status.at_target_position_2 = 0
23:47:02.681 -> status.switch_left_2 = 0

It is always the same and not changing. I tried the same setup with an Arduino mega (in 3,3V and 5V mode) and I got the expected result.

I tried a bunch of things both hardware and software. I reduced the SPI transfer speed in the library and used level shifter(and some more things) but I can't get it to work.

When trying to fix the problem i took pictures of the entire communication for the “communication sketch” (tmc429.communicating()).

This one is for the working Version on the arduino mega.

arduinomega(working)

and this one is a non-working exchange with C33.

c33(not working)

Yellow --> Chip Select
Green --> Serial Clock
Blue --> COPI (MOSI)
Red --> CIPO (MISO)

On a side note: on the bottom of the picture is the decoded SPI data. I could not get it to work for the C33 Version even with adjusting the thresholds. (Also sorry for the white background, i only noticed that afterwards)

Any ideas what else i could try. (i am still waiting for higher frequency oscillator).

"hold_mode" not working

Hello,

I am currently testing TMC429 and TMC4361A.

For the TMC4361A, I am using this library:
https://github.com/tommag/TMC4361_Arduino

In my application, i want to to set a constant speed and target position. This is possible with the "hold_mode" mode on both chips.

On the TMC4361 it is working very nicely with the library above, so I just set maxSpeed and targetPosition and the movement is performed.

I tried the same with the TMC429 library, but got no success. Hold_mode is not implemented, so I just added:

void TMC429::setHoldMode(size_t motor)
{
  setMode(motor,HOLD_MODE);
}

The main code is looking somehow like this:

void setup()
{

  tmc429.setup(CHIP_SELECT_PIN, CLOCK_FREQUENCY_MHZ);
  tmc429.initialize();
  tmc429.setHoldMode(MOTOR);
}

void loop()
{

  tmc429.setTargetVelocityInHz(MOTOR, 5000);
  tmc429.setMaxVelocity(MOTOR, 5000);
  tmc429.setTargetPosition(MOTOR, 5000);

}

But this will lead to no movement. With ramp_mode example, everything is working fine, so it is not a general issue with the setup.

Any idea what is misssing to make it run?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.