Page 1 of 3
Help! PWM 0-10V.
Posted: Fri Feb 09, 2018 4:41 am
by Lafayette
Hello! I'm collecting the machine. I will connect the encoders, so I decided to buy KFLOP. The axles are controlled by step/dir. Spindle with analog control. I bought a PWM conversion board in 0-10V. (a photo). If I still understand in the electrician and can disconnect the wiring, then in programming, a full zero. I ask for help on correct adjustment of spindle control!
The maximum spindle speed is 5647 rpm.
P.S. Sorry for my English.
Re: Help! PWM 0-10V.
Posted: Fri Feb 09, 2018 7:56 am
by Lafayette
PWM conversion board in 0-10V
Re: Help! PWM 0-10V.
Posted: Fri Feb 09, 2018 5:22 pm
by TomKerekes
Hi Lafayette,
You would need the specification for the PWM to Analog converter board. Also the specification for whatever you will be using to drive the Spindle motor.
Re: Help! PWM 0-10V.
Posted: Mon Feb 12, 2018 6:21 am
by Lafayette
I want to use to adjust the spindle speed
JP6 IO26 Gen Purpose PWM0 out
I want to use to turn the spindle on and off.
JP6 IO27 Gen Purpose LVTTL I/O 3.3V
Specification of the converter:
input3.3V Level0-100% PWM Signal, output0-10V Voltage
PWM Signal receiving frequency range:suggested 1KHZ-3KHZ
The resolution of this module is 0.1V
1, DIN+: PWM signal input is. (common cathode method. Here the PWM signal, a total connection)
2, DIN-: PWM signal input. (common cathode method. Here the signal terminal GND, anode connection, PWM signal) here.
3, 12-30V: power input positive end.
4, GND: power ground.
5,GND :Signal ground. The GND port is connected with the power supply ground wire.
6AO:Analog voltage0-10V Output port.
Re: Help! PWM 0-10V.
Posted: Mon Feb 12, 2018 8:09 pm
by TomKerekes
Hi Lafayette,
The first Step would be to wire up the KFLOP PWM signal to the DIN+ and a KFLOP GND to DIN-
Then you might use the PWM1KHz.c Example to output a 50% PWM signal which should create a 5V analog signal as a test.
Code: Select all
#include "KMotionDef.h"
main()
{
SetBitDirection(26,1); // define bit as an output
FPGA(IO_PWMS_PRESCALE) = 65; // divide clock by 65 (1 KHz)
FPGA(IO_PWMS) = 128; // square wave
FPGA(IO_PWMS+1) = 1; // Enable
}
You haven't described any way to turn off your Spindle. So I don't see how you could expect IO27 to turn the Spindle on and off.
Regards
Re: Help! PWM 0-10V.
Posted: Tue Feb 13, 2018 8:40 am
by Lafayette
I will turn on and off through the standard M code.
IO27 will be connected to the optocoupler, and it will command the servo amplifier S-ON/S-OFF
I do not understand why I need an analog output 5V. when it needs 0-10V.
And how you can change the spindle speed.
Re: Help! PWM 0-10V.
Posted: Tue Feb 13, 2018 6:37 pm
by TomKerekes
Hi Lafayette
IO27 will be connected to the optocoupler, and it will command the servo amplifier S-ON/S-OFF
I don't think you told us about any optocoupler or what interface the amplifier has. Assuming IO27 can be interfaced somehow to turn the Spindle on and off then you probably don't need a C Program for M3 and M5. Just configure those to operate IO27.
I do not understand why I need an analog output 5V. when it needs 0-10V.
That was intended to only be a simple test to output 50% to see if the hardware is connected properly and is working. You can change the value of 128 to other values to test other voltages.
And how you can change the spindle speed.
Later you can use a C Program similar to the the one used for KStep's on board PWM to analog converter for the S Action. See the example Spindle_S_Kstep.c. Note the CorrectAnalog() function will probably need to be modified for the nonlinearities of your converter which is likely different than KStep's. If low speed control is not critical no changes may be needed. See:the Analog Output Section
Here.
Re: Help! PWM 0-10V.
Posted: Tue Feb 13, 2018 7:06 pm
by Lafayette
I have a servo amplifier AEROTECH BA20-160.
I want that from one pin 26 the authorization of the servo amplifier should be given, and from the other 27 the speed change through.
The maximum speed is 5647.
I'm interested in stability at low speed.
Re: Help! PWM 0-10V.
Posted: Tue Feb 13, 2018 7:09 pm
by Lafayette
The optocoupler will only work to enable the servo amplifier.
Re: Help! PWM 0-10V.
Posted: Tue Feb 13, 2018 7:27 pm
by TomKerekes
I have a servo amplifier AEROTECH BA20-160.
Please reference the manual for your device and the page/connector/specification. I don't see any opto coupler inputs. I see a TTL Shutdown input.
I want that from one pin 26 the authorization of the servo amplifier should be given, and from the other 27 the speed change through.
I think you stated the opposite before.
The optocoupler will only work to enable the servo amplifier.
What optocoupler?