PDM 30 counter examples? and voltage input to int value?

Discussion and support for MoTeC Power Distribution Modules

PDM 30 counter examples? and voltage input to int value?

Postby david_wallis on Fri Dec 09, 2016 7:28 am

Does anyone have any examples of using the counter for the keypad button.

For example keypad button 1, first press SideLights and tail lights.. 2nd press Low beam and tail, 3rd press High Beam and Tail..

Also I have a rotary 12 position switch with a resistor network on it, which I can then configure functions to respond on voltage thresholds, but is there a way of having the 12 voltage thresholds then map to the position number that I can then retransmit via can bus?

I can set a function to respond to the threshold but I need one output that can go via can.. not 12 different values.

Thanks
david_wallis
 
Posts: 3
Joined: Mon Nov 28, 2016 6:06 am

Re: PDM 30 counter examples? and voltage input to int value?

Postby the_bluester on Fri Dec 09, 2016 11:24 am

I don't have a resistor network voltage divider setup on anything so I can not help there.

If you are looking for examples of using counters with keypad buttons I have three at the moment.

One counter I am using is related to logging which driver is in my car (There are two) and it uses a single button. On engine start detection and also on detection of a stationary period a condition becomes true that I use as an alarm in the dash to remind whoever is in the car to select their dash page. A keypad button is assigned to this function. Firstly if the button is pressed when the condition triggering the reminder alarm is active, it resets that to false (Clearing the alarm on the dash) subsequent button presses increment the counter 0-1-2-0-1-2 etc. The counter value is sent on the CAN bus and used as the condition to select dash pages. The counter value is logged in the dash so we can look at data later (Which might be collected over a weekend) and tell at a glance who was in the car.

I am using a keypad button to increment or decrement (Depending on button press length) a counter that is used to select between wipers off, intermittent, low or high.

finally I have two buttons which generate a pulse function each that I use to increment and decrement a counter, the value of which is sent on the CAN bus and used as a percentage value to set the dash and shift/alarm LED brightness. with a bit more work I hope to have a modifier in there which creates a default brightness when headlights are on versus off.
the_bluester
 
Posts: 210
Joined: Wed Nov 04, 2015 9:30 am

Re: PDM 30 counter examples? and voltage input to int value?

Postby adrian on Fri Dec 09, 2016 11:46 am

Firstly create a Function that is configured as a counter. Have the input as the keypad button you want to use and have the maximum value set to 3.

Then in your outputs you have:

Side lights True when counter == 1
Tail lights True when counter >= 1
Low beam True when counter == 2
High beam True when counter == 3

What voltage supply do you have for the rotary switch? If it is unregulated 12V then it isn't going to work very well into the PDM. The PDM is really designed for on/off switches only. You might find that the switch works differently whether the engine is running or not.

I can't think of any nice easy way to create a channel that is the 12 states of your switch to be sent on CAN. All of the function outputs are boolean except for the counters. You could maybe use a function for each switch state and feed them into another function that then pulses a counter. You would have to come up with some smart comparisons to work out whether the switch is moving clockwise or anticlockwise so you increase or decrease the counter correctly.
adrian
MoTeC
 
Posts: 719
Joined: Mon Apr 13, 2015 5:16 pm

Re: PDM 30 counter examples? and voltage input to int value?

Postby the_bluester on Fri Dec 09, 2016 2:03 pm

Are you aware Adrian of any CAN based rotary switches? I have been googling but without success, they could be useful for a number of functions and with a known CAN address would be relatively simple to input to a dash or PDM.
the_bluester
 
Posts: 210
Joined: Wed Nov 04, 2015 9:30 am

Re: PDM 30 counter examples? and voltage input to int value?

Postby adrian on Fri Dec 09, 2016 3:53 pm

I am not really aware of any simple rotary switches that work on CAN, but then I haven't really specifically looked either.

I do know of some rotary dials that work on CAN but they are a fair bit more complicated than simple multi position switches. Search for a company called Grayhill, they have a lot of nice CAN based dials/keypads.
adrian
MoTeC
 
Posts: 719
Joined: Mon Apr 13, 2015 5:16 pm

Re: PDM 30 counter examples? and voltage input to int value?

Postby the_bluester on Mon Dec 12, 2016 8:46 am

Yes, now that you mention them I had found them once before when I first started looking into the CAN stuff. Probably a bit of overkill for my purposes.

What would be great would be if someone sold a multi position switch with a CAN interface which sent a simple binary value to indicate the absolute position of the switch. 0000000 for the zero position up to 1100100 for full scale, with or without position detents. That or a stop number, 0000 for the first position 0001 for the next, up to 1011 for the last to use the 12 position rotary example.

I will keep hunting the net though I do not expect to have much success, not exactly likely to be a high demand device. If I find one I will link to it here.
the_bluester
 
Posts: 210
Joined: Wed Nov 04, 2015 9:30 am

Re: PDM 30 counter examples? and voltage input to int value?

Postby adrian on Mon Dec 12, 2016 9:39 am

If you do find something let us know. The biggest problem with CAN is cost, in the automotive world CAN is a pretty high cost addition so you don't see a lot of small simple devices running on CAN (this is one of the reasons you still see LIN devices as they are cheap).

This doesn't mean they don't exist somewhere, just much harder to find.
adrian
MoTeC
 
Posts: 719
Joined: Mon Apr 13, 2015 5:16 pm

Re: PDM 30 counter examples? and voltage input to int value?

Postby Turby on Tue Dec 13, 2016 10:41 pm

I looked for ages for something similar for my PDM setup. I wanted a small control box which handled my "multi function switch" (steering column stalks) and all the dash indicators without having to run lots of wires to and from the PDM.

I ended up building my own PIC based device which handles up to 22 switches (18 switched to ground, 4 switched to 12v), 16 outputs (up to 50ma) for dashboard indicators (either all 5v or 12v) and a 12 position rotary switch interface. Simple CAN message sent to PDM gives switch statuses and rotary position (0-11) and I use up to 2 PDM CAN output messages to drive the 16 outputs based on whatever PDM channel / logic you desire! No programming of the module is required. I did toy with the idea of using the PDM status messages to control the indicators but this would require the module to be configured somehow - perfectly doable but more hassle than it was worth.

Works fine on the bench in test mode and will be fitting over the next month in the race car along with the rewire.

PS Sorry for the thread hijack :oops:
Turby
 
Posts: 36
Joined: Wed Dec 31, 2008 10:59 pm

Re: PDM 30 counter examples? and voltage input to int value?

Postby the_bluester on Wed Dec 14, 2016 8:51 pm

It is one thing Racepak has which makes a bit of sensethough it's functionality is limited to on/off switches. They have a 16 input switch module that you can connect to their system. But they used a proprietary format rather than CAN.

I have had no joy in chasing up anything so far. I don't suppose there is any prospect of any multi input switch module from Motec? Perhaps somethign like the E816 but with less analog inputs (Still handy for potentiometers perhaps) and more switch inputs.
the_bluester
 
Posts: 210
Joined: Wed Nov 04, 2015 9:30 am

Re: PDM 30 counter examples? and voltage input to int value?

Postby greenamex2 on Thu Dec 15, 2016 1:20 am

the_bluester wrote:It is one thing Racepak has which makes a bit of sensethough it's functionality is limited to on/off switches. They have a 16 input switch module that you can connect to their system. But they used a proprietary format rather than CAN.

I have had no joy in chasing up anything so far. I don't suppose there is any prospect of any multi input switch module from Motec? Perhaps somethign like the E816 but with less analog inputs (Still handy for potentiometers perhaps) and more switch inputs.


Something like these?

http://motorsportelectronic.com/Hjem/HP8451.html
http://www.obr.uk.com/steering-wheel-ca ... controller

I ended up buying an MDD off ebay to do the same thing. I probably won't even have the MDD display visible.
Motec CDL3+M130+LTCD+MDD+PDM15+PDM16M+ESDL3
Nissan VQ30DE fitted to an AM Sportscars EX2 with a Hewland HP 2000
greenamex2
 
Posts: 370
Joined: Fri Sep 12, 2014 7:06 am
Location: England

Next

Return to PDM15 PDM16 PDM30 and PDM32

Who is online

Users browsing this forum: No registered users and 0 guests