View Single Post
  #17   Spotlight this post!  
Unread 18-01-2014, 22:42
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,101
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Can Victor and Jaguar motors work together on a single gearbox?

Quote:
Originally Posted by Ether View Post
Are you also certain that:

all the controllers were properly calibrated

and

your code was using the appropriate input pulse width range for the Jags and the 888s?
Quote:
Originally Posted by Ether View Post
Do you still have last year's bot?

Could you bring it back to life and run a few quick tests?
Pending answers to the open questions and results from any testing Mr Lim (or anyone else) is able/willing to do, my working hypothesis is that the answer lies somewhere in this code:

Code:
/**
 * Common initialization code called by all constructors.
 */
void Jaguar::InitJaguar()
{
	/*
	 * Input profile defined by Luminary Micro.
	 * 
	 * Full reverse ranges from 0.671325ms to 0.6972211ms
	 * Proportional reverse ranges from 0.6972211ms to 1.4482078ms
	 * Neutral ranges from 1.4482078ms to 1.5517922ms
	 * Proportional forward ranges from 1.5517922ms to 2.3027789ms
	 * Full forward ranges from 2.3027789ms to 2.328675ms
	 * TODO: compute the appropriate values based on digital loop timing
	 */
	SetBounds(251, 135, 128, 120, 4);
	SetPeriodMultiplier(kPeriodMultiplier_1X);
	SetRaw(m_centerPwm);

	nUsageReporting::report(nUsageReporting::kResourceType_Jaguar, GetChannel(), GetModuleNumber() - 1);
}





/**
 * Common initialization code called by all constructors.
 * 
 * Note that the Victor uses the following bounds for PWM values.  These values were determined
 * empirically through experimentation during the 2008 beta testing of the new control system.
 * Testing during the beta period revealed a significant amount of variation between Victors.
 * The values below are chosen to ensure that teams using the default values should be able to
 * get "full power" with the maximum and minimum values.  For better performance, teams may wish
 * to measure these values on their own Victors and set the bounds to the particular values
 * measured for the actual Victors they were be using. 
 *   - 210 = full "forward"
 *   - 138 = the "high end" of the deadband range
 *   - 132 = center of the deadband range (off)
 *   - 126 = the "low end" of the deadband range
 *   - 56 = full "reverse"
 */
void Victor::InitVictor()
{
	// TODO: compute the appropriate values based on digital loop timing
	SetBounds(210, 138, 132, 126, 56);
	SetPeriodMultiplier(kPeriodMultiplier_2X);
	SetRaw(m_centerPwm);

	nUsageReporting::report(nUsageReporting::kResourceType_Victor, GetChannel(), GetModuleNumber() - 1);
}


/**
 * Set the bounds on the PWM values.
 * This sets the bounds on the PWM values for a particular each type of controller. The values
 * determine the upper and lower speeds as well as the deadband bracket.
 * @param max The Minimum pwm value
 * @param deadbandMax The high end of the deadband range
 * @param center The center speed (off)
 * @param deadbandMin The low end of the deadband range
 * @param min The minimum pwm value
 */
void PWM::SetBounds(INT32 max, INT32 deadbandMax, INT32 center, INT32 deadbandMin, INT32 min)
{
	if (StatusIsFatal()) return;
	m_maxPwm = max;
	m_deadbandMaxPwm = deadbandMax;
	m_centerPwm = center;
	m_deadbandMinPwm = deadbandMin;
	m_minPwm = min;
}