586,567 active members*
3,638 visitors online*
Register for free
Login
IndustryArena Forum > CNC Electronics > Servo Motors / Drives > Elm-Chan smc servo controller programming and tuning
Page 4 of 5 2345
Results 61 to 80 of 98
  1. #61
    Join Date
    May 2006
    Posts
    2420
    I did some quick googling, and here is a quote from one of the sites :

    EEPROM corruption from brownouts
    Brownouts can cause the first location of the on-board EEPROM to be overwritten.

    In addition to the precautions elsewhere on this Wiki, consider not using the first EEPROM location.

    Brownout fuses
    If the voltage on your chip goes too low it can start executing random instructions, or corrupt the flash/eeprom (see above) so just always set the BOD unless there’s some good reason not to!

    Food for thought, it may be worth using the BOD, and see if that helps, I know I haven't enabled it on my boards...

    Russell.

  2. #62
    Join Date
    Mar 2007
    Posts
    215
    It just occurred to me, we may want to have BOD enabled (brown out detection)...

    And set it at the highest level under 5v...

    I have prep'd a couple of AVRs with some different settings, will test them shortly when I get home...

  3. #63
    Join Date
    Mar 2007
    Posts
    215
    Well, I changed a couple of things, so I'm not exactly sure what fixed it...

    I tried two different AVRs... The common changes were:

    1) fixed the compiler warning: .cseg .db misalignment - padding zero byte
    This line
    m_error: .db 10, "???", 0
    I changed to
    m_error: .db 13,10, "???", 0
    2) changed the initial parameter bank to 3...

    The difference between the two AVRs, one had brown out detection enabled and the other didn't...

    Now... both of them are working ok, there is no corruption of ANY of the parameter banks...

    With the addition of BOD enabled, the board no longer spits put a bunch of garbage on the rs232 port when it powers up...

    Anyway, according to Atmel's papers on eeprom, BOD should be enabled to prevent corruption, it holds the chip in reset until the voltage is sufficient ...

    Give it a try and see how it works for you...

  4. #64
    Join Date
    Mar 2007
    Posts
    215
    Oh... how did I miss post #61 ...

    hehe.. same solution...

  5. #65
    Join Date
    May 2006
    Posts
    2420
    Quote Originally Posted by krazatchu View Post
    Oh... how did I miss post #61 ...

    hehe.. same solution...
    Ha, thats funny, I will give it a go as well, seems like an easy fix

    Russell.

  6. #66
    Join Date
    Jan 2006
    Posts
    121

    Warnings

    Quote Originally Posted by krazatchu View Post
    Allrighty, I tried the 2313 which had both the hex and the epp loaded...
    However the result was the same...

    On first turn on, the values came up as they were in the source code...
    I changed them to match the motor and saved with w0...
    After a few power cycles they changed...

    A bit of testing indicates that parameter bank 0 and 1 change but 2 and 3 don't... may try loading from 2 or 3 instead of 0

    I will have to take a look at the warnings WINAVR produced during compilation...

    10 of the warnings are from registers being defined twice, once in the avr.inc file and once in the smc3a.asm file. You can go into the avr.inc file and comment out these lines

    ;.def T6H = r7
    ;.def T8L = r8
    ;.def T8H = r9
    ;.def T10L = r10
    ;.def T10H = r11
    ;.def T12L = r12
    ;.def T12H = r13
    ;.def T14L = r14
    ;.def T14H = r15

    because the are define in the smc3a.asm as

    .def _0 = r15 ;Permanent zero register

    .def _PvEnc = r14 ;Previous encoder signal A/B
    .def _PvDir = r13 ;Previous direction
    .def _CtDiv = r12 ;1/83 divider

    .def _PosH = r11 ;Current position (circular counter)
    .def _PosL = r10 ;/
    .def _CmdH = r9 ;Commanded position (circular counter)
    .def _CmdL = r8 ;/
    .def _CmdF = r7 ;Gear fraction


    The last warning comes from the length (wants it to be a multiple of 2) of the strings and the end of the main file. Inserting or deleting a space will take care of that.

    Jon

  7. #67
    Join Date
    Aug 2009
    Posts
    7

    SMC3 terminal

    Here is my little terminal for these servo ;-)
    You need VB6 runtime files and no need to setup.
    It work on COM1 and 38400 baud.
    Any comment is welcome but remember it's amateur.
    Regards to all
    Robert
    SMC3 terminal.zip
    Presentation on YOUTUBE : [nomedia]www.youtube.com/watch?v=NFAegIl2e_c[/nomedia]

    Sorry comment is on my language - Serbian
    contact : [email protected]

  8. #68
    Join Date
    May 2006
    Posts
    47

    Please share the source code if possible ..

    Please share the source code if possible ..

    Thanks !

    Emil
    http://www.bg-cnc.com/wordpress/
    http://www.dailycnc.eu/

  9. #69
    Join Date
    Apr 2004
    Posts
    14
    Quote Originally Posted by elchip View Post
    Here is my little terminal for these servo ;-)
    Thanks this works great for me.

    I am driving a very small motor for a camera mount I first tried a TC4424 to drive them but there was no torque, now I have a L6203 driver with LM393 for current limiting and the unit resets every time I try to make a move in step/direction mode. The motor will run in the free mode. I have tried reversing the motor leads but same result. Any hints on this one? I'm a machinist not an electronics guy.
    Greg Nuspel

  10. #70
    Join Date
    Aug 2009
    Posts
    7
    Quote Originally Posted by Like2Trike View Post
    Thanks this works great for me.

    I am driving a very small motor for a camera mount I first tried a TC4424 to drive them but there was no torque, now I have a L6203 driver with LM393 for current limiting and the unit resets every time I try to make a move in step/direction mode. The motor will run in the free mode. I have tried reversing the motor leads but same result. Any hints on this one? I'm a machinist not an electronics guy.
    You need to post your schematic - we dont have magic eye .. ;-)

  11. #71
    Join Date
    Apr 2004
    Posts
    14
    Quote Originally Posted by elchip View Post
    You need to post your schematic - we dont have magic eye .. ;-)
    Sorry I figured it out, I was driving the serial at ttl levels so I just had to jumper out the 74HC14.
    Greg Nuspel

  12. #72
    Join Date
    Apr 2006
    Posts
    85
    hello all
    i have also made elm dc servo drive but some special problem is harae. some time after power failer eeprm data erased and drive o. please any one tell me how can i put p0 to p6 permanently in code?
    thanks
    [email protected]

  13. #73
    Join Date
    Aug 2009
    Posts
    7

    Wink

    Quote Originally Posted by moghul View Post
    hello all
    i have also made elm dc servo drive but some special problem is harae. some time after power failer eeprm data erased and drive o. please any one tell me how can i put p0 to p6 permanently in code?
    thanks
    [email protected]
    Redefine P0 to P6 variables to constant and give permanent number to every constant.

  14. #74
    Join Date
    Dec 2006
    Posts
    1

    Cool Reseting problems - further...

    Quote Originally Posted by elchip View Post
    Redefine P0 to P6 variables to constant and give permanent number to every constant.
    Definitely not way i'll go.Eeprom corruption points on some serious instabilities which may apear later in exploatation of driver.If BOD level is set to 4.3V and you are still losing eeprom settings,board layout is first to blame.My last board is totally minimalistic (no max chip,pcb 100x75 mm singlesided,uses ir2110 + cheepest buz11) and works with 12V 250w motors with HUGE inrush currents...all eeprom troubles dissapeared after setting bod level.:wee:

    p.s. nije ti los programcic za komunikaciju,lakse nego kuckati komande

  15. #75
    Join Date
    Aug 2009
    Posts
    7

    Wink

    Quote Originally Posted by cida View Post
    p.s. nije ti los programcic za komunikaciju,lakse nego kuckati komande
    Inace UHU je cista prevara ... i osnov mu je bas ovaj kontroler.
    Ja sam takodje prepravio ovaj izvorni kod za ATTINY2313 koji potpuno menja UHU u UHU ploci...
    A VB6 program je cisto da zaintrigiram ljude ovde...hehe
    Nemislis valjda da nemam i komercijalnu varijantu ?
    A sto se tice SMC3 - takav kakav je sa izlanim stepenom sa IR2184 x 2 radi besprekorno i sa PMDC motorima od 500W.
    Stvar je u ploci a ne u mirokontroleru!

    Masta moze svasta..... :rainfro:
    Here is some protoboard of these controller :
    http://elchip.net/eshop/popup_image.php?pID=29

  16. #76
    Join Date
    Jan 2009
    Posts
    32
    dali neko ima iisprogramiran cip za servo 3
    hvala

  17. #77
    Join Date
    Jan 2009
    Posts
    32
    if someone has a chip programmed for servo 3 and which is checked at
    thanks

  18. #78
    Join Date
    Sep 2008
    Posts
    7
    Hello guys , I have my controller is running.
    And I have to tune it properly.
    My dc motor is 2.2 amp and 24V with optical encoder 2000 ppr.
    I am using original smc3a code.
    I tried to tune it myself, but no success. When I power up the controller it didn't move the motor in mode0 and mode1. But when I put the motor in mode2 sometime it spins erratically or don't at all. When I put it in mode3 it just jerk off
    and resets. Sometime spins at full speed. Each time motor behaves unexpected.

    What can I do to tune my motors ? Any tuning utility or step by step instruction ? Pls help me in tuning process.

    PLz mention how I can enter commands for each mode.

    Have a nice day

  19. #79
    Join Date
    May 2006
    Posts
    2420
    Mode 3 is the one you want, it is position mode, if it is running away at startup then it is possible that your encoder is wired in reverse. Try swapping the encoder A and B signals, leave everything else as it is and try again.

    The drive will revert to mode 0 at error, and you will have to send it a mode 3 command to fire it up again, you will probably do this a lot while tuning.

    I set my drives code to default to mode 3 at startup, so when I fire up my machine it is all good to go.

    Try that and see how you go, also there are some more settings that will affect tuning dramatically, p5 (from memory) caused me some grief for a while tuning my drives.

    Cheers.

    Russell.

  20. #80
    Join Date
    May 2006
    Posts
    2420
    Also check p6 is set to 256, this is the step multiplier, if it is 0 bad things happen, I know all about that...

    256 means a step multiplier of 1, therefore no multiplier as such. Remember to read the smc3a txt file, not the smc3 (original) as the different firmware works differently.

    Russell.

Page 4 of 5 2345

Similar Threads

  1. Replies: 3
    Last Post: 08-08-2016, 08:55 AM
  2. Elm Chan SMC Servo Controller Help!
    By alielsayid in forum Open Source Controller Boards
    Replies: 1
    Last Post: 02-25-2014, 07:26 AM
  3. elm chan dc servo controller
    By visky in forum PIC Programing / Design
    Replies: 0
    Last Post: 01-28-2014, 05:06 PM
  4. Elm Chan ( MCU ) + UHU ( power ) = BG DC SERVO
    By emilcnc in forum Open Source Controller Boards
    Replies: 3
    Last Post: 01-02-2010, 11:44 PM
  5. Elm-Chan smc servo controller programming and tuning
    By waleed alhadidi in forum Open Source Controller Boards
    Replies: 3
    Last Post: 04-18-2008, 09:00 PM

Tags for this Thread

Posting Permissions

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