MDC1230 RawCAN issue

7 years 6 months ago - 7 years 6 months ago #29531233 by psammut
MDC1230 RawCAN issue was created by psammut
Hello!

I have two MDC1230 controllers that I am trying to get working through a RawCAN communication setup.

I created a Microbasic script that builds can frames and sends them over the canbus and they are read by a computer. This works fine.

I started running into problems with sending CAN Frames to the controller. For some reason, when I try to read certain frames that have been sent to the controller by running the ?CF query, the ESTOP gets tripped.

I started the debugging and have found that the the MDC1230 is not properly reading CAN frames. On top of that, it is exhibiting really weird behavior by tripping the ESTOP when I try to read certain CAN frames but not others.

For instance, when I send a CAN frame that is as follows:
  • 8 bytes length
  • ID: 32
  • Byte 0: 2
  • Byte 1: 100
  • Byte 2: 0
  • Byte 3: 0
  • Byte 4: 0
  • Byte 5: 0
  • Byte 6: 0
  • Byte 7: 0

and I run the ?CF query followed by the ?CAN query i get the following result:

?CF
CF=1
?CAN
CAN=32:0:0:2:0:0:0:0:0:0


The MDC1230 always shows a byte count of 0! Always! I've sent all kinds of CAN frames and the MDC1230 always shows a byte count of zero. On top that byte 1 is not read correctly and just shows 0, AND when I run the ?CF the estop gets tripped. I am verifying the CAN frames with a logic analyzer and they are well structured and are read by the logic analyzer properly. The RTR bit is not set and the extended IDs are not set either. I tried multiple baud rates and also multiple MDC1230s with the same result.

For other CAN frames such as: ID: 32, Length 8, Byte 0: 1, Byte 1: 100, Byte 2: 50, Byte 3-7: 0

I get this response:

?CF
CF=1
?CAN
CAN=32:0:1:100:50:0:0:0:0:0

the MDC1230 reads the data bytes correctly and does not trip the ESTOP when the function is called. It still messes up on the byte count and returns 0.

Am i missing something?

These are my settings:


I've played around with different baud rates, different listen node IDs and still nothing.

Help!! Please prove my thinking that there is a bug in the Roboteq firmware wrong!

Attachments:
Settings profile:
Microbasic test code:

Please Log in or Create an account to join the conversation.

7 years 6 months ago #29531234 by psammut
Replied by psammut on topic MDC1230 RawCAN issue
I did some more digging around the forums about CAN and found this microbasic test code posted up:
top:
if (getvalue(_CF, 1) > 0) ' if one or more frame is received
Header = getvalue(_CAN, 1)
ByteCount = getvalue(_CAN, 2)
Byte0 = getvalue(_CAN, 3)
Byte1 = getvalue(_CAN, 4)
Byte2 = getvalue(_CAN, 5)
Byte3 = getvalue(_CAN, 6)
Byte4 = getvalue(_CAN, 7)
Byte5 = getvalue(_CAN, 8)
Byte6 = getvalue(_CAN, 9)
Byte7 = getvalue(_CAN, 10)
print(Header,"\t", ByteCount,"\t",Byte0,"\t",Byte1,"\t",Byte2,"\t",Byte3,"\t",Byte4,"\t",Byte5,"\t",Byte6,"\t",Byte7,"\r")
end if
wait(10)
goto top

I gave it a shot and surprisingly I am printing out correct values of the data along with data length. It seems that reading the data through the serial commands at the console is causing problems?

The ESPOT is still getting activated on the reading of certain CAN messages. It seems to be linked to certain values of the first data byte. For instance, if I have a 2 or 3 as a value in the first databyte, the estop will get tripped. If i have 0 the estop doesn't trip.

At this point I can move forward and just work around the ESTOP issue by always have a 0 in the first data byte. I'd still like to know if i'm doing something wrong though.

Please Log in or Create an account to join the conversation.

7 years 6 months ago #29531302 by psammut
Replied by psammut on topic MDC1230 RawCAN issue
Any response on this? Why does sending certain CANFrames to the MDC1230 cause the ESTOP to be tripped?

Please Log in or Create an account to join the conversation.

7 years 6 months ago #29531303 by LROBBINS
Replied by LROBBINS on topic MDC1230 RawCAN issue
I do not know if this is related to the problem you've been having, but it might be. I am also using raw CAN in a setup with one Roboteq controller and three other CAN nodes. I have found that if the Roboteq script prints to Serial (RS232) with any frequency, the controller shuts down. What I have done in order to be able to use serial output for diagnostic purposes is to add a LoopCycles variable that is incremented each time through the main loop, and then do this:
IF (LoopCycles MOD 1000) = 0 THEN
  PRINT ("Speed=",Speed," Throttle=",Throttle,"    Turn=",Turn," Steering=",Steering,"\n")
END IF

If I need to see the information more frequently I might use MOD 300, or even somewhat less, but there's always some frequency of serial messaging that causes things to go completely haywire when using CAN.

Ciao,
Lenny

Please Log in or Create an account to join the conversation.

Moderators: tonysantoni
Time to create page: 0.099 seconds