I wrote a step/dir_angle program and tested it with webcontrol over serial.
The step pulses came from an 3D printer controller and it worked well.
Then I decided to clean up the code and get rid of serial- and motor.monitoring stuff.
I fed 5V from the printer controller instead of USB cable.
When I switch it on, I can see the motor initializing, but it doesn’t react on step pulses anymore.
It just keeps the position when I try to move it manually.
Not using monitoring seems to have thrown my PID tuning off, but how will I ever find the right parameters?
That is strange. There is probably some other issue there.
Did you use SIMPLEFOC_DISABLE_DEBUG.
This flag basically removes all the debugging and monitoring in Serial.
This way you can avoid modifying the code.
I installed an update for Arduino IDE yesterday and noticed other strange things.
Does anyone else use 2.3.9?
If I’d switch debugging on/off wouldn’t it change the looptime/PID tuning too?
I think I can live without monitoring, but still keep the web commander active.
Guess I’ll see how much the PID changes.
I’ve seen 60-80kHz torque-loop frequency in webcontrol.
I’d say it’s pretty fast, even with monitoring ON…
Theoretically the PID values should be independent of loop rate since it uses dt in the calculations. But I’ve never actually tested intentionally varying the loop rate to see if the response changes.
I’d recommend keeping a serial interface in the program even if it’s not used during normal running. That way if anything goes wrong in the future or you change to different motors or whatever, you can just plug an FTDI adapter to it and diagnose or configure without having to change the program.
I’m still using IDE 1.18.13, but I did run across this video a week or two ago that confirms my expectation that 2 would be worse
But also explains how to make it less bad.
I’ll probably have to update at some point since STM32 no longer supports version 1. A while back the boards disappeared from the tools->board menu, but I was able to hack them back in by editing one of the .txt files, and am still able to compile for now. But whatever I did made it mad and now ESP32 boards don’t show up, and it pops up an error message about them when I open the IDE.
My impression with 2.3.9 was, that it didn’t recognise any code changes.
I once got an compiler error " expecting ; before motor…" and I actually forgot the semicolon.
After adding it, I compiled again and the same error occured!?
I rolled back to IDE 2.3.8 and reworked my old step/dir code which included serial.
After comparing it with the former code, it missed the line
step_dir.attach(&motor.target);
No surprise, it worked after I flashed the new build. Hard to say if it was my mistake, deleting too much or IDE-dementia, but it’s fixed now.