8i20/BLDC component, limited spindle speed
It needs data types adding to the params
param rw unsigned level "state machine state";
param rw float threshold;
And it needs a closing bracket for the function, and possibly a catch all case
...
if (spindle_command - spindle_feedback) > threshold) {
spindle_underspeed = 1; }
break;
default:
// not sure how we got here, but fix the situation
level = 0;
}
Please Log in or Create an account to join the conversation.
The BLDC lead angle is set in the hal file to 90 (always has been)
if I setp the bldc lead angle while it's running at a speed below the requested (2100 vs 3000) I get no noticeable change in speed.
What numbers did you try? I see the screenshot at 180 degrees (!) and would actually have expected that to stop the motor.
I was suggesting tweaks in the 80 to maybe 110 degree range.
More voltage is worth trying. The 8i20 can handle it and the motor won't care.
Please Log in or Create an account to join the conversation.
I tried everything up from say 70 to 180 in 10* increments, didn't really seam to do much.
The BLDC lead angle is set in the hal file to 90 (always has been)
if I setp the bldc lead angle while it's running at a speed below the requested (2100 vs 3000) I get no noticeable change in speed.
What numbers did you try? I see the screenshot at 180 degrees (!) and would actually have expected that to stop the motor.
I was suggesting tweaks in the 80 to maybe 110 degree range.
More voltage is worth trying. The 8i20 can handle it and the motor won't care.
As for voltage the more I think about it the more I realize it probably does need to me higher. I did wire up the drive for 240v AC (320vDC) last night and changed some nv params on the 8i20. the 1000uf caps I was using were only rated for 250v so I had to make up a bank of 4 470uf 450v caps. I have the line side fused at 5 amps, when the line side SSRs close it blows the fuses from the inrush current on the caps. I'll grab some 10amp fuses today, I didn't really expect the current spike to be that much higher.
I tried double checking the caps but the meter I had on hand doesn't do well with capacitance. I did see the DC voltage drop very slowly as would be expected.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Not sure how the resistor would work on the line side, If it's proper to put a resistor on one leg obvious what to do with the AC SSR.
I suppose the 8i20 busunderv pin linked to a 7i76e field output to drive the SSR?
Please Log in or Create an account to join the conversation.
Looking through old component orders, it seems I chose 620R 50W.what type of resistor are you using?
Though that seems a bit larger than strictly necessary to limit inrush. It does not need to be specified for full power handling as it is only used momentarily.
No, it is placed on the live AC incoming feed[/quote]Thinking about it it only seems feasible to put a resistor between the rectifier and the caps, but then running a DC SSR parallel to the resistor is going to be tough because I can't say I've come across a DC SSR that can handle 320v.
I used a "comp" HAL component monitoring the actual bus voltage, but using busunderv might be simpler.I suppose the 8i20 busunderv pin linked to a 7i76e field output to drive the SSR?
Please Log in or Create an account to join the conversation.
(That component has the look of something that I wrote during a lunch break without access to a LinuxCNC machine to test it on). Which is exactly the situation now, too, so again there may be errors.
It needs data types adding to the paramsparam rw unsigned level "state machine state"; param rw float threshold;
And it needs a closing bracket for the function, and possibly a catch all case... if (spindle_command - spindle_feedback) > threshold) { spindle_underspeed = 1; } break; default: // not sure how we got here, but fix the situation level = 0; }
Still getting errors during install. Unfortunately I know very little about C or python or any of that but I'd be glad to test this out once I get some pins to play with.
$ halcompile --install spindle_monitor.comp
Compiling realtime spindle_monitor.c
spindle_monitor.comp: In function ‘_’:
spindle_monitor.comp:29:9: warning: implicit declaration of function ‘absf’ [-Wimplicit-function-declaration]
spindle_monitor.comp:38:46: error: expected expression before ‘>’ token
spindle_monitor.comp:38:57: error: expected statement before ‘)’ token
spindle_monitor.comp:46:12: error: invalid storage class for function ‘__comp_get_data_size’
spindle_monitor.comp:46:1: error: expected declaration or statement at end of input
spindle_monitor.comp: At top level:
spindle_monitor.c:41:12: warning: ‘__comp_get_data_size’ used but never defined
static int __comp_get_data_size(void);
^
/home/justin/linuxcnc-7i96/src/Makefile.modinc:113: recipe for target 'spindle_monitor.o' failed
make: *** [spindle_monitor.o] Error 1
For now I just swapped in 10 amp fuses. Everything in the power supply can handle over 10amps and there's no dry contacts to arc, the line SSRs are rated for 25a so I think I'll be OK since the 10a FNQ fuses seem to handle it so far. It's going to be a pain to stuff anything else in the 10x10 box.
It was definately a voltage limitation because I can now run the spindle up to at least 4k rpms. It sounds ugly but it gets up there. i can keep it pretty reasonable to between 2500 and 3000 by tuning the PID a little but i think beyond that the no load spindle is a little tough for the 7i76e to keep up with. This is with the servo thread at 800000, at 500000 i've had it shut down for following errors.
Please Log in or Create an account to join the conversation.
The function is "fabs". I get that wrong a lot.
spindle_monitor.comp:38:46: error: expected expression before ‘>’ token
if (spindle_command - spindle_feedback) > threshold) {
if ((spindle_command - spindle_feedback) > threshold) {
Then see if the rest get fixed as a side-effect.
Please Log in or Create an account to join the conversation.
$ halcompile --install spindle_monitor.comp
Compiling realtime spindle_monitor.c
spindle_monitor.comp: In function ‘_’:
spindle_monitor.comp:29:9: warning: implicit declaration of function ‘fabs’ [-Wimplicit-function-declaration]
spindle_monitor.comp:29:9: warning: incompatible implicit declaration of built-in function ‘fabs’
spindle_monitor.comp:29:9: note: include ‘<math.h>’ or provide a declaration of ‘fabs’
spindle_monitor.comp:46:12: error: invalid storage class for function ‘__comp_get_data_size’
spindle_monitor.comp:46:1: error: expected declaration or statement at end of input
spindle_monitor.comp: At top level:
spindle_monitor.c:41:12: warning: ‘__comp_get_data_size’ used but never defined
static int __comp_get_data_size(void);
^
/home/justin/linuxcnc-7i96/src/Makefile.modinc:113: recipe for target 'spindle_monitor.o' failed
make: *** [spindle_monitor.o] Error 1
Please Log in or Create an account to join the conversation.
#include <rtapi_math.h>
Note I'm not on a computer to check the syntax.
But the errors are telling you to include math.h but we have to use a different include file in .comps so it should work.
Please Log in or Create an account to join the conversation.