I should have most of the electrical components, with the exception of 1 or 2 drivers, and an additional motor. I thought I had the additional parts needed, but I was wrong. :frown:
On the other hand, you have your own work in progress of defining the scope of what you desire. Your approach is likely to be more feature rich.
IMO It takes less time to make a proper board and send it off to order than it does to hack various boards together. You cannot easily duplicate the hodgepodge for others to contribute.
I don't see how you are going to gain any advantage by having the X and Y axes on separate cogs. The linear or curvilinear interpolation requires that both work closely together.
And since the Z axis is only called into play when a new slice is to be added, you might as well have the X, Y, and Z all on the same cog.
That leaves the question of whether there is any advantage to the E stepper that feeds the filament having a separate cog. I doubt there is any advantage. It needs to be in synch with just about everything.
X_Axis : "StepperDriver"
Y_Axis : "StepperDriver"
Z_Axis : "StepperDriver"
Extruder : "StepperDriver"
X_Axis.Start( ) '''New cog started'''
Y_Axis.Start( ) '''New cog started'''
Z_Axis.Start( ) '''New cog started'''
Extruder.Start( ) '''New cog started'''
''' Miscellaneous code for full duplex serial initialization and code for retrieving data from the master.'''
''' Data is held in variables to be passed to the stepper drivers.'''
''' At this point, I forget exactly how cog sync is done, but I have that information stored somewhere. Anyhow'''
''' I believe it goes something like this.'''
''' 1. Obtain CNT
''' 2. Add time to CNT to make a point in the future and store the result in a variable, such as "ExecutionBegin".'''
''' 3. After getting a future time, necessary for syncronizing several cogs, pass all the data to the stepper drivers.'''
X_Axis.Move(ExecutionBegin, NoOfSteps, DirectionOfRotation, PauseBetweenSteps)
Y_Axis.Move(ExecutionBegin, NoOfSteps, DirectionOfRotation, PauseBetweenSteps)
Z_Axis.Move(ExecutionBegin, NoOfSteps, DirectionOfRotation, PauseBetweenSteps)
Extruder.Move(ExecutionBegin, NoOfSteps, DirectionOfRotation, PauseBetweenSteps)
''' The first instruction of the Move method of the StepperDriver object would have a WAITCNT instruction, where the'''
''' future time of "ExecutionBegin" would be inserted.
''' I believe it is something very similar to that.'''
You do have to have a cog doing SPI interface for the MCP3208 that is your ADC. Some of your pin allocations seem to have forgotten that you have 8 ADC inputs available. If you are only using two for temperature monitoring, the other six could actually monitor limit switches on the 3 axes.
idbruce wrote: »
Surely, you must be joking.
All the drives must be sychronized for interpolation. How could you do it efficiently all in one cog? I don't even begin to see that as the least bit possible, okay maybe possible. Each stepper motor will have different timing that must remain in sync with the other motors to make the completed move at the same time. Each motor will likely have different amount of steps that it must make, etc...
It most certainly is a multi-thread proposition, at least to be efficient.
If you did attempt it with one cog it would be so slow, because you would have to tell one motor to take a step and make all the other wait their turn. Each motor would have to take a step then wait until it was it's turn again.
EDIT: Certainly not a task for the BASIC STAMP
Loopy Byteloose wrote: »
Well I am still working on a one Propeller solution, so my budget of available cogs is tighter.. along with i/o pins. I believe that Leonardo da Vinci claimed that small spaces discipline the mind. I tend to feel that fitting code into tighter chip space creates a better understanding of how to get the most out of everything. Everyone has gotten on the more RAM, faster CPU parade for decades; but most have no idea of how to properly use the capacity on hand. The Propeller has 32K bytes of RAM and 8 CPUs. My first computer was an IBM360 that took punch cards, had only 64Kram and one CPU. It also required the university to build a separate building to house it. In its day, it did all the work for the university and was used additionally for student classes.
Loopy has a point here. A cog running PASM can loop through a program for stepping all 3 or even 4 motors far faster than the motors can physically move. Pass the cog step rates for all 4 motors and it can easily do it.
+1 - Why use a second chip when you don't have to. If a little planning gets it down to one propeller you have not only saved the cost of the chip, but have avoided the extra software complications coordinating two chips entails.
BTW, one adc channel could be used to sense several switches by putting a pulldown resistor on the adc input and different value pullups on each switch.
Odd, I can't quote previous posts on my phone so this ifs a reply to the doubts as to whether all the steppers can be controlled with one cog.
Everyone else does it with a single threaded process so the idea of doing it with multitasking is actually the exception to the rule.
Doing it with no acceleration is trivial.
Doing it with basic acceleration takes more effort.
Marlin has some really snazzy functionality such as examining series of points and determining if it's an arc. If it determines yes, it uses its own calculations as opposed to the g-code provided. HUGE quality increase on curves.
Lastly, tinyg calculates not only velocity (feed rate) but acceleration (backlash prevention) but also rate of change of acceleration.
This additional treatment means my 3D printer at 200-300mm/s no longer tries to self destruct with vibration.
Unfortunately tinyg doesn't have 3D printer support.
Here it's our opportunity for ourselves and parallax.
If we could implement tinyg algorithms on a propeller based 3D printer board you would be AHEAD of the competition and not playing catch-up.