8i20/BLDC component, limited spindle speed

More
24 Jul 2018 10:34 - 24 Jul 2018 10:34 #114736 by andypugh
(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 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;
}
Last edit: 24 Jul 2018 10:34 by andypugh.

Please Log in or Create an account to join the conversation.

More
24 Jul 2018 10:42 #114737 by andypugh

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.

More
24 Jul 2018 11:05 #114740 by blazini36

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.

I tried everything up from say 70 to 180 in 10* increments, didn't really seam to do much.

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.

More
24 Jul 2018 12:03 #114744 by andypugh
With the PSUs that drive my 8i20s I have a resistor in the circuit that the caps initially charge through, then an SSR bypasses that resistor once the 8i20 reports bus voltage over a threshold.

Please Log in or Create an account to join the conversation.

More
24 Jul 2018 14:38 #114750 by blazini36
what type of resistor are you using? 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.

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.

More
24 Jul 2018 16:11 #114751 by andypugh

what type of resistor are you using?

Looking through old component orders, it seems I chose 620R 50W.
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.


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.

No, it is placed on the live AC incoming feed[/quote]


I suppose the 8i20 busunderv pin linked to a 7i76e field output to drive the SSR?

I used a "comp" HAL component monitoring the actual bus voltage, but using busunderv might be simpler.

Please Log in or Create an account to join the conversation.

More
24 Jul 2018 22:19 #114770 by blazini36

(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 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;
}


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.


File Attachment:

File Name: spindle_mo...-24.comp
File Size:1 KB
Attachments:

Please Log in or Create an account to join the conversation.

More
24 Jul 2018 23:20 - 24 Jul 2018 23:21 #114781 by andypugh
[color=]spindle_monitor.comp:29:9: warning: implicit declaration of function ‘absf’ [-Wimplicit-function-declaration][/color]
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) {
Missing bracket, needs to be
if  ((spindle_command - spindle_feedback) > threshold) {

Then see if the rest get fixed as a side-effect.
Last edit: 24 Jul 2018 23:21 by andypugh.

Please Log in or Create an account to join the conversation.

More
25 Jul 2018 02:55 #114789 by blazini36
Getting there?
$ 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

File Attachment:

File Name: spindle_mo...4-2.comp
File Size:1 KB
Attachments:

Please Log in or Create an account to join the conversation.

More
25 Jul 2018 03:46 #114790 by rodw
I think if you add
#include <rtapi_math.h>
up near the top of your code it will pick up the declaration for fabs()
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.

Time to create page: 0.090 seconds
Powered by Kunena Forum