Low cost CAN gauge

A forum for discussing the MegaSquirt related (but non-B&G) board development, assembly, installation, and testing.

Moderators: jsmcortina, muythaibxr

Re: Low cost CAN gauge

Postby xrattiracer » Tue Oct 13, 2015 2:27 pm

source code and pcb artwork has been posted to github - https://github.com/merkur2k/MSGauge
OLED version has some performance problems, but otherwise works well. Stepper version works, but is barebones and also has performance problems.
xrattiracer
Experienced MS/Extra'er
 
Posts: 300
Joined: Fri Aug 01, 2008 2:25 pm

Re: Low cost CAN gauge

Postby NewFoxau2 » Fri Oct 16, 2015 1:06 am

I really appreciate all the work you've put into making CAN gauges! I read over your previous thread using the teensy several times and spent many hours googling various parts, and had myself convinced it was the way to go. Then I finally clicked on this thread and now I'm not so sure. :D

I am working to convert all the gauges in my 77 Celica to CAN gauges driven by an MS3X. I've at least got them converted to using Switec motors so they are controlled by an arduino, but they are not yet CAN driven.

I'm a PCB designer by trade, and have traditionally used MSP430's in my designs. I've recently moved to the Arduino platform and I'm hooked to say the least. Programming isn't my thing, but Arduino libraries makes it easier. :)

I have a couple questions for you.

These LPC11C24 chips, can they be programmed in an Arduino environment? Or what are you using to program them?

If the price is right I might be interested in buying a couple of these if you get a run of them stuffed. Otherwise I can just assemble them myself.
NewFoxau2
Helpful MS/Extra'er
 
Posts: 38
Joined: Sun May 29, 2011 7:12 am

Re: Low cost CAN gauge

Postby xrattiracer » Sat Oct 17, 2015 10:04 am

it is not the arduino environment, but it is somewhat close. It uses mbed (www.mbed.com), or more specifically a version of it made to work with gcc called gcc4mbed. There is probably no reason the online compiler couldnt be used, but i have never tried.
the chips are programmed via a serial link (isp).
I have actually started working on a version of the teensy gauge that uses an lpc176x in place of the teensy as well as getting rid of most of the adafruit modules, the idea being to reduce cost.
xrattiracer
Experienced MS/Extra'er
 
Posts: 300
Joined: Fri Aug 01, 2008 2:25 pm

Re: Low cost CAN gauge

Postby NewFoxau2 » Sun Oct 18, 2015 10:42 am

The teensy was a good solution while running the screen, but it seems a bit overkill when running just switec motors.

I used an arduino nano on mine as a stepping stone, but CAN control is the goal.

I'll order one of those LPC demo boards and see what magic I can make happen. :)

http://foxau2.tumblr.com/post/129264649 ... tec-gauges

Nate
NewFoxau2
Helpful MS/Extra'er
 
Posts: 38
Joined: Sun May 29, 2011 7:12 am

Re: Low cost CAN gauge

Postby NewFoxau2 » Sun Oct 18, 2015 7:56 pm

I was looking through the datasheet on the lpc11c24 and it says it's capable of ISP over CAN. That means (at least in my mind) that the gauges could be programmed over CAN! In my dreams I see the ability to modify the gauges straight from TunerStudio. Modify the ini to give us new potions so we could set which parameter to display on which motor, what sweep the needle should run, etc.

That kind of software writing is, for the moment, beyond my abilities, but if the hardware is designed in a such a way that the ability is there, then those capabilities could be developed in the future.

On your board, do you have a jumper or something somewhere to "turn on"the CAN EOL resistor?

Nate
NewFoxau2
Helpful MS/Extra'er
 
Posts: 38
Joined: Sun May 29, 2011 7:12 am

Re: Low cost CAN gauge

Postby xrattiracer » Mon Oct 19, 2015 8:36 am

while it can do ISP over CAN, it uses a protocol that ms doesnt speak (openCAN). I assume it would take a lot of work to get ms to talk with them directly, and likely isnt even possible.
what would be more useful is if tuner studio could do all its stuff via CAN, then the tuner studio host could talk directly to the gauges in whatever protocol is required. there is a solder jumper to switch over to CAN ISP.
there is no jumper for the termination resistor, but i will be adding at least a solder jumper for it. I also plan to switch to using 4/6 conductor phone wires with rj11/12 jacks in the back of the gauges, should make wiring easy (2 connectors on the low cost gauges, probably only fit one connector on the teensy gauge).
xrattiracer
Experienced MS/Extra'er
 
Posts: 300
Joined: Fri Aug 01, 2008 2:25 pm

Re: Low cost CAN gauge

Postby racingmini_mtl » Mon Oct 19, 2015 8:53 am

xrattiracer wrote:what would be more useful is if tuner studio could do all its stuff via CAN, then the tuner studio host could talk directly to the gauges in whatever protocol is required.

TunerStudio can do its stuff via CAN. That's called CAN passthrough and it uses the MS (MS2/Extra or MS3) as the serial port interface and translator. You just need to implement the MS CAN protocol on your device. You also need to create an ini file that describes your device interface and memory allocation following the MS protocol and standard.

That's how my CAN devices (IOx, TinyIOx,...) get configured. That's also how the trans controller is configured.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
racingmini_mtl
Super MS/Extra'er
 
Posts: 8012
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada

Re: Low cost CAN gauge

Postby xrattiracer » Mon Oct 19, 2015 9:42 am

i was thinking more like the tuner studio host sitting on the CAN bus directly and talking to the ms that way.
It will likely never be possible to implement enough of the ms protocol on this target due to its limited flash size and no non-volatile storage for saving settings.
xrattiracer
Experienced MS/Extra'er
 
Posts: 300
Joined: Fri Aug 01, 2008 2:25 pm

Re: Low cost CAN gauge

Postby racingmini_mtl » Mon Oct 19, 2015 10:17 am

Build a serial-to-CAN translator. I have one and TS can see all the CAN devices on the same bus. You could base it on the same CPU and be creative so that it can both use the MS protocol and allow the use of the ISP over CAN commands. But I don't know enough about openCAN to know if there would be conflicts with the MS CAN traffic and devices.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
racingmini_mtl
Super MS/Extra'er
 
Posts: 8012
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada

Re: Low cost CAN gauge

Postby xrattiracer » Mon Oct 19, 2015 2:03 pm

ive managed to find space to fit a i2c eeprom on the pcb. this will allow local storage of settings etc.
xrattiracer
Experienced MS/Extra'er
 
Posts: 300
Joined: Fri Aug 01, 2008 2:25 pm

Re: Low cost CAN gauge

Postby NewFoxau2 » Thu Oct 22, 2015 8:29 pm

Have you tried running the motor by driving it directly from the IC pins instead of using a driver chip? I run all mine directly with both the Arduinos and the MSP430 chips and have never had any problems. The LPC chip might be more sensitive or may not be able to source as much current, that's why I'm asking. If you can do away with it, it would free up some room and simplify the board, as well as saving a little money on the BOM.

I've never used Eagle before (I use Ultiboard from NI) but I'm working on learning it now so I can contribute. :D

To program the LPC chip, do you just use the demo board as a programmer?

Nate
NewFoxau2
Helpful MS/Extra'er
 
Posts: 38
Joined: Sun May 29, 2011 7:12 am

Re: Low cost CAN gauge

Postby xrattiracer » Fri Oct 23, 2015 10:27 am

yeah the LPC chips dont have enough high current i/o pins. this 11c24 has 2 20ma sink and 1 20ma source.
programming is done via ISP. all that is required is a serial adapter (FTDI or similar). a standard 1x6 ISP header is onboard.
at this point there really isnt much to do on the hardware side. software is where i am having problems. specifically, dealing with the CAN traffic. I have to look at every packet to see what its id is, which is taking far too much cpu power and making the needle movement erratic. Its supposed to be able to do hardware filtering, but so far i have been unable to make it work.
xrattiracer
Experienced MS/Extra'er
 
Posts: 300
Joined: Fri Aug 01, 2008 2:25 pm

Re: Low cost CAN gauge

Postby NewFoxau2 » Fri Oct 23, 2015 10:45 am

Sounds good! I'm going to send off a couple to be printed (I'll assemble them myself) and give them to two of my friends who have helped me in most my projects where the code is out of my realm. One of them has a little experience with automotive CANbus communications so that should really help!

Do you feel confident the board design is ready to go? (no small things to fix?)

Is there a BOM feature in Eagle to help order parts? It looks like you've got everything pretty well labeled, but if there's an existing list that'd be great. :)

Nate
NewFoxau2
Helpful MS/Extra'er
 
Posts: 38
Joined: Sun May 29, 2011 7:12 am

Re: Low cost CAN gauge

Postby xrattiracer » Fri Oct 23, 2015 12:17 pm

the artwork on github is newer than what i actually have on hand. it should be good, but i have made some kinda major changes to it that i have not yet tested (mostly adding the eeprom).
I do still need to generate a bom. dont depend on the values in the schematic, a lot of resistor values are not correct (copy and paste components, i was just trying to get the basic circuit done). I will try to at least get the schematic fully updated asap.
xrattiracer
Experienced MS/Extra'er
 
Posts: 300
Joined: Fri Aug 01, 2008 2:25 pm

Re: Low cost CAN gauge

Postby xrattiracer » Fri Oct 23, 2015 9:59 pm

ordered the latest version of the pcb for my own testing.
added a bill of materials to github. still need to add more product links, but its mostly there.
xrattiracer
Experienced MS/Extra'er
 
Posts: 300
Joined: Fri Aug 01, 2008 2:25 pm

Re: Low cost CAN gauge

Postby NewFoxau2 » Mon Oct 26, 2015 2:17 pm

Awesome thank you! I'll get it all ordered and see what I can do.
NewFoxau2
Helpful MS/Extra'er
 
Posts: 38
Joined: Sun May 29, 2011 7:12 am

Re: Low cost CAN gauge

Postby xrattiracer » Mon Oct 26, 2015 3:52 pm

just now updated the BOM a bit. didnt include links for most of the passives but im sure anyone can figure those out.
xrattiracer
Experienced MS/Extra'er
 
Posts: 300
Joined: Fri Aug 01, 2008 2:25 pm

Re: Low cost CAN gauge

Postby xrattiracer » Mon Oct 26, 2015 7:32 pm

bear in mind that not all components are needed depending on which gauge type you are building. i will get that broken out soon too.
xrattiracer
Experienced MS/Extra'er
 
Posts: 300
Joined: Fri Aug 01, 2008 2:25 pm

Re: Low cost CAN gauge

Postby NewFoxau2 » Mon Oct 26, 2015 7:36 pm

Mine are entirely going to be stepper motors. Have you considered perhaps adding 1-2 outputs that could drive leds? Basically just an indicator light.
NewFoxau2
Helpful MS/Extra'er
 
Posts: 38
Joined: Sun May 29, 2011 7:12 am

Re: Low cost CAN gauge

Postby xrattiracer » Mon Oct 26, 2015 8:47 pm

yeah at some point i am going to need to deal with lighting for the stepper gauges. havent made it that far yet though. have considered options like rgb leds, etc. i figured for now people would wire that in themselves.
i myself will not be using the stepper gauges standalone, they will be going in my stock cluster with its existing lighting.
xrattiracer
Experienced MS/Extra'er
 
Posts: 300
Joined: Fri Aug 01, 2008 2:25 pm

PreviousNext

Return to Expansion boards

Who is online

Users browsing this forum: No registered users and 2 guests