Progress with the PDM programming

 Not much has happened over the last few months since I collected the batteries, I've been working on the CAD model for the battery pack but not made as much progress as I wanted to. But my PDM and dash finally turned up, I mocked up a piece of ply and a few switches and lights just to make playing around a bit easier. I'm still learning how it wants to be programmed, Its extremely simple when you get used to it, however that does mean doing complicated this is a bit tricky and you have to do some work arrounds.

For example, for the colour of the key light on the CAN keyboard you program this via changing the value of a byte in the can protocol. Different numbers give different colours, example 0=off 1=green 2=red 3=white. The standard way of programming this is to use the Switch it's self that will equal 1 when on and a multiplier. If you want red you set the multiplier to 2. So when the switch is off 0x2=0 this is off, when the switch is on 1x2=2 this sets to red. However I wanted the switches to backlight in white when the sidelights are on, and also multi position switches and have different colours. 

This can be achieved by using a status variable and then rather than using the value of the switch either 0 or 1 multiplied by the multiplier, the status variable can output any value depending on conditions. If sidelights are on then =3, if switch is in position 1 then =1, position 2 then =2. This allows the colours of the switch lights to be set to different colours. I was very excited when I worked out how to do this I must admit, noting revolutionary but a nice sense of achievement. Its things like this why I tend to enjoy the build more than the driving.


A quick video on my progress so far, this has been hours on the laptop working this out. Most of that has been learning the AIM software for programming the PDM, I get the feeling this car is going to require more laptop hours than garage hours. 



Note: it is only 28 batteries I have got, not sure why I thought it was 30. 

Comments