Basic PICAXE CAN Network

BrendanP

Senior Member
Interesting thread.

The caveats re. mcu's in cars reminded me of my late father adopting the same stance with aircraft.

He built several aircraft at home,

http://www.auf.asn.au/constructors/powning.html.

He wouldn't allow any hard wired IC's/digital electronics in the aircraft. He had a free standing battery powered GPS and transceiver.

BTW, "IP55" relates to the enclosures water/dust ingress protection rating. Wiki has a rticle on it.
 

chipset

Senior Member
keep the alternator!!! A rally car needs a consistent electrical system. Last thing you need is a car that "might" have a low battery. An alternator is the last thing you should be worrying about as far as hp loss or weight. I absolutely guarantee that there isnt a competition vehicle on earth less drag cars that dont have an alternator. F1 does, ALMS does, FIA, WRC, SCCA hell I could name numerous racing entities that have cars that would require by necessity an alternator.

I posted a thread that had alot of info regarding vehicle power supplies. The caveats are there to keep "less skilled" people from damaging their cars or hurting people on the road.

If you are worried about hp loss then spend more time on your motor program and/or find more efficient accessories to drive off the engine. Weight wise you are talking maybe 12 lbs and a nice competition ready alternator could weigh as little as 3-4 lbs.

Think twice before you start messing with your charging system or your gonna be listed as a DNF because of it...
 

mst

Member
I do take your point, but there's no reason why a car doing short stages can't be missing a charging system. Just because it's not the 'done thing' by whoever doesn't mean it can't or shouldn't be done. What do you think people said about the first man to say hey lets get rid of the camshaft and all that junk and stick in some pneumatic valves! They thought he was a madman, next thing you know every F1 car out there has pneumatic valve train.

As I said before the alternator removal is more about reducing the rolling mass of the motor (not talking about the car but the spinning parts of the motor). Less rotational mass means faster spin up and down which is what you need for rally to be able to adjust the wheel speed easier to accommodate the amount of traction required to do what you need.

Now take the electrical load into account that is required to make the car function at maximum load (all lights on, motor just before rev limit (motor on the limiter will consume less energy).
Lights and all- No more than 85 watts
fuel pump - 240 watts
ecu (including injectors and ignition - less than 120 watts

So total load is like 445 watts or 37 amps
Battery is 80 amp hours
Most races are under 2 minutes, 16 races a day total 32 minutes + some idle time.
 

MartinM57

Moderator
How many amp hours to restart a recalcitrant engine at least 16 times?

What sort of "rally car" are you talking about - doesn't sound like traditional forest/tarmac rallying as you'd have many other electrical loads. Sounds more like some sort of circuit racing?

Anyways, apart from the distraction of whether you remove the alternator or not (I definitely wouldn't - you're risking miniscule advantages against the big risk of running out of power completely) it's an interesting project and as it looks like your first one, there's a lot of learning ahead. Looking forward to a "Finished Projects" forum entry :)
 

Dippy

Moderator
Martin, maybe he jump starts it? Mind you a stall and restart could take the beans out the battery.

mst,

Sounds a lot of fun.
I used to be car mad a few years back, so may I just ask about cars for a second?

Is the alternator rotational mass that significant?
I completley understand the theory by the way.
In my old RS2000 I had a few pounds shaved off the flywheel and apart from a slightly faster spin up in neutral I could hardly notice any difference when actually driving the thing.
All those other rotational masses (of a production car) such as transmission and wheels meant a Kg or two off my flywheel was pretty insignifcant in the bigger picture.

Conicidentally, I had a slipping fan belt on that car and noticed a definite drop in power when that extra volt or two was lost from the supply when the belt slipped. This a seat of the pants 'measurement' and not a dyno. Would this be the same with more modern cars?

I'd be happier with a lightweight alternator if available. But I bet there is a price tag inversely proportional to weight :(

Back to the plot.
Personally, I wouldn't use qualifiers. If the qualifier got corrupted then barf!
As said above, 8 bits (pun intended) of on/off info can be sent in a single byte - though the initial explanation required a double-take :)
Actually, unless space/budget is an issue, I wouldn't use the 08M.
I'd use a PICAXE which has a serial timeout or serial background read capability.
IMHO, any PICAXE where the serialIN is a blocking command is susceptible to Sod's Law and get stuck one day.
Your code must NEVER get stuck.
 

Andrew Cowan

Senior Member
A lot of the time, power is coming straight from the alternator. In one of the minibusses at school, the battery is only connected when the engine is off - once the alternator is running, the lights and everything are all driven straight off the alternator. Car batteries are designed to start cars, and not much else.

A
 

Dippy

Moderator
With risk of another tangent that sounds funny Andrew.

So, when the engine is running (on your school bus) the battery isn't connected?
How does it get charged?

I have heard that some alternators are clutched and can engage/disengage depending on conditions.

"Car batteries are designed to start cars, and not much else."
- this will cause a stir.
Surely batteries also act as a 'reservoir' for sudden high loads esp at low revs. when alternator not providing much oomph.
A sudden high load at tickover could cause a big dip without a battery - and the ECU could be upset.
(A friend had exactly this happen on his boat with a battery isolator getting knocked 'off').

Maybe your school bus has a special design or the Physics teacher was drunk :)
 

mst

Member
Jump start is the go, from a tender vehicle and large 2 pin connector.
The alt's rotational mass sure does make a difference, in power and response. Even an electricity disconnected (belt on but no wiring) affects the power output of the motor measured on a roller dyno.

You noticed a slightly faster spin up in neutral with a lightened flywheel, did you have any further modification?
This car has lightened balanced crank, chrome molly flywheel rods and pistons. Put it this way, the rolling mass of the motor is low enough to worry about the alt's influence. Also it does have it's advantages, if the system is designed to run with no alt that means the car has NO BELTS :D now that is an advantage.

The vehicle is also front wheel drive so drive train losses will be kept to a minimum.

Andrew: I'm not quite sure what Buss you may have at school, but alot of newer vehicles wont even function without a battery connected (start car, remove battery, stall).
 

Dippy

Moderator
Thanks MST. Interesting.
The old RS had lightened/balanced crank too but nothing much else.
I went on a diet but that didn't help much either :)
Ah, happy days....

Anyway, back to the plot...
Time for you to do a nice schematic and plan the code flow.

(It's about time someone did a nice 2 or 3 wire trailer lighting system too. Piece of cake.)
 

BeanieBots

Moderator
Just my tuppence as an ex rally driver of the 80's .
I'm surprised the alternator inertia/rolling-resistance has much impact but we did turn-down the prop-shaft and noticed an improvement so I guess every little counts.
The races I took part in were MUCH longer duration so no alternator would not have been an option. However, at around the time I started getting too old and slow for it anymore, we did start experimenting with only having the alternator engaged during braking and could get around 3% fuel saving and a minescule improvement in accelleration.
 

mst

Member
Just my tuppence as an ex rally driver of the 80's .
I'm surprised the alternator inertia/rolling-resistance has much impact but we did turn-down the prop-shaft and noticed an improvement so I guess every little counts.
The races I took part in were MUCH longer duration so no alternator would not have been an option. However, at around the time I started getting too old and slow for it anymore, we did start experimenting with only having the alternator engaged during braking and could get around 3% fuel saving and a minescule improvement in accelleration.
That is good to hear, as this is a limited class as far as engine displacement is concerned (turbo/supercharging also means that your capacity has a multiplication factor), your experience coupled with the fact that the alt and belt simply won't even be there will provide a reasonable amount of difference. Even a 'minescule improvement' is worth it as far as I can see.

Thanks for your comment!
 

mst

Member
Got a circut diagram for the slave units, take a lookie....


Sorry about the crude drawing, mspaint style as no software to do it.

That mess with the cap and resistor on the darlington output is an attempt to generate an analogue voltage from pwm. Will it work? I'm not sure what values to put to them either.
 

Dippy

Moderator
PWM is on PIN5 for an 08M isn't it?

Why do you want to 'generate' an analogue? I'd take those R and C things out.

And geat care is needed if you don't have a res in series with an LED.
As this is new to you, always stick a res in.
 
Last edited:

hippy

Ex-Staff (retired)
You don't need the ULNxxxx for driving LED's, they can be driven directly from the PICAXE unless they draw over 25mA and you will need current limiting LED's ( either way ). Easier / more logical to connect LED's to 0V then 'HIGH pin' turns the LED on.

PWMOUT is on leg 5, and you don't need the RC. Just drive it as a normal LED, varying the PWM will vary its brightness without converting to analogue first.

Also, you cannot use the download Serial In for slave comms in ( no SERRXD on 08M ). Serial In has to be a 10K/22K or tied to 0V ( direct or via an R ).
 

mst

Member
The led's are 1 watt luxeons, so I think that equates to 200ma (@ 5v), and I tried it and it didn't work. I think it needs some kind of driver?

Analogue voltage is required for the stop/tail light (headlights on produce a 50% brightness and brake is 100%), but it's not required? Just use PWM and all is well? Does the delay in your eyes or brain make it look static still?

I built this circut without the rc and ran it off 4.5v (3x 1.5v batteries) and not burnt out the led's, but I don't want to either. What value would you recommend?

If the serial download pin can't be used for serin, can I use pin 3 for out and pin 4 for in?
 
Last edited:

BeanieBots

Moderator
Be careful not to get your pins and legs mixed up.
Pin3 (leg 4) is input only.
Your diagram is OK but your wording is not.

Driving luxeon LEDs.
Not easy from 5v and possibly impossible (at full rating) via a darlington driver.
The should really be driven at constant current via a suitable driver.

However, it is possible to use a resistor but the losses will be high.
You will need to refer to the datasheet to get Vf for your LEDs and Imax.
If using a darlington driver, assume 1.2v loss.

R=(5-1.2-Vf)/Imax

You might find that equation gives you a negative number in which case you need to drive them from a higher voltage or use a different driver.

EDIT:
When driven with PWM, they flash so fast you don't notice.
Look up "POV" persistance of vision.
 
Last edited:

mst

Member
Trying to test the pwmout command but cannot get it going.. not quite sure where i'm going wrong.

Code:
pwmout 2 , 99, 396
Is there somthing wrong with that?
 

eclectic

Moderator
Trying to test the pwmout command but cannot get it going.. not quite sure where i'm going wrong.

Code:
pwmout 2 , 99, 396
Is there somthing wrong with that?
The code should give you full-on, on pin2.

What's it connected to, and what exactly is or isn't happening?

e
 

mst

Member
Using a 08M, look a page or so back and there is a circut diagram. Connected to a darlington driver and luxeon led.

Works fine if you say 'high2' but using PWM no output at all
 

eclectic

Moderator
Using a 08M, look a page or so back and there is a circut diagram. Connected to a darlington driver and luxeon led.

Works fine if you say 'high2' but using PWM no output at all
OK, that's #58.

Try this very short program
Code:
Main:

pwmout 2,96, 300

stop
e
 
Last edited:

D n T

Senior Member
When it grows up it will be a BMW

I think BMW or and a few other high end european cars use this exact system. So it works and is worth the trouble.
I am reading and following intently, what is this car you rally
 
Last edited:

mst

Member
Yep, cheers eclectic, works bonza. pwmout command can't just be left there on it's own hey? Sorry guys for all the questions but I realy do appreciate your help!
 

mst

Member
I think BMW or and a few other high end european cars use this exact system. So it works and is worth the trouble.
I am reading and following intently, what is this car you rally
Well this is my first rally car so I'm starting out safe. I've got a '91 ford laser 4 door. Might not sound much but I've modified the engine quite extensivly and it does make a fair amount of power. I do have a better car to step up to but I'm in no rush to get that one in the dirt without having a fair amount of hours under my belt!
 

mst

Member
Ok, still writing the code for the slave units, this question relates to the indicator oscillation.
Is there any way to keep a slow oscillation going (like 2 hertz) without having to write some sort of counter in the loop that listens for serial data? (like without somthing like every 100th loop toggle the output)
The timing would be all wacko depending on delays waiting for data and other parts of the code.
 
Last edited:

eclectic

Moderator
Ok, still writing the code for the slave units, this question relates to the indicator oscillation.
Is there any way to keep a slow oscillation going (like 2 hertz) without having to write some sort of counter in the loop that listens for serial data? (like without somthing like every 100th loop toggle the output)
The timing would be all wacko depending on delays waiting for data and other parts of the code.
Yes.
I think you will need the
Interrupt on High, then Serin approach.

This is incomplete, but meant as a starter.

Code:
;picaxe Pin1 flashes LED
;if Pin4 goes high, then
;Serin value b0,  then do other things


#picaxe 08M

setint %00010000, %00010000

main:
toggle 1
pause 500
goto main

interrupt:

serin 4,n2400, ("ABC"),b0

; do things with b0

setint %00010000, %00010000

return


#rem
see Manual 2.  Pages 169, 178
But first,
can you describe, or preferably draw,
a flowchart of your "Whole system"?

e
 
Last edited:
Top