hi, I have a controller kflop with snapamp and differential encoder, I can not make the move dc servo motor, as I have to configure the controller? I connected the encoder j7 snapamp pin 15 16 17 18, the motor channel 0 greetings dalmazio
hi, I have a controller kflop with snapamp and differential encoder, I can not make the move dc servo motor, as I have to configure the controller? I connected the encoder j7 snapamp pin 15 16 17 18, the motor channel 0 greetings dalmazio
Hi dmoglianesi,
Yes you must configure KFLOP.
The Encoder connections you describe will show up as Encoder Input Channel #8 in KFLOP. See here for the SnapAmp Channel number definitions:
Using SnapAmp
You might start with the example motor configuration:
BrushServoMechanism.mot
Load it with the Load Channel Button on the KMotion.exe Config/Flash Screen. Then change the InputChannel Number to 8.
Download this configuration (with motor power off) and verify that the encoder Position on the KMotion Axis Screen changes correctly when the encoder moves.
Regards
TK
http://dynomotion.com
thanks Tom , now works, dalmazio
Hello, I'm in the same situation but the solution provided by Tom didn't work. I can see the position changes though. I'm using a rotary encoder.
From what I've read in the help section, the output signal for a DC Brushed servo is PWM so I have to use I/O26-33, right? For output channel 8, must I use I/O 26? I'm using that pin and the motor doesn't start.
I'm not using SnapAmp.
Hi MaxPrezas,
KFLOP doesn't directly support that type of PWM servo output. To use the KFLOP on-board PWMs you must utilize a small C program. Set the Axis output type as "No Output" and run a C program to write the Servo Output to the PWM in a format necessary for your drive type (Sign and Magnitude, antiphase, etc...) See the OutputToPWM3axis.c example:
HTHCode:#include "KMotionDef.h" main() { SetBitDirection(26,1); // Set bit 26 (PWM 0 as an output) SetBitDirection(27,1); // Set bit 27 (PWM 1 as an output) SetBitDirection(28,1); // Set bit 28 (PWM 2 as an output) FPGA(IO_PWMS_PRESCALE) = 1; // set pwm period to 30 KHz FPGA(IO_PWMS+1) = 1; // enable the PWM0 FPGA(IO_PWMS+3) = 1; // enable the PWM1 FPGA(IO_PWMS+5) = 1; // enable the PWM2 for (;;) //loop forever { WaitNextTimeSlice(); if (ch0->Enable) FPGA(IO_PWMS+0) = ch0->Output + 128; // +128 converts to anti-phase else FPGA(IO_PWMS+0) = 128; // whenever not enabled put 50% duty cycle if (ch1->Enable) FPGA(IO_PWMS+2) = ch1->Output + 128; // +128 converts to anti-phase else FPGA(IO_PWMS+2) = 128; // whenever not enabled put 50% duty cycle if (ch2->Enable) FPGA(IO_PWMS+4) = ch2->Output + 128; // +128 converts to anti-phase else FPGA(IO_PWMS+4) = 128; // whenever not enabled put 50% duty cycle } }
Regards
TK
http://dynomotion.com