|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools |
Rating:
|
Display Modes |
|
#10
|
||||
|
||||
|
Re: Black Jaguar RS232->CAN - anyone?
Guys,
I'm attempting to add all the commands for speed and position using woodk's code below and ran into something interesting. If you look at Get() in CANJaguar.cpp: float CANJaguar::Get() { UINT32 messageID; UINT8 dataBuffer[8]; UINT8 dataSize; INT32 replyValue32; switch(m_controlMode) { case kPercentVoltage: messageID = LM_API_VOLT_SET | m_deviceNumber; // Sending set with no data is a request for the last set ... The Get() method uses the LM_API_VOLT_SET API definition, but the Set() method uses the LM_API_VOLT_T_SET which is the FIRST trusted message version (I think). Does anyone know why this might be? Or does anyone know if this returns a correct value? I only just set up the CAN stuff yesterday and haven't gotten knee deep into debugging yet... In can_proto.h: //************************************************** *************************** // // The Luminary Micro Motor Class Control Voltage API definitions. // //************************************************** *************************** #define LM_API_VOLT (CAN_MSGID_MFR_LM | CAN_MSGID_DTYPE_MOTOR | \ CAN_API_MC_VOLTAGE) #define LM_API_VOLT_EN (LM_API_VOLT | (0 << CAN_MSGID_API_S)) #define LM_API_VOLT_DIS (LM_API_VOLT | (1 << CAN_MSGID_API_S)) #define LM_API_VOLT_SET (LM_API_VOLT | (2 << CAN_MSGID_API_S)) #define LM_API_VOLT_SET_RAMP (LM_API_VOLT | (3 << CAN_MSGID_API_S)) //##### FIRST BEGIN ##### #ifdef FIRST_FIRMWARE_VERSION #define LM_API_VOLT_T_EN (LM_API_VOLT | (4 << CAN_MSGID_API_S)) #define LM_API_VOLT_T_SET (LM_API_VOLT | (5 << CAN_MSGID_API_S)) #endif // FIRST_FIRMWARE_VERSION //##### FIRST END ##### - Bryce P.S. Any thoughts on value used in the Position mode for Set() / Get()? In the GetPosition() declaration it states the return value as a float. Does this suggest that position is limited to only one revolution? Also, what data type would one pass to set the encoders? Last edited by Bryscus : 22-01-2010 at 11:40. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Serial to CAN Gateway in new Black Jaguars? | dmcguire3006 | Electrical | 54 | 26-01-2010 07:32 |
| Release Announcement for the MDL-BDC24 (Black Jaguar) | JDNovak | FRC Control System | 2 | 16-12-2009 18:13 |
| The Black Jaguar | David Doerr | FRC Control System | 5 | 25-11-2009 15:43 |
| Can I control a victor/jaguar with an RC receiver | Bruceb | Electrical | 3 | 30-12-2008 10:50 |
| Will ANYONE mess with the black balls? | archiver | 2001 | 0 | 23-06-2002 22:35 |