Interfacing the Prop with a L298
Philldapill
Posts: 1,283
From an earlier post, I said I was trying to make my own dual H-bridge circuits to drive some steppers for a CNC machine I'm making. Well, I made a test Hbridge and after 2 hours and probably 1/2 a pound of solder(kidding), it works great. It's a chopper circuit so nothing gets too hot. The only thing, is that it takes way to long to construct to be worth it. Many people had suggested using a L298 chip, so that's what I've decided to do.
Now, I'm not too sure on how to use it. Looking at the datasheet, I need to connected a couple of shunt resistors at the "sense" points, but from my understanding, if the IC is sensing the current(voltage across the shunts), then it needs to compare it to SOMETHIING to chop the circuit, right? I really don't want to have to buy the L297 IC's too since they are already about $4 a pop as it is. Can I only use the L298 by itself as it is?
The other thing, and main question, is how to interface this to the propeller. I'm assuming it's fairly easy and it's similiar to sending data to my H-bridge. All I need to do is send the inputs of the L298 the correct stepping sequence info and it's good to go, right? Please let me know if I'm wrong in any of this...
Now, I'm not too sure on how to use it. Looking at the datasheet, I need to connected a couple of shunt resistors at the "sense" points, but from my understanding, if the IC is sensing the current(voltage across the shunts), then it needs to compare it to SOMETHIING to chop the circuit, right? I really don't want to have to buy the L297 IC's too since they are already about $4 a pop as it is. Can I only use the L298 by itself as it is?
The other thing, and main question, is how to interface this to the propeller. I'm assuming it's fairly easy and it's similiar to sending data to my H-bridge. All I need to do is send the inputs of the L298 the correct stepping sequence info and it's good to go, right? Please let me know if I'm wrong in any of this...
Comments
Are you going to use the IC for a stepper motor or a regular motor? Let me know and ill post a schematic for your needs.
Also how much current are you going to be drawing from the IC? You can wire it up a few different ways depending things...
Also, there are a couple of modes of chopping, one is called phase chopping and the other inhibit chopping, both of which affect the current recirculating path.
If you are driving the H-bridge directly I would use an RC DAC to generate the voltage reference back into a comparator as this allows you to control the current which makes modes such as micro-stepping possible and even just reducing holding current to keep things cool. It may be possible to skip the comparator and just use the 2R2C ADC on the prop (it just a DAC self-balancing the input).
ST have a couple of excellent appnotes on stepper motors and drivers.
www.st.com/stonline/products/literature/an/1681.pdf
www.st.com/stonline/products/literature/an/1734.pdf
*Peter*
Now, if you'll look in the schematic, this is only a single H-bridge. Notice the op-amps and the shunt. The opamp is there to constantly compare the voltage dropped across the shunt(which is proportional to current, ohms law), with the signal voltage through the voltage divider. If there is a high signal at the voltage divider, the opamp adjusts it's output voltage so that the voltage across the shunt is equal to the signal. To increase the current, turn the pot up.
I think this design with the opamp can be adapted almost identically to the L298. Instead of the output of the opamp going to the transistor base, it can go to the input of L298. In this arrangement, I don't think you're using anymore CPU pins than normal. I think in your arrangement without the sense resistors, your L298 is trying to push ALL the current it can through.
Yes I understand the need for the feedback, but couldn't you achieve the same results by "Ramping" the stepper motor with "code?" I use software to ramp up then ease back down to level off the current. This happens so fast to the naked eye and It has worked for me so far. This combined with an external optical sensor to find a HOME position, I can keep accuracy to a high level.
I am sure you are correct about pushing all the current through with out using a sense resistor, but I control the current within the code.
Hum ill have to do some more tinkering because i could be approaching this wrong. Lets keep discussing this.
What I'm thinking about doing, is generating a voltage reference using the DAC. This reference would be buffered with an op-amp as a voltage follower. From the ouput of the opamp, I would have 4 NPN transistors that I would switch on or off with the prop. The collectors would be connected together and to the output of the opamp. The emitters would all be seperate, and would be connected to a couple more opamps as shown in my schematic earlier. This way, instead of having a 0 or 3.3V signal going to the inputs of these op-amps and having to adjust the voltage with the pot/voltage divider, I could adjust the signal voltage with the DAC. I'm a beginner electronics nerd, so this may be simple, but it seems brilliant...
FYI, schematic now attached and·Dual H-Bridge schematic revised.
Post Edited (Philldapill) : 3/18/2008 3:04:16 AM GMT
Can you send me a schematic of how you are using the L298? I'm designing a PCB at the moment that will use the Prop to control multiple steppers. The prop will recieve commands from a printer port, which will act on those by moving steppers.