Giter Club home page Giter Club logo

libblrs's People

Contributors

baylessj avatar bottomnotch avatar edjubuh avatar hotelcalifornia avatar lachlan2k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libblrs's Issues

Issue in chassisTrueSpeed method

In the method (which is in chassis.c in the mtrmgr project), the return statement is return (cmd > 0 ? TrueSpeed[cmd] : (-1 * TrueSpeed[cmd]));. If cmd is less than 0, then returning (-1 * TrueSpeed[cmd])); would throw an exception since the index is less than 0.

Automatic updating of version in makefiles

It would be ideal to have the makefiles update automatically to reflect changes in the library's version on Github releases, as is currently done with the PROS kernel.

Motors get stuck with certain recalculate functions

I rewrote some of my code to include libmtrmgr, and noticed that my lift was moving incredibly slowly.
So I got my trusty LCD and printed out the values with motorGet, and noticed that the motor was only getting 29 power when it should've gone up to 127.

So here's the recalculate function I was using with a slew rate of 3.0:

int applyLinearMotor(int input) {
    static const unsigned int trueSpeed[128] =
    { 0,6,7,7,8,8,8,9,9,9,
    10,10,10,10,11,11,11,11,11,11,
    12,12,12,12,12,12,12,13,13,13,
    13,13,13,13,14,14,14,14,14,15,
    15,15,15,16,16,16,16,17,17,17,
    17,18,18,18,19,19,19,19,20,20,
    20,21,21,21,21,22,22,22,23,23,
    23,23,24,24,24,25,25,25,26,26,
    26,26,27,27,27,28,28,28,29,29,
    30,30,31,31,32,32,33,33,34,35,
    36,36,37,38,39,40,41,43,44,45,
    47,48,50,52,54,56,58,60,63,66,
    68,71,74,78,81,85,127,127 };

    int output = trueSpeed[abs(input)] * sgn(input);

    return output;
}

The reason this happens is that motorGet returns 29, it adds slewRate * dT = 3.0 * 20, which is 89, and the 89th value in my array also happens to be 29, so the output never increases. The same collision problem happens with a slew rate of 1.0. when it gets to 13. As 13 + 1.0*20 = 33, the 33rd index of my array is 13.

Demonstration here: http://tpcg.io/woTx2I

What I did to circumvent this (this is an imperfect solution), is I removed the recalculate on line 68

out = motor[i].recalculate(out);

And added the recalculate to line 133, as seen here:
https://i.imgur.com/wTmkNru.png

This way, the recalculation is done once, when you request the value.

However, this solution only gives you the advantage of linear speed control, the slewing is not linear.

I'm unsure of what the "perfect" fix would be to get a linear slew increase.
Hope this helped.

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.