It looks good. Very similar to the one I did for my unipolar board. Did you use toner transfer or photo-resist?
Printable View
It looks good. Very similar to the one I did for my unipolar board. Did you use toner transfer or photo-resist?
High time for an update, a lot has been done.
All my PCB's are homemade: CNC drilled and photo-resist. I didn't get toner transfer to work properly.
A "parrallel cable 3" is supported upto ISE 10.1 wich is still available for download. So I made the programmer, installed 10.1 and with some trouble and problems finally managed to program the CPLD with your JED file.
I also designed a drive PCB, very quick, didn't pay much attention to "nice" or "PCB real estate" and used components I had, the only thing I did take care off: a good power gnd and signal gnd plane. If I can get this to work as I want a better, nicer one can be made.
The design has place for gate resistors and diodes, but I didn't put them in, just wires for the moment.
First tests were promising, the motor works better on this drive than on a DIY TB6560, much less vibration and almost never stalls.
Some observations:
The motor does make a slight hiss or whine in standby mode, on a Gecko it is dead silent.
I also saw the "mystery" glitches at zero-crossing and top of the sine waves.
The noise in standby should be solved by the slope compensation if I understood the tutorial correctly.
In your implementation there's no slope compensation in standby anymore.
So I wanted to compare it with the original one. Big problem: can't compile the original design with ISE 10.1, errors with the simulation libraries. I did spend almost 2 days on trying, nothing helps. Big frustration as I will probably never use that simulation anyway.
Then installed ISE 13.1 and YEP got it to compile. Then reprogrammed the CPLD using ISE 10.1 and my cable 3 programmer.
Apparently didn't make mistakes cause there's no magic smoke..
The drive seems to work almost the same but the noise during standby is (much?) less and the mystery glitches are gone.
It's difficult to compare when there are several days between the 2 tests, ideally I should build a second CPLD daughter PCB. This would make comparison much easier.
On your "10kHz" problem: I noticed something similar but isn't there another explanation: There's a full 50µsec cycle where the current is rising but doesn't reach the setpoint, on the next cycle it continues to rise and quickly reaches the setpoint. This makes it look like a 100µsec cycle with some glitches but is in fact 2 50µsec cycles required to reach the set current.
Using a higher supply voltage should solve this and apparently the slope compensation you implemented did it also.
I am currently testing with 24VDC, the same as I used with the TB6560, a gecko and PAc-Sci drive. Next will probably be 48VDC and some other motors.
I would also like to try 8 or 10 microsteps but don't know if I will be able to change the code and/or have the time to do it.
Are you able to compare with the original implementation and check the mystery glitches and hissing?
A pic of my quick and dirty drive... :
Good job! I was hoping someone else would build one so that we can compare results. I haven't worked with through hole components for a long time. They have the advantage of being easy to probe.
Here's my Verilog code for the 10 micro-step implementation. Most of the differences are in the sine generator.
It might be possible to get rid of the the glitches by optimizing the slope compensation. I did not try it yet since I don't have a POT in the circuit. I believe the glitches disappeared if I left the drive in the slow decay mode.
I am 99% sure that the 10khz issue was caused by the lack of slope compensation. The loop becomes unstable and alternates between maximum and minimum duty cycle.
I turned off the slope comp during standby because the drive enters the slow decay mode. I don't have the amount optimized, so it increased the current slightly if left on. It's very simple to leave it on if you wish. An improvement would be to reduce the current during standby. That will reduce the hiss. On my motors, the hiss is very soft and will only occur at one or two of the microstep positions.
I'm using 34v. I still need to build a higher voltage supply. The drive is more likely to resonate with higher voltage. Without damping, it is possible to end up with less speed when a higher voltage is used.
I've been doing a lot of reading on DSPs. I would like to try a closed loop current controller to deal with the midband resonace problem.
First off: Thanks very much for posting your implementation. The differences between yours and the original makes it easier for me to understand what changes are needed.
Last night tests left me with a dillema: mystery glitches in yours and none in the original. The used hardware was the same so I thought that there should be a problem in the code.
I checked your changes for the 10 µsteps and couldn't find anything wrong, but you also made quite a bit of other changes, like the decay.. wich I don't (yet) fully understand.
After pondering for a while on what to do next, I decided to modify the original one with only your changes for 10µsteps so I would be able to check if they come from the µstep changes or the other ones.
Managed to do this without much difficulty, but hey it's easy if you just have to compare 2 implementations...
The result however was awfull: a huge glitch on top of the current sine waves and the motor vibrates like hell.
After several hours of measuring, reading, thinking I finally found the problem:
The PWM values are reversed versus the QA counter values.
The definition for G100 must have a low QB counter value iso a high one and so on.
So I swapped the QB PWM values around for Asin and Bsin.
Reprogged the CPLD and it works, no more mystery glitches....
I overlooked this before when checking your 10µstep changes and still don't understand why it did work so well.
The glitches on your implementation are really small compared to the ones I had, cause must be the slow decay in yours (I think).
I can mail you my implementation if you want to check this.
Thanks again for posting yours, I would probably have spend a week or so to get it working.
Regards,
Luc.
I'm glad my code was helpful. I'm new to Verilog, so I'm learning as I go.
Some of the changes I made to the decay was for experimenting with mix mode decay, fast during decreasing and slow during rising current. It resulted in a distorted wave, so I did not continue. Right now it switches to slow decay only on standby.
Were you able to get rid of the glitches when using the fast mode decay? If so, I would be very interested in looking at your implementation. I don't know what is causing them. I think they might cause more vibration.
Do your motors currently have any hiss?
I modified the original code from 5 to 10 µsteps using your changes, but only the ones wich were relevant to the 10 microstepping.
And found the problem in the sine/cosine values.
It's fast decay when moving and recirculating during standby. There is some slight hissing during standby.
The slope compensation does reduce it but not completely. This could be due to my hardware or some fine tuning in the slope compensation is needed.
I'll try to do some more testing with other motors, higher supply and current.
Will keep you posted.
Luc.
Thanks. I will take a look at it. I would be very interested in your opinion on how well this drive work compared to the others you have. I had nothing to compare it to, other than my other boards.
I can only compare with a DIY TB6560, a PacSci and a Gecko.
The 2 last ones work just fine (of course).
The TB6560 looses steps makes noise and hisses.
The CPLD is a bit better than the TB6560 but also looses steps, we knew this already.
I have 5 different brands of Nema23 1-2 Nm motors (minimum 3pcs of each brand), all are 4 to 6 Amp per phase, thus out of the TB6560 range. This is why I wanted to try this CPLD design.
The noise and hiss it makes is no priority, nor is a morphing implementation as long as steps are lost.
What I do need is resonance compensation, mechanically or electronically.
Unfortunatly all my motors are single shaft, so a damper will be difficult.
I think that I understand the basic implementation for compensation in a drive but designing it will take a lot of time (wich I don't have much).
The microchip application (wich you pointed too) explains it as I understood it.
Did you have a look at the implementation, I'm interested in your opnion.
Regards,
Luc.
I haven't done extensive testing, but as far as I can tell, my board does not miss steps. How are you testing for it? What do you think is causing it? With my earlier designs, I found that adding optocoupling on-board often helped by removing any ground potential with the PC.
If your motors are single shaft, you can add the dampers to the ball screws. That's what I plan to do with my nema34 motors if I can't get the electronic damper to work.
Also, my board has no hiss except when it stops at certain phase angles. Even then, it is very soft. Perhaps you need more filtering because of the through hole design?
If I did not come across the DSP design, I would be be building 3 more units. But I find the DSP PID current control to be very interesting. It has potential for experimenting with closed loop position control. I have a bunch of encoders lying around.
I am going to build a modified version of the microchip board. The main change is that I will use the IR2103 instead of FANxxxx because it has less pins.
In theory, Microchip has fully functional code. I downloaded and compiled it successfully. I just need to design the hardware.
Opto's already installed, hidden behind the daughter PCB.
What I do for "losing steps" testing:
- Set a low start speed
- Set a low acceleration
- issue a series of moves (at least 5) in one direction then move back in a single move to the original postion, do this 10 times in a loop.
This causes the motor to pass slowly through all resonance frequencies and the destination offset indicates the kind of lost steps.
By just moving back and forth the lost steps in the 2 directions cancel each other.
I did reload your implementation and the results are the same.
Differences between yours and mine:
- No gate resistors, don't think this is the cause.
- No damper, this could very well be it.
- Your Keling motor might be better than the ones I use.
Sometimes a damper can't be installed on the screw, no space. See pic below of a small machine I'm building. on the left will be a small pulley with a belt to the stepper.
PS: This is the 2nd time that a message get's lost when posting and I have to retype everything. Looks like the Zone has a problem.
lucas, I haven't been following this discussion in great detail, but I noticed your mention of losing steps in a TB6560 driver as well as with your current driver.
I don't know whether or not this is relevant to your current problem, but I thought that I'd note that some reports of missed steps with TB6560-based drivers have apparently been traced to signal timing issues, namely a slow response of the optoisolator(s) on the direction input (which is presumably a level-based signal) vs. quick response to the matching step signal (which is a positive-going edge-triggered signal), such that a reversal of direction may issue the step command before the associated direction signal has changed to its intended value. While that symptom is often noted when the optoisolator on a step input is bypassed while the opto remains in place on the corresponding direction pin, it might possibly be a factor even when both signals pass through optos, especially slow ones.
Obviously this may have nothing whatsoever to do with your current situation.
How severe are the missing steps? How far off is the rotor?
My test involved running the motor in one direction near max speed. When it stops, I check the alignment mark. Then I reverse the direction and then check it again. I could not detect any misalignment even under a microscope.
I will try your test as soon as I get everything set up again.
Perhaps you can try accelerating it quickly to avoid the resonance points. If it still skips, I would suspect the step/dir signals rather than the motor vibration.
You could also pause after a direction change to ensure that the problem mentioned by Doorknob is ruled out.
What pulse width are you using for the step signal? On my machine, it is set to 5 uS. If it is too narrow, the drive would ignore it.
You could also try bypassing the optocouplers. I am currently not using any. I used a 1k series resistor to provide some protection.