Pages: [1]   Go Down
Author Topic: New MC33932 Dual Motor Shield!  (Read 3435 times)
0 Members and 1 Guest are viewing this topic.
Florida
Offline Offline
Newbie
*
Karma: 0
Posts: 26
Engineer at Jaycon Systems LLC
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey Guys, once again wanted to share a new shield that we have designed around the  MC33932 Dual H Bridge by Free scale. Each H-bridge in the 33932 is able to control inductive loads with currents up to 5.0A peak. The main traces on this shield are much wider than on the Ardumoto, which makes this shield much more forgiving to beginners. This is a great little board (all necessary hardware is included) and we have posted some Arduino Code to quickly get started with this shield!


Main Features:
8.0V to 28V continuous operation (transient operation from 5.0V to 40V)
3.3V and 5.0V (TTL / CMOS) logic compatible inputs
Over-current limiting (regulation) via internal constant-off-time PWM
Output short-circuit protection (short to VPWR or GND)
Temperature-dependant current-limit threshold reduction
All inputs have an internal source/sink to define the default (floating input) states
Sleep Mode with current draw < 50μA

Here is the link to the product page: http://www.jayconsystems.com/arduino-compatible-dual-motor-shield-mc33932.html

Any questions and comments are Welcome!
Thanks Guys!

Jay
Logged

Jaycon Systems LLC
   Automate Your Life!

www.jayconsystems.com

Lithuania
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Who is the idiot, who made this circuit, PWM-ing the tristate pins. In data sheet they warned you. This way you are not able to dinamic brake, you are tristating them, and selfinduction energy gives spikes, because you break the freewheel circuit.

All you need to drive is IN1 and IN2. IN1 - PWM non-inverting mode, IN2 - LOW, acts as a buck converter if PWMed. If Reversed IN1 - PWM inverting mode, IN2 - HIGH.

We use them in MiniSumo robots 5 years 33886, 33887, 33932
And tried to find better Idea in controlling algorithm, but we found only idiots, who even dosen't read the "friendly" manuals...
Quote
void SetSpeed(signed int SpeedLeft, signed int SpeedRight){
  //Constrain speed values
  SpeedLeft=constrain(SpeedLeft, -100, 100);
  SpeedRight=constrain(SpeedRight, -100, 100);
  //Direction control
  if(SpeedLeft >= 0){
    //Clear OC1B on Compare Match, set OC1B at BOTTOM, (non-inverting mode)
    TCCR1A = TCCR1A & 0b11101111;
    digitalWrite(IN2,   LOW);
  }else{
    //Convert negative to positive value
    SpeedLeft=-SpeedLeft;
    //Set OC1B on Compare Match, clear OC1B at BOTTOM, (inverting mode).
    TCCR1A = TCCR1A | 0b00110000;
    digitalWrite(IN2, HIGH);
  }
  if(SpeedRight >= 0){
    //Clear OC0A on Compare Match, set OC0B at BOTTOM, (non-inverting mode)
    TCCR1A = TCCR1A & 0b10111111;
    digitalWrite(IN4,   LOW);
  }else{
    //Convert negative to positive value
    SpeedRight=-SpeedRight;
    //Set OC1B on Compare Match, clear OC1A at BOTTOM, (inverting mode)
    TCCR1A = TCCR1A | 0b11000000;
    digitalWrite(IN4, HIGH);
  }
  //Mapping and correction of speed values
  if(SpeedLeft>0) SpeedLeft=map(SpeedLeft, 1, 100, 38, 254);
  if(SpeedRight>0) SpeedRight=map(SpeedRight, 1, 100, 30, 254);
  //Output
  analogWrite(IN1, SpeedLeft);
  analogWrite(IN3, SpeedRight);
}


And if you get a Status Flag, toggle the D1 or EN/D2:
Quote
void StatusFlag(){
  boolean driverStatus=digitalRead(SFA)&digitalRead(SFB);
  if (driverStatus==LOW && driverState==HIGH){
    Serial.print  ("Fail Status: ");
    Serial.print  (digitalRead(SFA), BIN);
    Serial.println(digitalRead(SFB), BIN);
    Serial.println("DRIVERS_DISABLE");
    DRIVERS_DISABLE();
    Serial.println("DRIVERS_ENABLE");
    DRIVERS_ENABLE();
  } 

#define DRIVERS_ENABLE()  driverState=HIGH; digitalWrite(EN, driverState);
#define DRIVERS_DISABLE() driverState=LOW; digitalWrite(EN, driverState);



* Снимок.PNG (124.84 KB, 1055x473 - viewed 35 times.)
« Last Edit: November 23, 2013, 01:29:23 pm by DarK_AlximiK » Logged

Florida
Offline Offline
Newbie
*
Karma: 0
Posts: 26
Engineer at Jaycon Systems LLC
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi DarK_AlximinK,

A quick read of the datasheet shows that you can use the disable pin for PWM.
In fact if you look at some other Freescale breakout boards (http://www.pololu.com/product/1212/resources) they recommend PWMing the disable pins.

" IN2   HIGH   The logic input control of OUT2. PWM can be applied to this pin (typically done with both disable lines inactive).
IN1   HIGH   The logic input control of OUT1. PWM can be applied to this pin (typically done with both disable lines inactive).
PWM / D2   LOW   Inverted disable input: when D2 is low, OUT1 and OUT2 are set to high impedance. A D2 PWM duty cycle of 70% gives a motor duty cycle of 70%. Typically, only one of the two disable pins is used, but the default is for both disable pins to be active.
PWM / D1   HIGH   Disable input: when D1 is high, OUT1 and OUT2 are set to high impedance. A D1 PWM duty cycle of 70% gives a motor duty cycle of 30%. Typically, only one of the two disable pins is used, but the default is for both disable pins to be active."

We have been using this shield in many of our classes without any problem. Perhaps for the second revision, we will remove the 74HC1G04 inverters' so customers like yourself can also control it using the IN1 and IN2 pins.

Jay

P.S constructive criticism is welcomed but no reason to call anyone an idiot.
Logged

Jaycon Systems LLC
   Automate Your Life!

www.jayconsystems.com

Pages: [1]   Go Up
Jump to: