Go to Post Why assume a full trophy case and spreading the message of FIRST (mentoring rookies) are mutually exclusive? Team 16 supported 6 rookies this season and earned 5 banners - I am equally proud of both. - Meredith Novak [more]
Home
Go Back   Chief Delphi > Technical > Motors
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #46   Spotlight this post!  
Unread 16-02-2016, 17:25
kprzewodek's Avatar
kprzewodek kprzewodek is offline
Registered User
AKA: Kevin Przewodek
FRC #0862 (Lightning robotics)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2000
Location: Michigan
Posts: 53
kprzewodek is on a distinguished road
Re: 2016 Bosch motor 6004 RA3 194-06

Quote:
Originally Posted by cedwards View Post
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 View Post
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 View Post
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
  #47   Spotlight this post!  
Unread 16-02-2016, 17:45
cedwards cedwards is offline
Registered User
FRC #4980 (Canine Crusaders)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Kettle Falls
Posts: 11
cedwards is an unknown quantity at this point
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.
  #48   Spotlight this post!  
Unread 16-02-2016, 18:43
eccmaster eccmaster is offline
Registered User
FRC #2344
 
Join Date: Jan 2008
Location: Yonkers
Posts: 17
eccmaster is an unknown quantity at this point
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
  #49   Spotlight this post!  
Unread 16-02-2016, 23:45
kprzewodek's Avatar
kprzewodek kprzewodek is offline
Registered User
AKA: Kevin Przewodek
FRC #0862 (Lightning robotics)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2000
Location: Michigan
Posts: 53
kprzewodek is on a distinguished road
Re: 2016 Bosch motor 6004 RA3 194-06

Quote:
Originally Posted by cedwards View Post
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.
  #50   Spotlight this post!  
Unread 17-02-2016, 10:11
kprzewodek's Avatar
kprzewodek kprzewodek is offline
Registered User
AKA: Kevin Przewodek
FRC #0862 (Lightning robotics)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2000
Location: Michigan
Posts: 53
kprzewodek is on a distinguished road
Re: 2016 Bosch motor 6004 RA3 194-06

Quote:
Originally Posted by eccmaster View Post
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.
  #51   Spotlight this post!  
Unread 17-02-2016, 15:09
kprzewodek's Avatar
kprzewodek kprzewodek is offline
Registered User
AKA: Kevin Przewodek
FRC #0862 (Lightning robotics)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2000
Location: Michigan
Posts: 53
kprzewodek is on a distinguished road
Re: 2016 Bosch motor 6004 RA3 194-06

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.
Attached Thumbnails
Click image for larger version

Name:	6vhall.png
Views:	29
Size:	21.3 KB
ID:	20096  Click image for larger version

Name:	12vhall.png
Views:	23
Size:	20.9 KB
ID:	20097  
  #52   Spotlight this post!  
Unread 18-02-2016, 15:12
cedwards cedwards is offline
Registered User
FRC #4980 (Canine Crusaders)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Kettle Falls
Posts: 11
cedwards is an unknown quantity at this point
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.

Last edited by cedwards : 18-02-2016 at 18:17.
  #53   Spotlight this post!  
Unread 21-02-2016, 19:38
SLAB-Mr.Thomas SLAB-Mr.Thomas is offline
Registered User
FRC #4237
 
Join Date: Jan 2015
Location: USA
Posts: 15
SLAB-Mr.Thomas is an unknown quantity at this point
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)

Last edited by SLAB-Mr.Thomas : 22-02-2016 at 10:17. Reason: had time to add some comments in the code
  #54   Spotlight this post!  
Unread 22-02-2016, 09:09
kprzewodek's Avatar
kprzewodek kprzewodek is offline
Registered User
AKA: Kevin Przewodek
FRC #0862 (Lightning robotics)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2000
Location: Michigan
Posts: 53
kprzewodek is on a distinguished road
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.
  #55   Spotlight this post!  
Unread 22-02-2016, 19:28
ICE_Bear ICE_Bear is offline
Registered User
FRC #5875 (ICE)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2014
Location: Northern Nevada
Posts: 72
ICE_Bear is an unknown quantity at this point
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?
  #56   Spotlight this post!  
Unread 03-03-2016, 10:19
kprzewodek's Avatar
kprzewodek kprzewodek is offline
Registered User
AKA: Kevin Przewodek
FRC #0862 (Lightning robotics)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2000
Location: Michigan
Posts: 53
kprzewodek is on a distinguished road
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.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 11:17.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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