Hi RodW, I am still having trouble with speed control in V7, as I did in V5. I am running V4 and V5 with all "Speed set" commented out and speed set TIMER_DELAY =100 in place of 80 and my Nema 17 is happy there. Keep up the great work.
I also had to add the version number in the splash screen to keep track of witch version I am playing with. Had them all up at one time and got corn fused. Thanks, Carl
Great you have it going on your NEMA17. I would have thought V7 would let you sort the speed out from the Config menu. by increasing TIMER_DELAY, you are decreasing the stepper frequency. From memory, 80 is 6250 Hz so you need to take that down by 20%. I'd try the max freq at about 4000 and see how you go.
The version is a great idea. It keeps a 3 char signature internally in the EEPROM so it knows if there is any data stored or not. I should add an extra field for version number.
I'm now writing the device number on the start up screen.
I've added code to create and add devices but need to add the select device code.
Hi Rod
I had some time to play with V7, wow that is a bunch of code ! And most of it is way over my head
The previous versions I could mostly understand. Very impressive coding my friend.
I just hooked up to a stepper on my bench. The ramp up and down is very nice. I was able to run this nema 34 motor at 16000 max.
I did notice some odd behavior with go to home, I set home and then bumped a few steps (3) with the right button and then went back and went to "Go Home" and it continued in the same direction a few more steps and stopped. I am guessing about 7-8 steps from home. I tried a few other things with continuous turn a step but it seemed confused where home was.
Everything else seemed to work well. I may have time to hook it back up to my machine this weekend.
Here is a thought.. Would it be possible to control speed with a potentiometer ? I am pretty sure we have some analog pins free. That might make a nice feature. The pot min max would be what was used in setup.
Thanks again for all your hard work !!
Scott
Scott, thanks for the feedback. It will inspire me to keep going! Hard to think the <200 lines of code I started with is now pushing 1000...
I think I will reenable the speed control in 5% increment between maxHz and minHz but not save it in eeprom which will give temporary control of speed that is wiped out on a reboot. If there is a speed you particularly like, you will be able to save the settings to EEProm as a separate device and retrieve it later.
A knob for speed control is a good idea. Not sure if it should be a pot or a rotary encoder though. The encoder could work just as the speed control is described above. a Pot might require calibration.
And most of it is way over my head
kinda over mine too! heaps of trial and error.
When the stepper goes LOW, that is the end of a complete cycle (Hz) so thats when we change the speed.
When we want to move a given number of steps, We calculate the max and min timer delay
Then the number of frequency changes (in timer delay steps - microseconds) are calculated to go from the minimum frequency to the maximum frequency.
If there are not enough steps to go right up and then right back down, this number is altered to a lower number so the ramp up and ramp down fits to the available steps and the operating speed will not reach max Hz.
It then calculates pointers to endRampUp and StartRampDown.
The #steps is decremented so endRampUp is a big number
so we start at min Hz and go up 1 delay setting on each step until we reach endRampUp, we go along at max speed until we get to StartRampDwn at which time we start slowing down. In theory, we should hit the minimum speed on the last step.
I did notice some odd behavior with go to home, I set home and then bumped a few steps (3) with the right button and then went back and went to "Go Home" and it continued in the same direction a few more steps and stopped. I am guessing about 7-8 steps from home. I tried a few other things with continuous turn a step but it seemed confused where home was.
Scott, I did notice some issues with Home and will review it when I finish my changes and get it back on the rotary table. I am not sure if we are missing steps in the hardware or it is my code. The home tracking has not changed..
The other bug is that on continuous turning and continuous jogging, the rampdown when your finger off starts at max frequency, not the current frequency so that if it is turning very slowly, it will instantly leap to full speed, then ramp down. If you have a reasonable min Hz (say 1000), the operating speed is reached quickly and not an issue but if you set min Hz to say 400, it is noticeable...