588,653 active members*
6,306 visitors online*
Register for free
Login
IndustryArena Forum > CNC Electronics > Servo Motors / Drives > Elm-Chan smc servo controller programming and tuning
Page 3 of 5 12345
Results 41 to 60 of 98
  1. #41
    Join Date
    May 2006
    Posts
    2420
    Cool, I wish I had markets like that here, I sure could use a couple of servo's right now, I have discovered one of mine has issues.

    The Elm works fine with the 74HC14 instead of a max 232, and is a bit cheaper - 30c Vs $2.50, not high finance but it all adds up.

    I put the standard DB9 Female connectors on my boards but now wish I just used the standard screw terminals, as it is a pain to unplug the programming cable between each board. Either that or wire in a switch to switch between axis's to be tuned.

    I used the SOIC 2184's on my design, they work fine but as I am getting old the next design will use DIL packages that I can just plug into sockets...Like you mention they are not as bad as some parts, I have soldered a TSSOP package (Allegro A3986) onto a home made board, still have nightmares about that one !

    Nice work on linking the post # in the UHU thread, that will save a LOT of time.

    Russell.

  2. #42
    Join Date
    Mar 2007
    Posts
    215
    The markets here are great, one of my favorite things about Korea...
    Out of curiosity, what are the specs on your servos and what are you driving?

    Already got the max232 SMDs, they were about 1.10 USD, the SMD HC14s were about 25 cents...

    I still debating what current limit to include, Kreutz's is very nice but the part count is higher...
    The TL082 implementation has fewer parts but I'm skeptical drawing the power (-12) from the Max232...

    From the MAX232 datasheet...
    A small amount of power may be drawn from the +10V
    (V+) and -10V (V-) outputs to power external circuitry
    (see the Typical Operating Characteristics section),
    except on the MAX225 and MAX245–MAX247, where
    these pins are not available. V+ and V- are not regulated,
    so the output voltage drops with increasing load current.
    Do not load V+ and V- to a point that violates the minimum
    ±5V EIA/TIA-232E driver output voltage when
    sourcing current from V+ and V- to external circuitry.
    There is a chart in the "Typical Operating Characteristics" section...
    Indicates 1uf caps on the max232 will give a better supply vs draw current...
    Also shows the voltage will drop to 8/-8 with a draw around 12 mA....

    Available current draw also drops as data rate increases... Might affect tuning but shouldn't be a problem otherwise ...

    From the TL082 datasheet, Supply current = 3.6 to 5.6 mA ...
    Around this level the max232 will supply roughly 9/-9 volts...

    So perhaps it's ok... Best to use 1uF, perhaps tantalum is better...

  3. #43
    Join Date
    May 2006
    Posts
    2420
    My servo's are second hand and didn't have anything marked on them, but they run well with 24V so that is what I am using. My guess is about the 150-200Watt range, not huge but plenty for my needs, which is my router table machine, 650 by 600 cutting area and 100mm of Z. Threaded rod leadscrew.

    I haven't looked at either current limit schematic yet so I can't add anything yet, I will try to get some time over the weekend.

    Cheers.

    Russell.

  4. #44
    Join Date
    Mar 2007
    Posts
    215
    Well, I got a board built...

    It's taking some time to figure out the tuning equations...
    Also need to get a USB to serial converter since my laptop doesn't have rs232...

    Anyhow, I put together an excel app to calculate the parameters...
    It might be just me, but I think there are some errors/omissions with the parameter equations on the ELMCHAN website ...

    I worked backwards from the given params in the source file, so I think these are ok but they should be checked...

    Anyhow, take a look at the XML calculator and please confirm the validity of the equations...

    Thanks!
    Attached Files Attached Files

  5. #45
    Join Date
    Feb 2005
    Posts
    48
    I place the outline of Chan modified for my Pcb

    Posto lo schema di Chan modificato per il mio Pcb
    Attached Thumbnails Attached Thumbnails ELM-sch.jpg  
    ICQ N° 224-091-233
    http://www.cnc-dag50.it/
    Ciao Dario

  6. #46
    Join Date
    May 2006
    Posts
    47

    please attach PCB files - SCH and BRD :) ...

    to Dag-50

    please attach PCB files - SCH and BRD ...

    Thanks

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

  7. #47
    Join Date
    Jan 2006
    Posts
    121
    Anyone else have a problem opening the Eagle files in post #45 ??

    Jon

    [edit] Apparently so... because they're gone! Illegal Eagle?[/edit]

  8. #48
    Join Date
    Jan 2006
    Posts
    121
    Any substitutes for ATTINY2313-20PU ? None of my normal suppliers have them in stock, best is 1 month lead time.

    Jon

    [edit] Found some at Jameco [/edi]

  9. #49
    Join Date
    Apr 2004
    Posts
    22
    Hi,

    Perhaps someone can shed some light on a question I have, If you have a different encoder i.e it has 400 pulses per rev rather than lets say 200 ppr how do I set that in the driver ? or do I need to set that in the driver ? Maybe I'm missing something. HELP !!!! Thanks to any one that can put me out of my missery. By the way I will be driving it from Mach3 or Linux EMC.

    Thanks Again

    Mike.

  10. #50
    Join Date
    Mar 2007
    Posts
    215
    You need to connect the board to a computer by way of RS232 cable...

    Then use a terminal program like the one included in windows, Hyperterm...

    Then you need to calculate the parameter values p0 to p7 ...
    You can find the equations to calculate the parameters on the ELM Chan Website..
    http://elm-chan.org/works/smc/report_e.html

    You can also try the excel spreadsheet I posted on page 4 of this thread...
    However, I cannot confirm that the excel spreadsheet is correct as I don't actually have a servo drive running yet ...

    Perhaps someone with some experience can confirm if the equations in the spreadsheet are correct...

  11. #51
    Join Date
    May 2006
    Posts
    2420
    Quote Originally Posted by mikegaylor View Post
    Hi,

    Perhaps someone can shed some light on a question I have, If you have a different encoder i.e it has 400 pulses per rev rather than lets say 200 ppr how do I set that in the driver ? or do I need to set that in the driver ? Maybe I'm missing something. HELP !!!! Thanks to any one that can put me out of my missery. By the way I will be driving it from Mach3 or Linux EMC.

    Thanks Again

    Mike.
    Hi Mike, you just setup the pulses per rev in Mach or EMC, so if you have the 400 count per revolution encoder, multiply this by 4 for the quadrature, and you are in business, in this example 1600 pulses per revolution. The drive will just go with the flow

    As krazatchu mentioned you still have to configure the drive, which is easy, I have been meaning to do a quick walkthrough and post here but have been too busy playing with my newly working router (with Elm Chan boards and EMC )

    Also check the .txt files with the smc3a hex file, the parameters on the Elm Chan site are misleading, P6 is actually a step multiplier, not a max vel for the drive...and I think P7 does nothing...better check that.

    Russell.

  12. #52
    Join Date
    Mar 2007
    Posts
    215
    In the source code SM3a, p6 is stated as "P6,Gear ratio for pulsed input"...

    From the SM3a.txt file
    "o Extened Pulsed Input Function
    - Pulse Multiplyer: Gear ratio (8.8 fixed-point) can be set with parameter
    #6, 256 means 1.0. Parameter #7 has no effect."

    Anyhow, I just it working... I had the encoder wires reversed so mode 2 and 3 would lead to error...
    The motor I have must be from a photocopier since Google doesn't turn up any info...
    I tuned the params P1, P2 and P3 by trial and error...

    I should be able to verify the proper equations in the excel spreadsheet I posted on page 4...
    I will post an update once I make sure they are correct.. .should help with tuning...

    I'm wondering about the necessity of the external over current protection...
    I think if the parameters are properly configured, the drive will error out if the motor gets stuck when in positioning mode 3...

    On more point of consideration... from looking thru the source it seems the PWM will never be fully 100% or 0%...
    This is similar in implementation to the UHU drive... Where the motor power supply should be roughly 15% higher than the motor rating...

    From the source:
    "Clip output voltage between -240 and +240.
    Limit minimum duty ratio to 1/16 for bootstrap
    type FET driver."

    Which would be 6.25%... (100 - (240*100 / 256))
    At 24 volts this is a 1.5 volt loss... Perhaps there are other losses to be considered as well..
    I'm running my 24 volt motor at roughly 28 volts...
    I will put the voltmeter on it and see what it runs at full speed...
    Either way it doesn't seem to be getting hot...

  13. #53
    Join Date
    May 2006
    Posts
    2420
    Quote Originally Posted by krazatchu View Post
    I'm wondering about the necessity of the external over current protection...

    I think if the parameters are properly configured, the drive will error out if the motor gets stuck when in positioning mode 3...
    That is what mine does, had plenty of crashes while setting up my machine

    Russell.

  14. #54
    Join Date
    Mar 2007
    Posts
    215
    Interestingly, the hottest component on the board is the 7805...

    While designing a breakout board... I started thinking about using a micro-atx pc case and pc psu to provide the 12 and 5 for the drivers as well as the break out board...

    It should be much cheaper and easier than buying/building a case...
    I could use a molex 20 pin connector on the bread out board for power and on/off..
    And a molex 4 on each of the drivers for 12 and 5 power...

    Also thinking about running the driver error signal to e-stop...

  15. #55
    Join Date
    Mar 2007
    Posts
    215
    Russell,

    Have you had any problems with the motor parameters changing after cycling the power?

    I'm using the Hex file you posted and tried it on 2 different AVRs...

    I just re-compiled the source and uploaded the hex to a fresh 2313...
    I also loaded the EPP, perhaps it's a result of a formatting error without the EPP...
    I haven't tested it yet, will try it a bit later today...

  16. #56
    Join Date
    May 2006
    Posts
    2420
    Quote Originally Posted by krazatchu View Post
    Russell,

    Have you had any problems with the motor parameters changing after cycling the power?
    Funny you say that, but YES ! I was going to post this on here tonight, you beat me to it, I had my machine running and was going to give a little demo to some friends and one of the axis's kept faulting, I didn't suspect parameters as I didn't think they would change.

    After about 4 hours straight fault finding, including changing encoders, swapping drives out with spares, swapping H Bridges out with spares (my H Bridges are separate from the processor board) I discovered that parameter P0 had strangely changed itself to -1 (chair)

    I put it down to noise as I have only just started using my router to do actual cutting instead of test runs, I am/was going to install some filtering on the mains line to see if that helps.

    Any ideas ?

    Cheers.

    Russell.

  17. #57
    Join Date
    May 2006
    Posts
    2420
    Oh yeah, forgot to mention, I have been saving the parameters to memory on the drive using the W0 command, it is easy to forget that one

    Russell.

  18. #58
    Join Date
    Mar 2007
    Posts
    215
    Same here... Sometimes P0 goes to -1, sometimes it just decreases random amounts...
    As well the other parameters are generally acting the same way...

    I'm also using W0 to save the params...

    I forgot to bring the AVR home I flashed today, I will test it early tomorrow and post the results...

    It could be noise, it occurs very frequently in my case... as well my h-bridge is on the same pcb...
    However... if it were noise, it prolly would have showed up on the UHU as well...

    When you programed the 2313, did you also load the eep onto it? There might have been some required formatting for the parameter storage...

  19. #59
    Join Date
    Mar 2007
    Posts
    215
    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...

  20. #60
    Join Date
    May 2006
    Posts
    2420
    My drives had the fault after about 25-30 power ups, then two had it at more or less the same time, which kinda makes me think it is noise related, I will try the different banks as well and see.

    Russell.

Page 3 of 5 12345

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
  •