Running SimpleFOC with trapezoidal-planner. Max velocity set to 50rad/s, acceleration and de-acceleration set to 25rad/s/s
If we win the Hackaday price, we will make BETA give aways. FOC field-oriented control for NEMA23/34
To make the experience fit your profile, pick a username and tell us what interests you.
We found and based on your interests.
Running SimpleFOC with trapezoidal-planner. Max velocity set to 50rad/s, acceleration and de-acceleration set to 25rad/s/s
First test on machine X-axis. Sound level is considerably improved compared to stepper drivers. There is still room for improvement. Feed-forward is not yet implemented and I haven’t tweaked tuning with machine load.
Using 8mm lead-screw with 1:4 gearing, so 4x8mm per rotation (32mm).
You may think it’s total overkill with two PnP nozzles on such large head. That is true. My goal is to make it easy to switch between PnP and CNC. Luckily OpenPNP does not require Klipper to work. It already has some pretty advanced motion features, like 3th order control etc. When up and running with OpenPNP it will be a good playground for Klipper/SimpleFOC integration or possibly make OpenPNP more capable with regard to CNC -> Gcode visuals
float speed = (4 * pi / 65536) * 168000000 / ((float)timer2 - 1.0f);
I was able setup a secondary (slave) timer on the encoder input. This means we time/track every rising edge on one of the encoder inputs. This can also be every encoder pulse, but we need the larger range to count.
Chat.GPT was so kind to help with the conversion to rad/s.
TIMER2 CCR1 - > 1585
Rad/s - > 20.34
TIMER2 CCR1 - > 1560
Rad/s - > 20.66
TIMER2 CCR1 - > 1621
Rad/s - > 19.88
TIMER2 CCR1 - > 1728
Rad/s - > 18.65
TIMER2 CCR1 - > 1611
Rad/s - > 20.01
TIMER2 CCR1 - > 1575
Rad/s - > 20.47
TIMER2 CCR1 - > 1550
Rad/s - > 20.80
TIMER2 CCR1 - > 1662
This is the output with a 20 rad/s target using the conversion above:
Hi,
We are looking for BETA testers who would like to help out with SimpleFOC -> Klipper integration.
See further here: Feature request: add klipper MCU input mode - developement - SimpleFOC Community
And here : Klipper Discord
Best regards
JASEP
Im starting to think it would be cool to see a direct drive confiq.
This is using the CORDIC for sine and cosine calculations.
So what are the real advantages when using FOC (Field Oriented Control)
When using a 16bit timer as a hardware encoder interface, That´s 65536 ticks per revolution. Or if using a 8mm screw -> 8mm / 65536 = 0,000122mm.
Less then a thou mm precision when direct driving it.
To reach e.g. 1400mm/min with a direct drive 8mm, we then need 1400mm/min / 8mm = 175 rpm or 18.32 rad/s.
We could also consider a 2:1 gearing, which will double the speed to 175 x 2 = 350 rpm.
I have started using the CORDIC for the sine/cosine calculations, and it seems fine. Perhaps a bit less vibration. The way S_FOC is using floats does not use the full potential of the CORDIC, unfortunately. It is very precise though.
Still tuning, but this is the speed I'm getting right now. Or the highest I dare at the moment. I put a 50rad/s limit .
Create an account to leave a comment. Already have an account? Log In.
Become a member to follow this project and never miss any updates
By using our website and services, you expressly agree to the placement of our performance, functionality, and advertising cookies. Learn More
Love the form factor for this! Ive been wanting a stepper motor driver with an esp32 so the servo system can recieve commands via a "normal" web interface, does this wifi / bluetooth?