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

Search:

Type: Posts; User: luni

Page 1 of 9 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    14
    Views
    114

    Yes. BTW there is no such thing as a 1M baudrate...

    Yes. BTW there is no such thing as a 1M baudrate for the USB Serial. It will always transmit with the full USB speed.

    Here a (very) basic example how to read serial data from the Teensy in c#

    ...
  2. Replies
    14
    Views
    114

    As promised, a minimal example which compiles and...

    As promised, a minimal example which compiles and works. The Teensy firmware repeatedly sends a raw hid frame where the first byte contains a counter to the PC. The PC software waits until it...
  3. Replies
    14
    Views
    114

    HID is limited to 64kB /s. 5x32bit @ 10kHz gives...

    HID is limited to 64kB /s. 5x32bit @ 10kHz gives 200kB/s that is going to be difficult :-)
  4. Replies
    14
    Views
    114

    Never had any latency problems with Serial and c#...

    Never had any latency problems with Serial and c# but that of course depends on the requirements. However, I'm not sure if HID will be better (latency is probably more a USB problem).
    Anyway, never...
  5. Replies
    14
    Views
    114

    Do you want to send the data via Serial or via...

    Do you want to send the data via Serial or via HID?
  6. Replies
    3
    Views
    133

    I'm using a Segger JTag Edu and just ordered a...

    I'm using a Segger JTag Edu and just ordered a JTag-Mini (for ~$20). This works great for Teensy debugging especially with vscode which has a supporting extension (Cortex-Debug) . However, you...
  7. Replies
    10
    Views
    177

    Are you sure that you need to filter that spikes?...

    Are you sure that you need to filter that spikes? The algorithm (and probably any other quadrature algorithm) should be immune to those and should just ignore it.
    I used the algorithm from this...
  8. Replies
    10
    Views
    177

    Glad it works so far. I don't know all common...

    Glad it works so far. I don't know all common libs of course but since there are 4 intervalTimers available it is not likely that all are used by other libraries.



    The sampling period is...
  9. Replies
    10
    Views
    177

    I usually prefer a sampling scheme instead of...

    I usually prefer a sampling scheme instead of using interrupts for high speed encoders. Here a thread with more info showing how to do that for 6 encoders. ...
  10. It of course depends on what "control four...

    It of course depends on what "control four brushed DC motors" actually means, at what speed (step frequency) you need to move your stepper and what else you plan to do with the Teensy. But, I'm quite...
  11. For the LEDs I'd use a driver like the TLC5947...

    For the LEDs I'd use a driver like the TLC5947 (24 PWM channels, SPI) here a breakout board: https://www.adafruit.com/product/1429 There are lot of others as well, just look for multichannel led...
  12. Sorry, forget #2, I didn't notice that you...

    Sorry, forget #2, I didn't notice that you actually did reserve channel 0 and channel 4.
    Can't test it right now but it seems to be the following problem:

    When pulse is true you trigger channel...
  13. In your callbackA you trigger channel 4? You only...

    In your callbackA you trigger channel 4? You only assigned two channels. There is an example showing how to handle more than one channel.
    Btw. You can directly trigger the channel from your pin...
  14. Im currently on a vacation bicycle trip. Hard to...

    Im currently on a vacation bicycle trip. Hard to explain on the mobile. Basically you record the time for different number of loops. Draw a loops Vs time graph in any spread sheet app or manually....
  15. I can confirm that. Since they are so cheap I...

    I can confirm that. Since they are so cheap I sometimes mount them together with a small hub in the device enclosure and connect them to a few debug pins. Very convenient during development...
  16. I added a DigitalWrite(3, HIGH) at the beginning...

    I added a DigitalWrite(3, HIGH) at the beginning of the ISR and a DigitalWrite(3, LOW) at the end and used a cheap LA to measure the duration of the resulting peak on pin 3 for various iteration...
  17. I did a quick measurement and got some 50ns for a...

    I did a quick measurement and got some 50ns for a constant DigitalWriteFast and some 80ns with variable pin number.
    Instead of using DigitalReadFast with variable pins from an array you can also...
  18. Just an untested idea: can it be that reading the...

    Just an untested idea: can it be that reading the 16 lines with variable pin numbers simply takes too long, so that the interrupt will be called again immediately after it finishes? (It is much...
  19. Yes that looks OK. Remark: When you are...

    Yes that looks OK.

    Remark: When you are unsure it is always good to add the units to the calculation. You can then easily spot errors.


    (11000 stp/sec) / (2.5 stp/mm) = 4400 mm/sec
    (4400...
  20. I can recommend Octopart (a meta search machine)....

    I can recommend Octopart (a meta search machine). It has a very good search engine and you can easily select distributors. Personally, I often buy at TME. The link below shows TME and Farnell as an...
  21. This should do what you want: #include...

    This should do what you want:



    #include "TeensyStep.h"

    // since you know how to transform from mm to steps we can as well
    // assume that 1 step = 1mm

    int s = 6000; // total...
  22. I can give you a more detailed answer later today...

    I can give you a more detailed answer later today but I think all you need to do is calculate the acceleration you need for your movement.

    Standard kinematic formulas are (out of my head without...
  23. Try adding a pull down resistor, say 4k7 to the...

    Try adding a pull down resistor, say 4k7 to the pin. During the upload the Teensy pin will float which might generate the observed effect.
  24. Thanks again for finding all those bugs! Very...

    Thanks again for finding all those bugs! Very helpful indeed.
    It might be easier to continue this discussion on GitHub. I opened an issue here: https://github.com/luni64/TeensyStep/issues/47
  25. I tried this but it seems to work as it should....

    I tried this but it seems to work as it should. Here the LA output. (The peaks shown in the third trace are generated directly after the stop commands)

    16619


    This is already fixed in the...
  26. Replies
    3
    Views
    191

    Yes it does. To be precise each controller...

    Yes it does. To be precise each controller requires its own timer. But as Theremingenieur pointed out, there are 4 of them. So if you use less than 4 TeensyStep controllers you'll have spare interval...
  27. Replies
    5
    Views
    340

    Just installed the May update (0.23.0) of the...

    Just installed the May update (0.23.0) of the c/c++ extension which seems to fix a lot of the intellisense issues. At least for me it now reliably finds the headers. However, I'm not using...
  28. I did some experiments on your problem and came...

    I did some experiments on your problem and came up with a quite simple and obvious solution. The only reason why the number of controllers was limited to a total number of 4 was that each controller...
  29. index() is defined as a function in string.h....

    index() is defined as a function in string.h. This function seems to be deprecated but it looks like the ARM compiler used for Teensy 3 still implements it. I assume that the AVR compiler for...
  30. Replies
    8
    Views
    380

    For a quick check you can also use the compiler...

    For a quick check you can also use the compiler explorer:

    https://godbolt.org/z/gmpL_J

    I like how the compiler implements bad() :-)
  31. This is fixed now! The problem only occurred when...

    This is fixed now! The problem only occurred when using default speed settings and not calling setMaxSpeed. Now it should work correctly for default values as well. Thanks for spotting that one.

    ...
  32. Technically this is trivial, just declare the...

    Technically this is trivial, just declare the pointer to the controller in global space. But beware, this can very quickly lead to a complete mess. Usually you try not to pass responsibility for...
  33. Yes, but you should never directly call a...

    Yes, but you should never directly call a destructor. (https://isocpp.org/wiki/faq/dtors#dont-call-dtor-on-local).
    Basically, you have two options.


    Dynamically create the object on the heap...
  34. Sorry, that can't work. You generated the...

    Sorry, that can't work. You generated the controller objects on the stack of Setup(). Thus, they automatically will be (and need to be) destructed before Setup is left and the allocated stack on...
  35. Thanks again! I fixed this and uploaded. Looks...

    Thanks again! I fixed this and uploaded. Looks like it got lost during one of the merges. Should work now.
  36. Replies
    76
    Views
    8,157

    I just released version 2 of TeensyStep on GitHub...

    I just released version 2 of TeensyStep on GitHub

    New features:

    Improved rotational mode
    Possibility to override speed and acceleration of a group of motors on the fly (rotational mode...
  37. Thanks a lot for testing, I think it finally is...

    Thanks a lot for testing, I think it finally is time to merge the development branch into master.
  38. That should be fixed now, can you give it a try?

    That should be fixed now, can you give it a try?
  39. The bug is in the development branch right? I did...

    The bug is in the development branch right? I did a lot of work on the new RotateController recently, looks like the new StepController needs some attention as well. I'll have a look tomorrow.
  40. That's really cool! If you need somebody to...

    That's really cool! If you need somebody to outsource series production to, let me know :-)

    I'll add that to the application page if you don't mind.
  41. I meanwhile summarized this development as an...

    I meanwhile summarized this development as an application on the TeensyStep Hompage https://luni64.github.io/TeensyStep/applications/winder/
    @jpk: I'm not a violin string winder at all. I hope I...
  42. The sequence of overriding acceleration and speed...

    The sequence of overriding acceleration and speed should be irrelevant (at least this was the intention) I tried your change but I didn't observe any change.

    Anyway, I see what you want. The...
  43. Yes, you are absolutely right. This eliminates...

    Yes, you are absolutely right. This eliminates the ugly acceleration asymmetry in the feeder speed profile. I implemented a first try and pushed it to GitHub...
  44. Here the relevant code: void...

    Here the relevant code:



    void Winder::setSpindleSpeed(float rpm)
    {
    targetSpindleSpeed = rpm / 60.0f * spindleStpPerRev;
    }

    void Winder::setPitch(float pitch)
  45. I tried to reproduce your problem with changing...

    I tried to reproduce your problem with changing the pitch quickly on the fly. I first cleaned up everything and wrote a winder class which encapsulates all the code required to move your steppers. ...
  46. Your winder looks great, you definitely made huge...

    Your winder looks great, you definitely made huge progress compared to your first wooden model. Looks very professional now.


    Reading your explanation I think you have contradictory...
  47. Your code is a bit difficult to understand. When...

    Your code is a bit difficult to understand. When I did the example for you a few posts above I also started similar to your approach (calculating with the speed of both motors). After looking at the...
  48. I don't quite understand what you want to achieve...

    I don't quite understand what you want to achieve but I'd say it does what you requested. I added printout of motor speeds to your code. The result is shown below.

    16434

    You request motor1...
  49. Looks like you deleted stuff in #32? Anyway, I...

    Looks like you deleted stuff in #32? Anyway, I had a look at the issue with directly starting a move after an estop (the remaining code block in #32) This seems to be some timing issue. For a...
  50. Tested your code. Here is the output: 16425 ...

    Tested your code. Here is the output:

    16425

    Looks like it does exactly what it is supposed to?


    No, this was never possible, it is limited by the 4 PIT timers of the Teensies. However, you...
Results 1 to 50 of 442
Page 1 of 9 1 2 3 4