-
24-11-2013 #1
I'm using a HBS86 + 8Nm motor with a 68VDC supply and driving this with a PIC based uC system via a PWM output. I've coded up a ramp start function, which generates a PWM with a variable frequency to ramp the motor up from 60RPM to 240RPM. On the scope all looks good, on the motor it works, but I can hear the motor sometimes glitching, as if it's loosing steps. I've even seen a 'positioning error' once on the driver, it needed a power cycle afterwards to get things going again. I'm using screened cables, but currently haven't got the screens connected, so I thought maybe this is the reason. Here's how it's connected:
I've numbered the screens, should all 1-3 be connected to 4 - E(arth) / chassis? I'm guessing I need to put a link between the E(arth) terminal and the chassis as well to get the whole chassis earthed?
Thanks in advance for any suggestions.
Regards,
dsc.Last edited by dsc; 24-11-2013 at 03:30 PM.
-
24-11-2013 #2
This is most likely to be a software problem. In what language have you programmed the PIC? If you don't mind posting the code then I'll have a look at it for you. I expect it'll be the PIC not outputting pulses with a smoothly changing frequency, e.g:
Instead of,
|_|_|_|__|___|____|____|____| ...
Something like,
_|_|_|____|__|___|____|____|____| ...
This can be caused by things like stopping the output (briefly) whilst calculating the period which would introduce an additional delay. Are you using the hardware PWM module, or doing it 'manually' with a loop?Last edited by Jonathan; 24-11-2013 at 04:00 PM.
-
24-11-2013 #3
Thanks Jonathan, on the scope it looks like the top example from your reply. I can post a scope recording if I figure out how to record with the fancy model I've borrowed from work. The function for the slow ramp is below, coded in C:
void slow_ramp(void)
{
//PWM code for slow ramp start
CCPR1L = 0b00000010; //set to 2, so pulse width is 2 x 16 = 32 with 16 prescaler
while (PR2 != 18) //ramp up speed slowly from 60RPM [PR2 = 77] to 240RPM [PR2 = 18]
{
while (TMR2IF == 0) {} //wait for overflow
PR2--;
__delay_ms(5);
}
}
Using the hardware PWM module on the PIC.
Regards,
dsc.
-
24-11-2013 #4
-
24-11-2013 #5
I've connected the screen (one end, the other is tied back) for the PUL / DIR inputs into the E(arth) on the PSU, not much difference though, here's a shot before the screen got connected:
and here's after:
Minimal difference, although there's a lot of noise on that line (that's the PUL- / GND scopped). Not sure what it is, or how to get rid of it. On the other hand, the proto board is a mess full of breadboard wires, so isn't exactly super noise resistant.
I can't capture a long scope, I can only do a print screen kind of capture which isn't good enough to show how the PWM frequency changes. I can see a rolling effect ie. frequency increasing on the scope when the motor starts, but I don't know what causes the glitches on the motor. It stopped again with a positioning error today, don't know why though.
EDIT: here's a video, although it's hard to hear the glitches:
Regards,
dsc.Last edited by dsc; 24-11-2013 at 11:22 PM.
-
26-11-2013 #6
I've done some further testing on this, here's my findings:
1) as soon as I plug the DC supply in, there's noise on the PIC lines. It doesn't matter if the PIC lines connected to the driver or not, the noise is still there:
It's periodical, with a period of 11.5us, which gives a frequency of around 87kHz.
2) plugging the PIC control lines to the driver, causes the low levels to jump up by around 100mV, I wasn't expecting that to be honest:
3) there's loads of spikes on top of the PWM signal, see here:
Not sure this makes a lot of difference, the high level trigger for the HBS86 is > 3.5VDC and low is < 0.5VDC, so it should behave itself.
Any ideas on how to tame this? screening to earth doesn't seem to affect the noise at all. I've also tried ferrites, with not a lot of luck.
Regards,
dsc.Last edited by dsc; 26-11-2013 at 09:53 AM.
-
26-11-2013 #7
Chances are it's a switch mode dc supply, in cases like this I used to connect the circuit to batteries as this eliminates a lot of problems straight away and indicates where the main problem lies.
-
26-11-2013 #8
Cheers EddyCurrent, I was thinking it's something to do with the plug-in DC power supply I'm using for the PIC circuitry running in parallel with the big 68VDC PSU. I will try a 9VDC battery and report back.
Regards,
dsc.
-
27-11-2013 #9
I've switched to a 9VDC battery, not much difference, after which I've earthed the driver chassis, which dropped the noise levels significantly. Comparison between a battery supply and plug-in DC supply with the driver chassis earthed:
I'll stick with the plug-in supply and keep everything earthed.
Regards,
dsc.
-
27-11-2013 #10
That's good, the main thing with trying a battery is to remove that doubt so at least now you know the PSU is okay.
So with noise levels dropped has it improved the operation ?
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
BUILD LOG: operation cnc
By kingcreaky in forum DIY Router Build LogsReplies: 174Last Post: 14-08-2013, 06:14 PM -
maximum deflection - sanity check
By dsc in forum Gantry/Router Machines & BuildingReplies: 6Last Post: 11-02-2013, 09:33 AM -
sanity check - constant running, loads and more
By dsc in forum Stepper & Servo MotorsReplies: 4Last Post: 26-11-2012, 12:26 PM -
Toroidal transformer voltages - sanity check needed!
By m_c in forum General ElectronicsReplies: 16Last Post: 03-10-2011, 08:34 PM -
I am questioning my sanity....
By irving2008 in forum General DiscussionReplies: 16Last Post: 11-02-2010, 01:15 PM
Bookmarks