This was not actual code I’m using, this was just an code for a question. In the example provided the slow part not in the creation of the array, but in the loop. I’m looking for alternative way to assign the same value to each array element without looping.
// just a sample, not actual code
int steps = 16000;
uint interval = 200;
uint[] timingBuffer = new uint[steps];
// the following loop takes long time
for (int i = 0; i < steps; i++)
timingBuffer[i] = interval;
@ EvoMotors - Im looking on with interest for this. I have a project to build a stepper controlled pan tilt. I would like to use netMF to do it if possible. I am prepared to get into RLP if needed. And if i can find some good example code(easy to understand for a rubbish coder like me) to crib. I really want to get all the acceleration and jerk managed correctly so i can handle moving large masses efficiently.
Currently im concentrating on the hardware build and have a crude setup to generate pulses thats ok for that, but not great for anything more than that.
I did not code acceleration/deceleration yet, right now steppers starts at full feed-rate when jerking manually or feed-rate defined by F G-Code command when processing from file. I will start working on acceleration/deceleration tonight. I can share code later if you interested in it.
@ hagster - It’s going to be very hard to do acceleration and deceleration that is smooth, using NETMF. If you want smoothness, then user a L6470 stepper driver.
Definately interested. My main problems are mechanical at the moment though. Its mostly 3d printed so its a challenge for accuracy and strength. I wont be doing any serious electronics or software until i know thats robust. I know i can get the electeonics to work if i go really slow as a worse case. I havent even really settled on netMF for it either to be honest.
@ Mr. John Smith the dSpin looks intersting. Its a bit expensive for the breakout boards(compared to the Alegro or TI chips), and im working on a shoestring, but good to know the option is there if required.
@ EvoMotors - The sound of the steppers should tell you; If they hum rather than sing, then they are constantly overshooting. Once the ringing is on par with the speed; a step is lost or it stalls.
@ Mr. John Smith -
Bad driver or insufficient power supply can cause stepper to miss steps especially if stepping very fast. G120 + NETMF in my case just acts as a signal generator for stepper driver, so if I’m missing steps would not be a NETMF issue.
Well… steeper drivers likes to operate on 50% duty cycle signals, so if I’m unable to provide what it needs it could skip steps. That would be netmf issue, or just bad programming from my side.
Presuming your using a common stepper driver IC they just take pulses and dont care about the duty cycle. The frequency and stability is the important thing. Its a bit like the timing of a car engine spark. You need it to go off at just the right time to maximise power delivery.
@ EvoMotors - Missing steps would definitely be a NETMF issue if you’re driving the stepper driver. There are limits to how fast you can accelerate the motor; try to accelerate it from no movement to fast movement at too high a rate, and you’ll miss steps. You won’t even know you missed them, either, unless you’re using a sophisticated driver; there’s no feedback. The stepper driver is not magic. It can’t change the laws of physics and nullify inertia.
Actually it’s moving pretty smooth and accurate. The 3 axis synchronization is almost done, but no acceleration/deceleration yet. Here is a little demo parsing the gcode file from SD card and controlling 0.9 degree stepper motors quarter-step resolution.