simply for me
graffix
Posts: 389
another site I got some help on is closing.So Im transfering some info for myself so its not lost.
OK, let's make sure we understand what you have, and what you are trying to do:
You have:
A Propeller board
Two LMD 18200 H Bridges
Two DC Motors
You are trying to have the Propeller control the speed and direction of each motor.
If this is correct, you'll need to do the following:
First, you need to make a choice. That particular H Bridge, according to the data sheet, is capable of working in one of two modes.
In one mode, you send a PWM (Pulse Width Modulation) signal, and anything below 50% duty cycle is one direction, 50% duty cycle is "neutral", and anything over 50% is the other direction.
In the other mode, only the motor speed is determined by the PWM signal. 0% of off, 50% is "half speed" and 100% is full speed. A separate signal is used to determine direction.
There is also a "Brake" signal that you can use. Basically, this shorts out the two motor leads, and is also referred to "dynamic breaking". You're basically turning the motor into a generator. You don't have to use this feature.
Which version of this H Bridge do you have? The 11 Lead TO-220 (Single H Bridge), or the 24 Pin DIP version (Dual H Bridge)?
Here is a link to the data sheet: http://www.national.com/ds/LM/LMD18200.pdf
There is not a real good schematic for your application. This particular H Bridge is intended to provide feedback for control of speed or torque, and I'm assuming you are not worried about doing that.
If you let us know which version you have, I can tell you "pin by pin" what should get connected to what.
You'll also need to look at one of the PWM objects from the object exchange.
John R.
OK, here we go! On the LM18200 H Bridge:
Pin 1 and 11 can be ignored. These are "bootstrap" connections, and used for feedback.
Pin 7 connects to Ground. This needs to be a common ground with the Prop Circuit.
Pin 6 is Vs or Supply Voltage. This will need to be a different supply than the Prop, and needs to be in the range of 12 - 55 Volts. If your motor is a lower voltage, this H Bridge is not a good choice. (See Below)
Pins 2 and 10 get connected to the motor.
Pin 3 is the Direction input (see below)
Pin 5 is the PWM input (see below)
Pin 4 is the brake input. If you're not using the break function, tie this pin to ground.
Pin 9 is the Thermal Warning pin, and does not need to be used.
Pin 8 is the Current Sense Output, and does not need to be used.
What voltage do the motors operate on, and what will you be using for a power supply for the motors? If these are low voltage motors (less than 12 Volts), this is not an appropriate H Bridge to use. My impression is that the Edge uses a lower voltage system, but I'm not sure. Keep in mind that with an H Bridge, the motor doesn't see a true "voltage", but a series of pulses at the full voltage. The slower the motor is driven, the shorter these pulses are, but they are still at full voltage.
Direction and PWM Connections:
To use a single PWM signal to control both Speed and Direction, you need to connect Pin 5 (PWM) to "High". This is "always on". Then your PWM signal from the prop gets connected to Pin 3 (the Direction input). This causes the "net voltage" of the output PWM to change direction as the PWM input on the Direction pin crosses 50%. See page 6 and 7 of the data sheet I linked to below.
It may be easier to use a separate Direction and PWM signal. In this case, the PWM signal from the Prop goes to Pin 5, and the Direction signal (low for one direction, high for the other) goes to Pin 3.
If you plan on using the Temperature or Current Feedback signals, keep in mind that the H Bridge is not a 3.3 volt device, and you'll need to look at the voltage coming of those pins. While the inputs are set up to accept a "logic level" signal, I believe the outputs work off the supply voltage for the motor.
John R.
OK, let's make sure we understand what you have, and what you are trying to do:
You have:
A Propeller board
Two LMD 18200 H Bridges
Two DC Motors
You are trying to have the Propeller control the speed and direction of each motor.
If this is correct, you'll need to do the following:
First, you need to make a choice. That particular H Bridge, according to the data sheet, is capable of working in one of two modes.
In one mode, you send a PWM (Pulse Width Modulation) signal, and anything below 50% duty cycle is one direction, 50% duty cycle is "neutral", and anything over 50% is the other direction.
In the other mode, only the motor speed is determined by the PWM signal. 0% of off, 50% is "half speed" and 100% is full speed. A separate signal is used to determine direction.
There is also a "Brake" signal that you can use. Basically, this shorts out the two motor leads, and is also referred to "dynamic breaking". You're basically turning the motor into a generator. You don't have to use this feature.
Which version of this H Bridge do you have? The 11 Lead TO-220 (Single H Bridge), or the 24 Pin DIP version (Dual H Bridge)?
Here is a link to the data sheet: http://www.national.com/ds/LM/LMD18200.pdf
There is not a real good schematic for your application. This particular H Bridge is intended to provide feedback for control of speed or torque, and I'm assuming you are not worried about doing that.
If you let us know which version you have, I can tell you "pin by pin" what should get connected to what.
You'll also need to look at one of the PWM objects from the object exchange.
John R.
OK, here we go! On the LM18200 H Bridge:
Pin 1 and 11 can be ignored. These are "bootstrap" connections, and used for feedback.
Pin 7 connects to Ground. This needs to be a common ground with the Prop Circuit.
Pin 6 is Vs or Supply Voltage. This will need to be a different supply than the Prop, and needs to be in the range of 12 - 55 Volts. If your motor is a lower voltage, this H Bridge is not a good choice. (See Below)
Pins 2 and 10 get connected to the motor.
Pin 3 is the Direction input (see below)
Pin 5 is the PWM input (see below)
Pin 4 is the brake input. If you're not using the break function, tie this pin to ground.
Pin 9 is the Thermal Warning pin, and does not need to be used.
Pin 8 is the Current Sense Output, and does not need to be used.
What voltage do the motors operate on, and what will you be using for a power supply for the motors? If these are low voltage motors (less than 12 Volts), this is not an appropriate H Bridge to use. My impression is that the Edge uses a lower voltage system, but I'm not sure. Keep in mind that with an H Bridge, the motor doesn't see a true "voltage", but a series of pulses at the full voltage. The slower the motor is driven, the shorter these pulses are, but they are still at full voltage.
Direction and PWM Connections:
To use a single PWM signal to control both Speed and Direction, you need to connect Pin 5 (PWM) to "High". This is "always on". Then your PWM signal from the prop gets connected to Pin 3 (the Direction input). This causes the "net voltage" of the output PWM to change direction as the PWM input on the Direction pin crosses 50%. See page 6 and 7 of the data sheet I linked to below.
It may be easier to use a separate Direction and PWM signal. In this case, the PWM signal from the Prop goes to Pin 5, and the Direction signal (low for one direction, high for the other) goes to Pin 3.
If you plan on using the Temperature or Current Feedback signals, keep in mind that the H Bridge is not a 3.3 volt device, and you'll need to look at the voltage coming of those pins. While the inputs are set up to accept a "logic level" signal, I believe the outputs work off the supply voltage for the motor.
John R.