For my FPV hobby I need antenna tracker. I tried Ardupilot antenna tracker but he works only with 2 way modems on 57600 baud. I found project “GhettoStation” https://github.com/KipK/Ghettostation/tree/master/GhettoStation but he on Atmel chip and Arduino. So I decided to make my own antenna tracker on STM32. I use code from ghetto station for calculation bearing and heading. I use Nema 17 motor to have 360 degree movement without gears.And one 20kg servo to move antenna up and down.
Need to improve follow algorithm (now it works like I have only 360 maximum movement limit.)
Also I thinking about to do interpolation and movement prediction algorithm.
I have some problems with parallel smooth moving pan and tilt. Because I have only one core I can't do this job in parallel. I can do it only in concurrency mode, but since I have very small timeouts while stepper moves (sometimes < 1ms) I can't efficient switch to another task (because context switch will require significant amount of ticks ). It makes CPU usage about 100% at fast movings. If I will have separate cores for movement and trajectory processing I can do pan and tilt in parallel.
Very basic version almost done. I need to do settings tuning from CLI and It ready to testflight.
Because in Russia right now not good wheather to flight I think I will do more improvements in this project.
After one hour of working TMC2130 had temperature 88C. I checked datasheet and it is ok. (Overheat protection should started from 100 to 120 degree.) I think we doesn't need active cooling here. May be in future I add some additional holes in box.
Different situation at stepper:
72C not too bad for NEMA 17 stepper (depends on class working temperature is 105-180C) but since it is 3d printable 72 it is maximum for PTEG. I decided to add 40mm cooler fan.
I spent some time to make moves smoothest. Because since i use stepper motors i had step skipping sometimes. So i decided to port Arduino stepper library to STM32. I had a little trouble with microsecond delays which has been used in Arduino library and I changed implementation a little. Now I can control speed acceleration and deceleration of my stepper. Also I switched stepper driver from A4988 to TMC2130 and now I have silent precision and smooth bearing moves. I liked how it moves and think about to change 20kg servo to stepper with reductor.