Page 1 of 3 123 LastLast
  1. #1
    dsc's Avatar
    Lives in Lincoln, United Kingdom. Last Activity: 15 Hours Ago Has been a member for 5-6 years. Has a total post count of 248. Received thanks 1 times, giving thanks to others 9 times.
    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:

    Click image for larger version. 

Name:	screening.png 
Views:	161 
Size:	21.7 KB 
ID:	10858

    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.

  2. #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.
    Old router build log here. New router build log here. Lathe build log here.
    Electric motorbike project here.

  3. #3
    dsc's Avatar
    Lives in Lincoln, United Kingdom. Last Activity: 15 Hours Ago Has been a member for 5-6 years. Has a total post count of 248. Received thanks 1 times, giving thanks to others 9 times.
    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.

  4. #4
    Quote Originally Posted by dsc View Post
    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?
    Yes I would connect them all together but each cable screen should be earthed at one end only, the other ends should be insulated with some heat shrink sleeving for example.


    should TMR2IF be cleared at each loop ?
    Last edited by EddyCurrent; 24-11-2013 at 08:21 PM.

  5. #5
    dsc's Avatar
    Lives in Lincoln, United Kingdom. Last Activity: 15 Hours Ago Has been a member for 5-6 years. Has a total post count of 248. Received thanks 1 times, giving thanks to others 9 times.
    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:

    Click image for larger version. 

Name:	earthed_not_neg.png 
Views:	99 
Size:	9.7 KB 
ID:	10861

    and here's after:

    Click image for larger version. 

Name:	earthed_neg.png 
Views:	83 
Size:	10.7 KB 
ID:	10862

    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.

  6. #6
    dsc's Avatar
    Lives in Lincoln, United Kingdom. Last Activity: 15 Hours Ago Has been a member for 5-6 years. Has a total post count of 248. Received thanks 1 times, giving thanks to others 9 times.
    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:

    Click image for larger version. 

Name:	noise_amp_period.PNG 
Views:	78 
Size:	24.8 KB 
ID:	10865

    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:

    Click image for larger version. 

Name:	disconn_vs_conn.PNG 
Views:	88 
Size:	23.9 KB 
ID:	10866

    3) there's loads of spikes on top of the PWM signal, see here:

    Click image for larger version. 

Name:	noise_zoom.PNG 
Views:	83 
Size:	11.7 KB 
ID:	10867

    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.

  7. #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.

  8. #8
    dsc's Avatar
    Lives in Lincoln, United Kingdom. Last Activity: 15 Hours Ago Has been a member for 5-6 years. Has a total post count of 248. Received thanks 1 times, giving thanks to others 9 times.
    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.

  9. #9
    dsc's Avatar
    Lives in Lincoln, United Kingdom. Last Activity: 15 Hours Ago Has been a member for 5-6 years. Has a total post count of 248. Received thanks 1 times, giving thanks to others 9 times.
    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:

    Click image for larger version. 

Name:	bat_vs_sup.PNG 
Views:	89 
Size:	22.6 KB 
ID:	10868

    I'll stick with the plug-in supply and keep everything earthed.

    Regards,
    dsc.

  10. #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 ?

Page 1 of 3 123 LastLast

Similar Threads

  1. BUILD LOG: operation cnc
    By kingcreaky in forum DIY Router Build Logs
    Replies: 174
    Last Post: 14-08-2013, 06:14 PM
  2. maximum deflection - sanity check
    By dsc in forum Gantry/Router Machines & Building
    Replies: 6
    Last Post: 11-02-2013, 09:33 AM
  3. sanity check - constant running, loads and more
    By dsc in forum Stepper & Servo Motors
    Replies: 4
    Last Post: 26-11-2012, 12:26 PM
  4. Toroidal transformer voltages - sanity check needed!
    By m_c in forum General Electronics
    Replies: 16
    Last Post: 03-10-2011, 08:34 PM
  5. I am questioning my sanity....
    By irving2008 in forum General Discussion
    Replies: 16
    Last Post: 11-02-2010, 01:15 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •