Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Motors (http://www.chiefdelphi.com/forums/forumdisplay.php?f=52)
-   -   2016 Bosch motor 6004 RA3 194-06 (http://www.chiefdelphi.com/forums/showthread.php?t=140348)

kprzewodek 16-02-2016 17:25

Re: 2016 Bosch motor 6004 RA3 194-06
 
Quote:

Originally Posted by cedwards (Post 1541351)
1) Wiring. We have the motor +/- and have been driving them. However, we are not sure how to wire the two addition wires (additional to the motor power) to gain access to the internal encoder (Hall effect sensor?).

There is a spec sheet that will help you with this. http://files.andymark.com/FRC_Bosch_...ec_sheetv2.pdf. Let me know if you need further clarification. The hall does need to be powered because it is isolated from the motor power circuit.

Quote:

Originally Posted by cedwards (Post 1541351)
2) If this is a hall effect sensor what part of the RoboRio do we plug it into? Is it digital or analog?

It is an analog signal.

Quote:

Originally Posted by cedwards (Post 1541351)
3) If the "encoder" that is in this motor is a hall effect sensor what component do our programmers use to get information from it to base position on. Is this a Counter object?

It basically provides one pulse per armature rotation. There are 179 armature rotations for each output gear rotation.

-Kevin

cedwards 16-02-2016 17:45

Re: 2016 Bosch motor 6004 RA3 194-06
 
Thanks Kevin
Quote:

The hall does need to be powered because it is isolated from the motor power circuit.
So we can hook up a pwm cable that runs from the analog breakout from the roborio. Black wire (ground) to Pin #4, Red wire (positive 5v?) to Pin #2 with a R-200Ohm resistor. Finally the White wire is just cut off and goes to nothing?.

Does that sound correct?

The rest of this makes a bit more sense now that I know we are indeed dealing with a hall effect sensor.

Thanks much.

eccmaster 16-02-2016 18:43

Re: 2016 Bosch motor 6004 RA3 194-06
 
I would like to buy this motor any good sources to buy this exact model?

Thank you in advance

kprzewodek 16-02-2016 23:45

Re: 2016 Bosch motor 6004 RA3 194-06
 
Quote:

Originally Posted by cedwards (Post 1541370)
Thanks Kevin


So we can hook up a pwm cable that runs from the analog breakout from the roborio. Black wire (ground) to Pin #4, Red wire (positive 5v?) to Pin #2 with a R-200Ohm resistor. Finally the White wire is just cut off and goes to nothing?.

Does that sound correct?

Thanks much.

Seems right although some have had issues getting the roborio to pick up the signal at 5V. The difference between peaks and valleys is less than when your putting 12 V through which this hall it is really designed for. If you have success getting 5V to work please let me know.

kprzewodek 17-02-2016 10:11

Re: 2016 Bosch motor 6004 RA3 194-06
 
Quote:

Originally Posted by eccmaster (Post 1541398)
I would like to buy this motor any good sources to buy this exact model?

Thank you in advance

Please read previous post in this thread addressing this question.

kprzewodek 17-02-2016 15:09

Re: 2016 Bosch motor 6004 RA3 194-06
 
2 Attachment(s)
As mentioned you must supply a power source for the hall circuit since it doesn't feed of the motor power inputs.

Just as a reference I made a comparison of reading the hall signal with 12V and 6V input (power supply wouldn't go any lower). At 12V the difference from peak to valley is ~3.9V. It's ~1.6V with 6V input. May explain why the Robo Rio is having trouble reading at the lower voltage.

cedwards 18-02-2016 15:12

Re: 2016 Bosch motor 6004 RA3 194-06
 
Today after hooking up the oscilloscope we were able to verify a few things and start getting values to count.

Wiring
We took a standard PWM cable and connected as follows:
Red wire to the 200 Ohm resistor and then to Pin #2 of the motor.
The White wire connects to the motor side of the resistor/Pin #2.
Then Black wire to Pin #4.

Plugged this into an Analog Channel on the RoboRio (5V power supply).

Code
We used a AnalogTrigger (Java) to tie into the analog signal and set its limits based off the values we were getting from the oscilloscope.

Code:

AnalogTrigger trigger = new AnalogTrigger(0);
trigger.setLimitsVoltage(3.5, 5.0);
boolean inWindow = trigger.getInWindow();

The next steps will be to keep track of this count and setup equations to be able to set the angle of the mechanism. Hope this is useful if other teams are looking to use these motors and its hall effect sensor.

SLAB-Mr.Thomas 21-02-2016 19:38

Re: 2016 Bosch motor 6004 RA3 194-06
 
Saw a typo above; it's 174.9:1 gearing, of course.

Here's a sample C++ code using the counter so no ticks of the encoder are missed.

Code:


// Position of BOSCH AHC-2 12V  6004.RA3.194-06 174.9:1 gear w/ encoder 1 tick per motor revolution on roboRIO analog 5 volt bus
// FRC Team 4237 Lakeshore High School
// Sample program merely rotates 1 revolution then reverses for 1 revolution and does so forever.

#include "WPILib.h"

class Robot: public SampleRobot
{
public:
        Robot();
        void OperatorControl();
        float CheckDirectionChange(float);
        int GetPosition();
private:
        CANTalon* mCANTalon; // motor
        AnalogTrigger mAnalogTrigger; // create an encoder pulse trigger
        Counter* mCounter; // count the encoder pulse triggers in current direction
        float mSpeedPrevious; // to remember previous direction
        int mPosition; // position accumulator to remember previous position before last direction change
};

Robot::Robot() : mAnalogTrigger(0)
{
        mCANTalon = new CANTalon(0);
        mAnalogTrigger.SetLimitsVoltage(3.5, 3.8); // values higher than the highest minimum (pulse floor), lower than the lowest maximum (pulse ceiling)
        mCounter = new Counter(&mAnalogTrigger);
        mSpeedPrevious = 0.;
        mPosition = 0;
}

float Robot::CheckDirectionChange(float NewSpeed)
{
        // update position accumulator if changing direction
        // encoder doesn't know the direction so we have to remember the direction for it
        if ((mSpeedPrevious < 0 && NewSpeed >= 0) || (mSpeedPrevious >= 0 && NewSpeed < 0))
        {
                mPosition = GetPosition(); // changing directions so save what we have
                mCounter->Reset(); // and start counting in the new direction
                mSpeedPrevious = NewSpeed; // return input speed for ease of use (may include it in the Set() argument => Set(CheckDirectionChange(speed)))
        }
                return NewSpeed;
}

int Robot::GetPosition()
{
        // position from previous direction change plus what's been accumulated so far in this direction
        if (mSpeedPrevious >= 0)
                return mPosition + mCounter->Get(); // been going forward so add counter

        return mPosition - mCounter->Get(); // been going backward so subtract counter
}

void Robot::OperatorControl()
{
        bool blockForward, blockReverse; // soft limit switches for this example
        int mPos=0;
        float speed = 1.0; // initial speed for this example
        mCounter->Reset();

// example back and forth nearly 1 revolution (174.9)

        while(IsEnabled() && IsOperatorControl())
        {
                mPos = GetPosition();
                printf("Position %d, Speed %f\n", mPos, speed);

                if (mPos >= 175) blockForward = true; // example check for at limit switch
                else blockForward = false;

                if (mPos <= 0) blockReverse = true; // example check for at limit switch
                else blockReverse = false;

                if (blockForward) speed = -1.; // example if at a limit switch go back the other way
                if (blockReverse) speed = +1.;

                // call CheckDirectionChange with same speed as Set() with (or before or after) every motor Set() to update position if reversing direction
                mCANTalon->Set(CheckDirectionChange(speed)); // refresh or change speed, update position if changing direction

                Wait(0.01); // ticks won't be lost but wait less to see them all here and respond faster
        }
}

START_ROBOT_CLASS(Robot)


kprzewodek 22-02-2016 09:09

Re: 2016 Bosch motor 6004 RA3 194-06
 
Thanks cedwards and SLAB-Mr.Thomas for sharing your results. Looks like your having success getting this to work with 5V. I'll try to get the spec sheet updated once we have a confirmation this is working ok with the CRio and we aren't missing too many counts.

ICE_Bear 22-02-2016 19:28

Re: 2016 Bosch motor 6004 RA3 194-06
 
We are a team using this motor. we would like to get more of them. is there a team or a place we can go to get it?

kprzewodek 03-03-2016 10:19

Re: 2016 Bosch motor 6004 RA3 194-06
 
If anyone needs spare motors we have another order in process. These will be distributed through AndyMark as a donated item.


All times are GMT -5. The time now is 15:26.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi