Help needed to get my 7i76E + 7i85S + 7i73 on my mill going.

More
8 years 2 months ago #116379 by Hakan

tecno wrote: Something else must be set wrong, did test to edit speedratio but still nothing.
I can hear that motor relay is activated so it seems VFD is not getting any voltage from 7i76e output.


From the figure in the previous post, speed_out is zero, so it should not run. See above.

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

More
8 years 2 months ago #116380 by tecno
if (inputs_sum > 0 && geartouse == gearengaged) { // Everything ok
gearshift = 0;
wantedgear = gearengaged;
speedratio = ratios[gearengaged-1];
enable_out = enable_in;
} else { // Should change gear
gearshift = 1;
wantedgear = geartouse;
speedratio = ratios[geartouse-1];
enable_out = 0;
speed_out = speed/speedratio;
speed_out = 0.0;
}
}

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

More
8 years 2 months ago #116381 by Hakan
Code:
if (inputs_sum > 0 && geartouse == gearengaged) { // Everything ok gearshift = 0; wantedgear = gearengaged; speedratio = ratios[gearengaged-1]; enable_out = enable_in; speed_out = speed/speedratio; <=============== } else { // Should change gear gearshift = 1; wantedgear = geartouse; speedratio = ratios[geartouse-1]; enable_out = 0; speed_out = 0.0; }

I moved the speed_out speed calculation to the right place. Now it should work. Remove the arrow.

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

More
8 years 2 months ago #116382 by tecno
OK, will go down to the workshop and try y´this out now.

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

More
8 years 2 months ago #116383 by andypugh
I think I still prefer my switch{} as a way to determine the gear, it can detect invalid combinations.

It might be better to multiply by speedratio, just so that there is no chance of a divide-by-zero if a config mistake makes speedratio=0

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

More
8 years 2 months ago #116384 by Hakan
You have a good point. The way it is done now is not very error-proof.
One way to ensure only one input is active is to
if (input_a + input_b + input_c + input_d + input_e != 1) .......

I also have a feeling there are other erroneous combinations possible,
especially in combinations with the Glade input that is coming.

I don't mind if like you to bring back the switch-case.

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

Moderators: cmorley
Time to create page: 0.086 seconds
Powered by Kunena Forum