Thread: Help! DIY 4 amp L297/6203 driver
Hybrid View
-
17-11-2009 #1
Just thinking about it - I don't think it's necessary to have two pins controlling VREF.
In the original circuit, there are three possible states:
GP 2is open circuit; VREF would range from 0 to ~1V (depending on R23)
GP2 is 0V; VREF would be 0
GP2 is 5V; VREF would be between 0 and 5V (again, depending on R23)
The last mode of operation isn't what I suspect is used, so I'll discount that.
However, GP2 can easily create a PWM signal by going from open-circuit to 0v, which at a 25% duty cycle would bring VREF from between ~0 and 0.25V. C23 is used to smooth the signal.
I'm beginning to have an idea about a (possibly) better way to do this.
GP2 is used for the CLOCK signal for the L297 - this is the PIC's interrupt pin, and would be easier to deal with there.
GP1 has a 10K trim resistor which is used to control the minimum hold voltage.
GP0 is connected DIRECTLY to VREF. This is used to monitor VREF.
GP5 is used to control VREF using the same circuit as the original does.
GP4 has a 10K trim to control the delay time for the circuit.
The advantages with this are:
1) The hold VREF can be easily adjusted, and measured with a volt meter
2) The PIC has voltage comparison circuits on GP0 and GP1, and this would be using them
3) Interrupts can easily be used for everything (VREF going below voltage, clock signal coming in, timeout occurring)
4) The PIC shouldn't need to be reprogrammed at all (once it's all working)
If there was a spare output pin, then the L297's RESET pin could be controlled (removing the need for R15, D12 and C16 on your circuit). If we didn't monitor the VREF signal (GP0), then this could be done instead - the trim for GP1 would actually control the minimum PWM duty cycle.
-
18-11-2009 #2
Hi tribbles,
Yep, all that would work - I was just demonstrating that what was required could be done simply.
In the past I've used PWM to modify the VRef voltage - however I've always spotted some ripple with a single stage of RC filtering (I think my PWM was at about 5khz) so always added another. Don't think it matters that much as long as the voltage is approximately right though.
Usually I didn't bother with the VR, having options in the PIC to set the current (either with links setting the most common values, or via a menu on whatever display device I'm using).
Monitoring the VRef voltage I've never found to be necessary - although my initial attempt did exactly that. I have in the past though (when building buck/boost converters to drive LED's) made self starting regulators using the PWM on the PIC and used the analogue inputs to monitor the voltage and adjust the PWM. That's a very interesting experiment in feedback loops...)
-
18-11-2009 #3Just to clear any confusion - you the 3k9 res should be removed from the +5v line and connected to a port. The voltage at the other end will never exceed 1v.
Another resistor is connected the same (19k??) one end to the junction of the VR and the 3K9 the other to a second port.
The advantages with this are:
1) The hold VREF can be easily adjusted, and measured with a volt meter
2) The PIC has voltage comparison circuits on GP0 and GP1, and this would be using them
3) Interrupts can easily be used for everything (VREF going below voltage, clock signal coming in, timeout occurring)
4) The PIC shouldn't need to be reprogrammed at all (once it's all working)
If monitoring the vref isnt necessary then the reset option would be best. I see the data sheet says the reset must be initially be set low and then set high but this is the only circuit I have seen that dose this, all the others just tie it to +5v.
The only question is what can we make GP3 do? Flashy lights, make the tea?
Usually I didn't bother with the VR, having options in the PIC to set the current (either with links setting the most common values, or via a menu on whatever display device I'm using).
Thread Information
Users Browsing this Thread
There are currently 2 users browsing this thread. (0 members and 2 guests)
Similar Threads
-
Stepper Motor Driver - cheap similar to ArcEuro 4.2A Bi-Polar Stepper Motor Driver
By craynerd in forum Motor Drivers & ControllersReplies: 1Last Post: 16-03-2014, 07:29 PM -
Dc servo driver
By Treemonkey in forum Motor Drivers & ControllersReplies: 11Last Post: 11-02-2013, 08:16 PM -
Driver suggestions
By Shinobiwan in forum Motor Drivers & ControllersReplies: 0Last Post: 04-03-2012, 03:54 PM -
Driver wiring help...
By mike in forum Motor Drivers & ControllersReplies: 12Last Post: 21-09-2010, 09:29 AM -
Driver box
By John S in forum General ElectronicsReplies: 1Last Post: 21-06-2009, 12:46 PM
Bookmarks