Thread: Help! DIY 4 amp L297/6203 driver
Thanks Irving, Is that an offer to create the code? :clap:
I have a programmer that I bought many years ago, but never built, that supports that chip. So the final decision is wether to include the short cuircuit protection as it dose complicate the board a tad. Is it really worth the hassel? I first thought it was also an internal overload but after finding the application sheet it is only for output short circuit, maybe I'll just have to be carefull with the motor wiring :whistling:
I'd use the 12F675 (or possibly 12F629, which is the same as the 12F675, except doesn't have the A2D converters) - the 16F84 is significantly larger than needed (only 2 of the IO pins are required), and also needs an external oscillator.
10F20x doesn't have an INT input, so I'd discount them (although there's nothing stopping you from polling an IO pin instead of waiting for the interrupt signal).
I've got some spare 12F683s from a project I didn't need them for - they're similar to the '675, except have a PWM output capability (I was going to use them for a fan speed controller).
I'd be willing to program one up and send it on - but I'd feel a little uncomfortable doing the code without knowing exactly how it's meant to work (willing to discuss it though).
Wow thanks guys, thats a great help, now if i could just get someone to convert the schematic to a pcb and mill it for me.....:lmao:
The short circuit protection is for the the output chips, (see below)
Thanks for the very kind offer, Unfortunatly I have no idea where to start with the code. I can only guess that an output needs to modulate (or switch low) the vref line to set the hold current (possibly adjustable from a trim pot) and then an input needs to look for the clock pulse to reset full current when a signal is seen?
I would imagine that the timing's are going to be the hardest bit as it might loss the first step whilst switching back to full current?
Is there any reason why this couldnt be put on a separate board and just send the Vref lineto the driver board with the other signals?
Well lets think this through...
Whats the slowest meaningful step rate, 1 step/second? how long after the last step do we want to wait, 10 seconds?
So every time there is a clock pulse, reload an 'n' second counter. when the counter reaches 0 start a PWM output with a frequency of 100Hz say, and a mark/space ratio controlled from 2 dip switches giving 100 (off), 75, 50 and 25 settings
Use a couple more DIP switches to set the initial delay 'n', say 20, 10, 5, 2 seconds.
If INT0 (external)
read delay valueIf INT1 (main counter reached 0)
reset main counter to delay value
set PWM output high (open collector)
read PWM valueMain program:
initialise PWN registers
start PWM running
set PWM frequencyobviously, depending on the chip used you may have to synthesise the PWM function with counters and a lookup table to determine the correct counts for each DIP setting.
set PWM output high
configure counter clock divider
configure INT0 on external trailing edge
configure INT1 on counter timeout
read delay value
reset main counter to delay value
I wont pretend to understand that, but it looks impressive, cheers
Any tips for laying out pcbs in Eagle or is it practice makes perfect? this could take a while.....
er the ones that always hits me, repeatedly, I am not learning. Everything looks much smaller when it's actually on a pcb, smaller than the screen that is. So those neat narrow little traces and tiny pads are even smaller than you thought. oh and make the holes in the pads very small as large ones make soldering not as neat and the drill won't center aswell. Well those are things I need to remember, but don't till I am looking at the laser print.
I seem to remember Mariss from Gecko offering to sell cplds programmed pretty much as in the geckodrives, for something like $5 a time?
It was mentioned in the looooong thread about the Alegro A3986 chip that everyone decided didn't work properly, this is on CNC zone. That must be worth a look.
However, milling it... I photo-etch them myself, since I have the capability.
If you're interested
If you want to do it yourself, then there are a few rules to follow - graffian's advice is sound, but Eagle does have a "DRC" (Design Rule Check) which makes sure you don't break common ones (such as tracks too small, crossing over, pads too small, objects too close together). If you run this every so often as you're designing it, then it'll help you get along.
The photo-etching I do performs better than Eagle's built-in rules, so I've modified my rules to allow me to etch to within very tight tolerances.
Looking at his (later) reply with the rough idea of the code, that looks sane to me, and roughly how I'd go about it.
INT0 would be the interrupt from the INT pin; INT1 would be the Timer0/1 interrupt.
DIP switches for the timeout's a neat idea - especially if it'll be used by someone who doesn't have reprogramming capability.
I have a slight concerna about using the PWM - if the PWM controls the direction control (i.e. oscillates between output 0 and open-collector), then that would be fine. However, from memory, it'll only oscillate between 0 and 1, then you'd need to be careful of the PWM pulse width - you could end up going too high with the VREF signal. Still doable though.
There's nothing stopping you from putting it on a separate board.
Having said that, if you are using a transistor, why not put a trimmer on the output side and not use PWM at all... would simplify the code and you could adjust the holding current to your hearts content.
Thanks graffian, I think I was about to make that mistake. I'll have to look for that thread, will it still apply to the L297?
I can do the conversion of the schematic
I actually meant discuss with Irving
a single NPN small signal transistor and base resistor on the output would suffice.
By craynerd in forum Motor Drivers & ControllersReplies: 1Last Post: 16-03-2014, 06:29 PM
By Treemonkey in forum Motor Drivers & ControllersReplies: 11Last Post: 11-02-2013, 07:16 PM
By Shinobiwan in forum Motor Drivers & ControllersReplies: 0Last Post: 04-03-2012, 02:54 PM
By mike in forum Motor Drivers & ControllersReplies: 12Last Post: 21-09-2010, 08:29 AM
By John S in forum General ElectronicsReplies: 1Last Post: 21-06-2009, 11:46 AM