When I got it working on "fast" I increased the steps per revolution gradually but I had to reduce the RPM accordingly. Finally at 5370 Steps Per Revolution I found that 10RPM provided smooth movement and full 360 degrees travel (no missed steps). No other RPM produced this result. Step On Time and Motor delay did not seem to make a noticeable effect. So I returned them to 5. I think I want a wider range of speeds right? Or does this test only find the optimal speed?
Thanks,
Kevin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes, it finds the fast speed.
Step on time is the time required to pulse the motor. So generally it is the a small value.
MotorDelay is a software delay value which controls the speed of a loop during which the motor is updated when moving. So increasing motordelay should slow down the motor - try multiplying it by 2 or 3 times to see if the motor slows down
Worst case - It might be you will need three different combinationsof rpm/stepsperrev to control speed.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I cannot find anywhere in the ino code where "motorSpeedDelay" and "stepontime" are passed to myStepper.h . I think this is why changing those values have no effect whatsoever. I don't know enough about this syntax to pass the values properly.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Kevin
These do not get passed to mystepper. They are local variables used to control timing for software loops.
For example. motorSpeedDelay is a viarable that is processed each time through a loop.
the loop looks like (for simplicity)
loop()
stepmotor one step
delay(motorSpeedDelay)
end loop
Now you can see that changing the value of motorSpeedDelay will affect the time it takes to do one loop. A larger value means it spends more time in delay that it does stepping the motor - hence the speed of the motor will slow down as motorSpeedDelay increases.
regards
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I found that step_delay = (60L * 1000L * 1000L) / this->number_of_steps / whatSpeed; So I am glad you mentioned that the "delay" is just for local loop execution. However, I don't see any local loop in the Test code you provided. It just passes speed, direction, and step count to mystepper which is driving the motor. I believe that changing the value of motorSpeedDelay does nothing in this test code.
Last edit: Kevin Snedden 2018-03-15
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't think I explained myself well. I was jumpng back to the firmware without realizing your were still using the test code earler,
Remember that the simple loop example repeats over and over
If delay)motorSpeedDelay) took one second to execute, how many steps would the motor take in one minute
What if dekay(motorSpeedDelay) took 10 seconds to execute, how may steps would the motor take in one minute then?
The test code I gave you was to get the motor going.
Now, its time to go back to the firmware, make the changes necessary that you have figured out so it now steps at fast steep, then play with the value of motorSpeedDelay in the firmware to change the speed of the motor.
I'm afraid that I'm having bad luck with this shield. Using your new test program I can get it reliably turning at 10,20,30 RPM. delay = 1 (only). When I try these settings in the Focuserv265 L298P firmware I get poor results. Lots of skippping until finally it stalls. Perhaps I'm not meant to minimize the space needed for this device.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In general if you get skipping it is because the delay value is too small. This is in the firmware, look for these lines below
#endifdelay(motorSpeedDelay); // required else stepper will not move
}
so I would change these lines above to like
#endifdelay(20); // required else stepper will not move
}
and see what happens. Default value for motorSpeedDelay is 5, so I would try values from 1 to 100 to see what difference that makes.
If you can try that then send me your firmware file to look at
Last edit: brownrb 2018-03-16
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have given up on using this shield. I did however find a compact driver board for the Nano that will support two stepper drivers. It came with A4988s and a Nano on it. It is called" Eleksmaker Mana SE" They are not sharing wiring or software details so it will be challenging to reverse engineer the product. My goal is to combine a focus controller with a rotator in one device.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Kevin
Ok. A single nano to power both is going to be very challenging.
You will need to write firmware to do this - that is going to be difficult because there is little code space left to also implement a rotator on the same chip. You will likely run out of both program memory and data memory quickly.
Also you will need to write a new ascom driver but this poses a problem for clients as they expect a separate com port for each device and you do not have that. So when you run maxim etc what will happen is it will ask your to connect focuser to com3 (for example) and then a rotator to com4.
So you might need to implement a local server to do this but whichever way is not going to be easy and you might consider asking for some advice on yahoo group ASCOM-Talk as to the best way to do this.
You are going to need good programming skills and use Visual Studio Community (it is free) and a sound knowledge of Arduino code, VB or C# skills for the Application and ASCOM driver side.
Regards
Robert
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Moonlite treats the rotator motor as part of the focuser device. And I have seen a Nano controlled project using the Moonlite ASCOM driver. The Eleksmaker is a Nano controlled laser engraver so I think it is possible to control two steppers independently. Especially if I do not support any other devices. Perhaps to get a rotator going I will build a standalone rotator circuit first and use two com ports.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm coming back to the L298P . I can still only make it reliable in 10RPM. I decided to use the firmware instead of the test ino. motorSpeedDelay had no effect using the test ino. We'll see how it goes.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When I got it working on "fast" I increased the steps per revolution gradually but I had to reduce the RPM accordingly. Finally at 5370 Steps Per Revolution I found that 10RPM provided smooth movement and full 360 degrees travel (no missed steps). No other RPM produced this result. Step On Time and Motor delay did not seem to make a noticeable effect. So I returned them to 5. I think I want a wider range of speeds right? Or does this test only find the optimal speed?
Thanks,
Kevin
Yes, it finds the fast speed.
Step on time is the time required to pulse the motor. So generally it is the a small value.
MotorDelay is a software delay value which controls the speed of a loop during which the motor is updated when moving. So increasing motordelay should slow down the motor - try multiplying it by 2 or 3 times to see if the motor slows down
Worst case - It might be you will need three different combinationsof rpm/stepsperrev to control speed.
I cannot find anywhere in the ino code where "motorSpeedDelay" and "stepontime" are passed to myStepper.h . I think this is why changing those values have no effect whatsoever. I don't know enough about this syntax to pass the values properly.
Hi Kevin
These do not get passed to mystepper. They are local variables used to control timing for software loops.
For example. motorSpeedDelay is a viarable that is processed each time through a loop.
the loop looks like (for simplicity)
loop()
stepmotor one step
delay(motorSpeedDelay)
end loop
Now you can see that changing the value of motorSpeedDelay will affect the time it takes to do one loop. A larger value means it spends more time in delay that it does stepping the motor - hence the speed of the motor will slow down as motorSpeedDelay increases.
regards
I found that step_delay = (60L * 1000L * 1000L) / this->number_of_steps / whatSpeed; So I am glad you mentioned that the "delay" is just for local loop execution. However, I don't see any local loop in the Test code you provided. It just passes speed, direction, and step count to mystepper which is driving the motor. I believe that changing the value of motorSpeedDelay does nothing in this test code.
Last edit: Kevin Snedden 2018-03-15
I don't think I explained myself well. I was jumpng back to the firmware without realizing your were still using the test code earler,
Remember that the simple loop example repeats over and over
If delay)motorSpeedDelay) took one second to execute, how many steps would the motor take in one minute
What if dekay(motorSpeedDelay) took 10 seconds to execute, how may steps would the motor take in one minute then?
The test code I gave you was to get the motor going.
Now, its time to go back to the firmware, make the changes necessary that you have figured out so it now steps at fast steep, then play with the value of motorSpeedDelay in the firmware to change the speed of the motor.
Last edit: brownrb 2018-03-15
I'm afraid that I'm having bad luck with this shield. Using your new test program I can get it reliably turning at 10,20,30 RPM. delay = 1 (only). When I try these settings in the Focuserv265 L298P firmware I get poor results. Lots of skippping until finally it stalls. Perhaps I'm not meant to minimize the space needed for this device.
In general if you get skipping it is because the delay value is too small. This is in the firmware, look for these lines below
}
so I would change these lines above to like
}
and see what happens. Default value for motorSpeedDelay is 5, so I would try values from 1 to 100 to see what difference that makes.
If you can try that then send me your firmware file to look at
Last edit: brownrb 2018-03-16
I have given up on using this shield. I did however find a compact driver board for the Nano that will support two stepper drivers. It came with A4988s and a Nano on it. It is called" Eleksmaker Mana SE" They are not sharing wiring or software details so it will be challenging to reverse engineer the product. My goal is to combine a focus controller with a rotator in one device.
Hi Kevin
Ok. A single nano to power both is going to be very challenging.
You will need to write firmware to do this - that is going to be difficult because there is little code space left to also implement a rotator on the same chip. You will likely run out of both program memory and data memory quickly.
Also you will need to write a new ascom driver but this poses a problem for clients as they expect a separate com port for each device and you do not have that. So when you run maxim etc what will happen is it will ask your to connect focuser to com3 (for example) and then a rotator to com4.
So you might need to implement a local server to do this but whichever way is not going to be easy and you might consider asking for some advice on yahoo group ASCOM-Talk as to the best way to do this.
You are going to need good programming skills and use Visual Studio Community (it is free) and a sound knowledge of Arduino code, VB or C# skills for the Application and ASCOM driver side.
Regards
Robert
It might also be worthwhile searching previous posts or google or github as I seem to recall that someone had attempted this previously.
Moonlite treats the rotator motor as part of the focuser device. And I have seen a Nano controlled project using the Moonlite ASCOM driver. The Eleksmaker is a Nano controlled laser engraver so I think it is possible to control two steppers independently. Especially if I do not support any other devices. Perhaps to get a rotator going I will build a standalone rotator circuit first and use two com ports.
I'm coming back to the L298P . I can still only make it reliable in 10RPM. I decided to use the firmware instead of the test ino. motorSpeedDelay had no effect using the test ino. We'll see how it goes.