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...
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.
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...
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 lineI changed tom_error: .db 10, "???", 02) changed the initial parameter bank to 3...m_error: .db 13,10, "???", 0
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...
Oh... how did I miss post #61 ...
hehe.. same solution...
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
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 : szrelchip@gmail.com
Last edited by elchip; 11-23-2009 at 02:13 AM.
Please share the source code if possible ..
Thanks !
Emil
http://www.bg-cnc.com/wordpress/
http://www.dailycnc.eu/
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
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
moghul40@yahoo.com
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.
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
dali neko ima iisprogramiran cip za servo 3
hvala
if someone has a chip programmed for servo 3 and which is checked at
thanks
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
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.
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.