So far I have managed to successfully map some data points from the control board and receive them on the teensy.
I have mapped tmpm first and then and uaux for this experiment. tmpm was controlled via a potentiometer onto the the motor temperature sensor pins so I could change the data.
I had some issues getting the data to make sense initially. In the end I found that gain controls the scaling of the data. I am still not sure entirely how yet. But a gain of 1 for tmpm gave me a good result on the teensy side.
I then moved onto mapping uaux onto another canbus ID. Again this needed a gain of 1.
So that was two messages on two different canbus IDs. Starting at position 0 for each one. Now I wanted to get a bit more complicated and move onto putting both messages into one ID, since each one was only taking up 8 bits this should all fit. Ideally similar to the CAN standard page on the wiki.
I eventually figured out that position means the bit position on the message, not the byte position I assume it to be. So I have now managed to successfully map two data points onto one CANBUS message.
However as you can see, I had to start the second message on bit 16, which means I am on the 3rd byte. Starting on bit 8 the data would not show.
So from this I have three questions.
- How exactly does the gain scaling thing work? I couldn't figure out how it scales.
- The data I get is whole numbers, which is fine for some things. But for others like the uaux it would be helpful to get some float numbers. I get a feeling the the gain is used for this sort of purpose?
- Is there an obvious reason why I am not able to get data onto the 2nd byte? tmpm was mapped to position 0 and was 8 bits long. So I would assume that starting at bit 8 for the uaux message should have worked.