Giter Club home page Giter Club logo

Comments (6)

wakass avatar wakass commented on July 17, 2024

This could be related to the pwm_autoscale being disabled on enableStallguard. I created an issue on this: terjeio/Trinamic-library#6
Would be good to get some confirmation.

from plugins_motor.

troth530 avatar troth530 commented on July 17, 2024

@wakass, that helps part of the issue (I believe). Thank you!

Still not sure about units, I also notice there are raw values being read, but not sure what is being written. I still believe unit consistency should be required for trinamic internal algorithms at least for this condition of this comparison tcoolthrs < tstep < tpwmthres.

from plugins_motor.

wakass avatar wakass commented on July 17, 2024

@troth530 Regarding your first question, first keep in mind that tpwm threshold is the threshold where pwm-mode/stealthchop is operational (TSTEP ≥ TPWMTHRS), i.e. velocity_step < velocity_tpwmthrs. Above the velocity_tpwmthrs, spreadcycle is enabled (and pwm regulation disabled). In that regards, a 'desired' velocity as you mention

TPWMTHRS from the 2209 datasheet is the TSTEP at the desired velocity

is correct, but the desired velocity will likely not be the velocity at which you will be driving. It needs to be set a-priori to where you expect the pwm regulation of stealthchop to not be reliable. Anyway, i'm being a little pedantic here.

The trinamic plugin sets the tpwm_threshold also in the code below, which I think gets run after initialization. But i'm not too sure about that, you can put some debug output lines to make sure. In that sense I think the code that is giving you the error can be removed entirely. Do note that the same threshold velocity is set for all axes.

stepper[motor]->set_tpwmthrs(motor, (float)PWM_THRESHOLD_VELOCITY / 60.0f, steps_per_mm[idx]);

Conversion from speed to time step is achieved here:
https://github.com/terjeio/Trinamic-library/blob/9eae92beab071f00d188f9da25672ab9f2aaa116/tmc2209.c#L190

M122 also gives debug output on tpwm btw.

from plugins_motor.

troth530 avatar troth530 commented on July 17, 2024

@wakass can you provide more details about M122 debug output, what is the syntax?
So far I have confirmed pmw_autoscale fixes the stallguard issues- great find. I still need to confirm hybrid behavior.
Thank you!

from plugins_motor.

wakass avatar wakass commented on July 17, 2024

See this issue here for output from M122, grblHAL/RP2040#41 (comment)

Note the pwm section with the threshold and mm/s setting. This should give you an idea.

Syntax for M122 is described in this very repository: https://github.com/grblHAL/Plugins_motor

from plugins_motor.

troth530 avatar troth530 commented on July 17, 2024

Sensorless homing is fixed with re-enabling pwm_autoscale.
Hybrid mode is fixed adding float steps_per_mm; to struct in motor_settings_t in motors/trinamic.h

from plugins_motor.

Related Issues (11)

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.