I assembled the kit, installed the software and everything works, hurrah!
So, I’m now trying to drive a pair of unipolar stepper motors for a DIY 2D plotter-type machine. Unfortunately the digital output from the K8055N appears to be limited in terms of speed. I read somewhere that the best we can expect to achieve is a pulse every 20ms, so only 50 pulses per second. My steppers are 1.8deg per step so need 200 steps for a full rev. So the best I can hope for is 4secs for a full rev. For resolution this is great but for table traverse speed it’s painfully slow.
Does anyone have any suggestions as to how I can improve the speed without losing control? I’ve considered a number of options but eventually get tied in knots! The best I have come up with is to use the digital output of the K8055N to create an RS232 serial output and then interface to a purpose built serial to stepper card.
If you are using only the digital output commands (e.g. WriteAllDigital), the command execution time is 1ms.
This 1000 instructions loop takes 1 second to proceed:
procedure TForm1.Button15Click(Sender: TObject);
var i:integer;
begin
for i:=0 to 999 do
begin
WriteAllDigital(i);
end;
end;
Note that the lack in speed is in no way the fault of the hardware. I have an original K8055 converted to a PIC18F chip which can control up to 8 hobby micro servos via digital out simultaneously, and that requires hitting each servo with about 40 pulses/second timed within microseconds (that timing part is what your K8055N currently can’t do, not even for a single port). At the same time the board can count the frequencies of square waves at the digital inputs up to 2.5 kHz, and of course do the usual ADC/PWM stuff on the side. The PIC on the K8055N is just as powerful. The problem is that this power isn’t used.
The main road block in the case of the K8055N is its current backwards compatibility to the K8055. It uses more or less the same limited functionality and resolution USB HID based protocol. The PIC has 10 bit A/D and PWM, but the IO protocol only supports 8 bits. The PIC could maintain 5 counters, but there is no room for the values in the HID report structure. The PIC could report/react a lot faster, but 1,000 messages/s is a fixed HID protocol limit (thanks Microsoft).
Aside from the speed, there is one key difference between the old K8055 and the new K8055N, I’d like to point out. The K8055N’s PIC has an ‘F’ in its name. And (quite logically) the board now has an ICSP header. That means the board is ready to be connected to an ICSP programmer, like Microchip’s PicKit2. You are no longer limited to what Firmware Velleman ships inside the PIC. You can write your own! You can change to a real USB driver and whatever you want. The limit is … well, not the sky, but rather the memory inside the PIC. If you want to go that route, note that those PICs cost less than $5 a piece. So no need to “damage” the one you have. To my knowledge Velleman will NOT publish the .HEX files you would need to restore it to its current condition.
If you want to follow this path, all the software needed to do that is available for free. Microchip offers you the entire IDE including C compiler together with a comprehensive collection of code examples. MinGW is all I use to develop access libraries. The K8055 Open Source project is based on that, which might be a good point to start from. None of that code would run right out of the box on your K8055N. You will at least have to switch to the other PIC model, adjust the crystal frequency and oscillator configuration, change some of the IO port definitions … yeah, sorry, this path through the dungeon is not for the timid.
So the real question is “how much are you willing to learn before being able to create your solution?”
Based on your information I investigated further and found a timer set to 20ms intervals in the Form_Load event of the VB6 demo software. I reduced this to 1ms and executed the following code to energise the stepper in the correct sequence:
For i = 1 To 500
ClearDigitalChannel 8: SetDigitalChannel 7
ClearDigitalChannel 7: SetDigitalChannel 6
ClearDigitalChannel 6: SetDigitalChannel 5
ClearDigitalChannel 5: SetDigitalChannel 8
Next i
This gives 75 rpm, excellent! With a 10mm diameter pulley I’ll get almost 40mm per second linear motion. The output may also be limited by the speed of the PC and OS. If I compile the code there is a further improvement.
Finally, I now know that I can create a pulsed output of frequency 250Hz, i.e. at 4ms intervals. This is more than adequate for driving many of the standard stepper driver chips.
I’m now obsessed with making the stepper run as fast as possible. I’ve reviewed the application note from ST which recommends a ULN2075B darlington to allow use of the chopper function on the L297 for a unipolar stepper. Despite hours of searching I can’t find a practical schematic for this. Does anyone have any experience?