Search found 14 matches

by willywonka
Tue Dec 27, 2022 6:31 pm
Forum: Projects
Topic: STM32F103C8 Fast Input Rate Counter
Replies: 23
Views: 5396

Re: STM32F103C8 Fast Input Rate Counter

Im pretty sure the magnets are fine, if they were not diametrically magnetised they would not work at all ? Those are the magnets I’m using
https://amzn.eu/d/4KhNtYf
by willywonka
Tue Dec 27, 2022 3:05 pm
Forum: Projects
Topic: STM32F103C8 Fast Input Rate Counter
Replies: 23
Views: 5396

Re: STM32F103C8 Fast Input Rate Counter

Hey :) Like "counter", "Direction" should be declared as volatile. the counter was already declared as "volatile", I changed the direction to volatile just now. It's probably better not to reset the "counter" when the direction changes, but it probably doesn't...
by willywonka
Mon Dec 26, 2022 11:47 am
Forum: Projects
Topic: STM32F103C8 Fast Input Rate Counter
Replies: 23
Views: 5396

Re: STM32F103C8 Fast Input Rate Counter

Hello everyone, Merry Christmas and thank you so much for your help and especially for your patience with me. I have revised the code with your recommendations and hope it fits now. My test with some random high speed movements looked promising, the positions at the and was always correct. #include ...
by willywonka
Sat Dec 24, 2022 10:53 am
Forum: Projects
Topic: STM32F103C8 Fast Input Rate Counter
Replies: 23
Views: 5396

Re: STM32F103C8 Fast Input Rate Counter

Yes, you are completely right, I was a bit hasty yesterday and didn't think things through properly.
by willywonka
Fri Dec 23, 2022 8:38 pm
Forum: Projects
Topic: STM32F103C8 Fast Input Rate Counter
Replies: 23
Views: 5396

Re: STM32F103C8 Fast Input Rate Counter

so here is the full code (without Correction of the stepper position) A Big Thanks @ozcar #include <STM32FreeRTOS.h> #include <Arduino.h> #include <TMCStepper.h> #include <Wire.h> #include <AS5600.h> #include <STM32FreeRTOS.h> #if !defined(STM32_CORE_VERSION) || (STM32_CORE_VERSION < 0x01090000) #er...
by willywonka
Fri Dec 23, 2022 4:54 pm
Forum: Projects
Topic: STM32F103C8 Fast Input Rate Counter
Replies: 23
Views: 5396

Re: STM32F103C8 Fast Input Rate Counter

I took your last test program and modified it to alter the timer to count external signal, instead of using the internal clock. It did not take much to do that, but it is far from being a generalised solution. It does not make any assumption about which timer will be used, but does assume that the ...
by willywonka
Fri Dec 23, 2022 4:43 pm
Forum: Projects
Topic: STM32F103C8 Fast Input Rate Counter
Replies: 23
Views: 5396

Re: STM32F103C8 Fast Input Rate Counter

damn the other stuff doesn't work any more with the board manager I set this up...
by willywonka
Fri Dec 23, 2022 3:17 pm
Forum: Projects
Topic: STM32F103C8 Fast Input Rate Counter
Replies: 23
Views: 5396

Re: STM32F103C8 Fast Input Rate Counter

Im not 100% sure if this is the right approach, I basically copied this code "https://web.archive.org/web/20190316154745/https://www.stm32duino.com/viewtopic.php?f=18&t=3804" and added a second Timer, please correct me if this is wrong #include "Streaming.h" volatile uint32_t...
by willywonka
Thu Dec 22, 2022 8:02 pm
Forum: Projects
Topic: STM32F103C8 Fast Input Rate Counter
Replies: 23
Views: 5396

Re: STM32F103C8 Fast Input Rate Counter

40,000-80,000 inputs per second if that is possible. That would translate to a max speed of 500mm/s at 16-32 micristeps the current code is able to process 8000 inputs per second, which is just around 100 mm/s I took the frequency / duty cycle example, and changed it to only interrupt on rising edg...
by willywonka
Thu Dec 22, 2022 5:48 pm
Forum: Projects
Topic: STM32F103C8 Fast Input Rate Counter
Replies: 23
Views: 5396

Re: STM32F103C8 Fast Input Rate Counter

40,000-80,000 inputs per second if that is possible. That would translate to a max speed of 500mm/s at 16-32 micristeps

the current code is able to process 8000 inputs per second, which is just around 100 mm/s

Go to advanced search