Quote:
First: MPG handweels not yet working but, at least, I am sure that MPG encoders are working fine; to check them i have set two fake axis, ch4 and ch5, connected to MPG's Kanalog input channels, #6 and #7, as encoder input and no output_mode: on the axis screen I can read the Position column increasing by 400 steps every 100 MPG clicks.That seems correct because the encoder has 100 pulse/rev.
Said that, the problem can come by code only, or... tell me witch kind of test i can do.
It seems you have the MPG code commented out
Quote:
Second: i wrote the spindle management but also here there is something wrong. First time i call M3 or M4 the output Dac goes at the maximum value (1024) and never go to zero even if i do M5, the spindle stop to run just because i leave the inverter_on signal. Also the rotation direction is random: sometime it start on CW, sometime on CCW but in any case always commands the side with which it starts the first time; calling M3 or M4 it starts in the same first direction.
It seems your Spindle is Axis #2. Did you test Axis #2 to see if it works? It sounds like you have positive feedback causing a runaway. Try revering the Output Gain.