Forum Rule: Always post complete source code & details to reproduce any issue!

Search:

Type: Posts; User: laptophead

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Actually that was it. The pulses vary based on...

    Actually that was it. The pulses vary based on single turn or multi turn...

    For multi turn, this is the correct formula, in case others need it

    long Enc_2 = Enc_Read_2;
    Mot_Ang_Read...
  2. The Bitshift

    I am reading this fancy encoder sending me a Hex string, see attach link from the manufacturer.
    http://dow.gyems.cn/RMD-servo%20motor%20control%20protocol%20(RS485%29%20V1.6.pdf

    I am trying to...
  3. Thanks a lot, I will try

    Thanks a lot, I will try
  4. Is "split" a valid command for a string?

    I does show in red in the IDE , so it does exists, but I get a
    'class String' has no member named 'split'

    Long story short, I am trying to extract values (Floats) from a string based on the...
  5. A[11]), was the mistake, thanks every one. ...

    A[11]), was the mistake, thanks every one.

    Embarrassingly simple, sorry for the trouble.

    Paul:
    For the future I will post more definitions and code. In this case the data comes from a motor...
  6. sprintf is not running correctly on my 3.6, Thanks.

    Greetings community,

    I just learned to use sprintf and what a blessing, I am saving on tone of code.

    Here is a function I am trying to simplify, lots of data, I included the "old way" and the...
  7. Paul, I figured it , thanks for your help. ...

    Paul,

    I figured it , thanks for your help.


    if (Serial1.available()) {

    uint8_t b = Serial1.read(); // always read the next incoming byte
    if (b == 0x3E) {
    num_received =...
  8. Paul Thanks so much, your advice makes a lot of...

    Paul
    Thanks so much, your advice makes a lot of sense.

    I implemented your code and I am doing a printout. I used a flipping bool in order to print just once


    if (Serial1.available()) {
    ...
  9. VJ I implemented the uint16_t...

    VJ
    I implemented the
    uint16_t data_checksum_temp = 0;

    But still no reading from the last if,
    By the way, I am running at (115200). Is that relevant?

    We still have a bug?
  10. VJ Thanks a lot, so elaborate... So I tried...

    VJ
    Thanks a lot, so elaborate...

    So I tried to put it to work:


    while (Serial1.available()){
    uint8_t head = Serial1.read(); //Read one byte
    uint8_t command;
    uint8_t id;
  11. Still, How do I solve my problem? How to I...

    Still, How do I solve my problem?
    How to I receive transmissions of various lengths?

    I tried just receiving the first 7 bytes. Worked fine for the first transmission , then the second...
  12. Pete, I have a lot more than seven bytes in my...

    Pete,

    I have a lot more than seven bytes in my example, so is the fourth byte accurate? I don't see how.

    So what to do?
    read the 4 bytes always, and then how do I read the remaining bytes?
  13. thanks everyone, Changing the while to if did...

    thanks everyone,

    Changing the while to if did not work.

    The motor data sheet is at
    http://dow.gyems.cn/RMD-servo%20motor%20control%20protocol%20(RS485%29%20V1.6.pdf

    Here is a sample...
  14. How to read bytes transmissions of various lengths ?

    Using Teensy 3.5 Serial1. Are all the Serial ports buffered? Is there an advantage in using 1,2.3 or another?

    I am talking to motor with a built in encoder. I am sending commands and the motor...
  15. Kurt Thanks a lot. About Serial4 writing out, I...

    Kurt
    Thanks a lot. About Serial4 writing out, I reduced the size of the string I am sending, and I think is not blocking anymore.
    I don't see the blockage on the scope like before.
    However, it...
  16. Thank you everyone, Me writing a new library...

    Thank you everyone,

    Me writing a new library for Roboclaw? Way beyond my abilities.
    I will have to live with it. Would implementing the new teensy 4.0 help? Probably not.


    Second issue:...
  17. Kurt, Thanks for the detailed explanation. ...

    Kurt,
    Thanks for the detailed explanation.
    I think this is as good as it gets. I can call the read every 10 ms and that means I refresh 100 times a sec.
    I heard that a guided mislle...
  18. Thanks for the reply, Yes the roboclaw is now...

    Thanks for the reply,

    Yes the roboclaw is now basic micro
    https://www.basicmicro.com/downloads

    Yes, I am sending commands to be finished by the controller, but I have to know when they are...
  19. Is Teensy Blocking during Serial communication?

    I am using a 3.5 to run a robotic arm, 6 points of inflection, controlled by 3 DC motor controller with Quadrature encoders.

    It is essential to read the encoders all the time, so I know my XYZ...
  20. Replies
    2
    Views
    132

    Yes, that worked easily Thanks a lot Mitch

    Yes, that worked easily

    Thanks a lot
    Mitch
  21. Replies
    2
    Views
    132

    Can my Teensy 3.5 come back to life?

    I unplugged the USB in the middle of a long sketch upload. I had to.
    The teensy is running a robot arm and it went berserk...

    After recovery, the Teensy USB port is not even seen on my Mac

    On...
  22. Thanks a lot, I wish the Arduino website was...

    Thanks a lot, I wish the Arduino website was correct,

    The show:
    Example Code
    int a = 50;
    int b = 10;
    int c = 0;
    c = a / b; // the variable 'c' gets a value of 5 after this statement is...
  23. This is embarrassing, but I can't do division ?!?!

    according to Arduino website 2 integers can be divided.

    So I tried

    int a =33;
    int b =55;


    void setup() {
  24. Replies
    5
    Views
    206

    Thanks everyone fmod worked really nice ...

    Thanks everyone
    fmod worked really nice

    new_Th= fmod (new_Th,90); // first is the Number and second is the Factor

    I did not have to ad any library, just added

    #include "math.h". at the...
  25. Replies
    5
    Views
    206

    I defined them as doubles, but was impossible to...

    I defined them as doubles, but was impossible to convert from string.

    I also tried define them as Floats, but the modulo operand did not work.

    TNKS
  26. Replies
    5
    Views
    206

    String toDouble not working on Teensy?

    Is that true?

    I tried newX = newX_St.toDouble(); and I got a "No class member toDouble"

    Too bad I need the precision,

    I tried the next best thing, ToFloat and it works.
    BUT:

    I can...
  27. Replies
    9
    Views
    2,021

    Paul, Please I still need your help

    While using the TimeLib, I built a equation to transform the current time in elapsed seconds.

    ElapsedSeconds = (hour() * 3600) + (minute() * 60) + (second());

    I never get past 24 hrs. The...
  28. Replies
    9
    Views
    2,021

    is working on any arduino, I was...

    <TimeLib.h> is working on any arduino, I was hoping to get some help here.
    I am a fan of Teensy and I use it any time I can, but this TFT requires Mega.
    This forum generally provides much...
  29. Replies
    9
    Views
    2,021

    Monseur Ingineur, Merci beaucoup, However I...

    Monseur Ingineur,

    Merci beaucoup,

    However I am running all this on a Mega . The TFT plugs easily on a mega.

    IntervalTimer myTick; does not compile. Any ideas?

    to tell you more of...
  30. Replies
    9
    Views
    2,021

    Trying to customise

    I am putting together a downtime tracking device for an industrial application.

    THe time is arbitrary and it starts with the reset button or powering up. TimeLib.h does a nice job to avoid...
  31. It is me again. After re-booting a couple of...

    It is me again.
    After re-booting a couple of times and using a different USB cable, the problem went away.

    The correct port shows, and it uploads and Serial Prints fine...

    Go figure

    Thanks
  32. Sierra10.12.6 and Arduino IDE 1.8.4 do not alow for teensy USB port connection

    I just upgraded to sierra, but I am an experienced teensy user. I installed the Teensyduino 1.4 and it went well.

    on the bottom of the IDE screen it sees the Teensy, on COM 1, that is weird (This...
  33. Replies
    2
    Views
    580

    Yes, that worked, thank you.

    I was keeping that if for later, never realized it hang the system.
  34. Replies
    2
    Views
    580

    Java out of memory error, please help

    Here is the whole message;
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space...
  35. Never mind, we got results

    I figured my PIDs were backwards in relation to the encoder output... etc
    I got it to work and is still rough, but it looks great, the difference between them is small -about 150 pulses, you can...
  36. Getting no Output from the PIDs

    I adapted the code to my controllers, but something is wrong.

    I attached the sketch.

    This is what I get on the serial:

    micros E_master E_slave Sp_master Sp_slave
    612968 0 0 0 0...
  37. Hope you get an arm too

    To buy an an arm like that look on ebay for Movemaster rm-501. They come maybe 3-4 a year, a complete system with controller in working order costs about 4000 USD. A broken arm "as is" can be found...
  38. The graphs look really good, can you post the new...

    The graphs look really good, can you post the new code?
    You talk a lot about speed settings but we never done this before.
    We always shot for the target number of pulses and the speed was decided...
  39. This looks very promising, I will try it on Mon. ...

    This looks very promising, I will try it on Mon. Thanks for the nice work, it's better than synchronizing the speed, I think.

    I see is not perfect, but I think the original Mitsubishi is not...
  40. Luni, I played with it yesterday, tried that...

    Luni,
    I played with it yesterday, tried that too. Yes I could come closer to the desired effect, but I dont see it as a long term solution.
    The middle gear will be connected to a grip, small hand,...
  41. I made a little film of how the gears work

    https://youtu.be/Os7oF7q0fG8

    Thanks
  42. Help with the code!

    Regarding
    Do you really need to REGULATE the speed? Couldn't you simply disable the PIDs, set the speed of both motors to the desired value, and enable the PIDs if you reached the target position? ...
  43. Can I measure 2 frequencies at the same time? (On 2 pins?) Teensy 3.5

    I have to control 2 DC motors with quadrature encoders. I must maintain similar speed on both for number of pulses in order for my application to work. For pulse count I used Encoder.h and worked...
  44. Luni, thanks for the help,

    I attached the file I am using. I still get jumpy readings, but the PIDs seem to respond well. I think is the serial monitor that is not keeping up, or is slowing the processor.

    I think your...
  45. Signal is good

    The signal from the encoders is fine. If the PIDs are not working and I move the arm by hand, all readings are there. I used the scope. The reason that some encoders are acurate is because they...
  46. The Zero procedure worked, but I still have bad readings when 4 PIDs are working

    Here is a sample, see how the numbers skip?

    This does not happen if I just run your reading sketch and I just move the arm by hand...

    You can see the PIDs in the original sketch, they dont...
  47. Luni, So nice of you to write the code, it...

    Luni,

    So nice of you to write the code, it works for all encoders. Viellen Danke ( I lived in Osterreich for a year.)
    However we got a problem. I need to Zero the encoders at startup. The old...
  48. Thanks for the advice, the highest count rate is...

    Thanks for the advice, the highest count rate is 42000, not too big. I tried the AltEncoder.h library from you -(luni) but I have a hard time with the conversion of his encoder values to integers....
  49. Can a teensy 3.5 handle 5 encoders and 5 PIDs?

    I am powering a robotic arm with 5 points of inflections, all feed back by encoders.
    Moving 2 axis at the same time still works good, but when I ad the 3rd and fourth, the PIDs overshoot.

    I...
  50. Sorry, but this is just too hard. I got an HC-06...

    Sorry, but this is just too hard. I got an HC-06 bluetooth module and connected it to Serial1 on the Teensy and the laptop, it works!

    Love this article here:...
Results 1 to 50 of 77
Page 1 of 2 1 2