Speedo out to drive DC motor

A forum for discussing applications and implementations of the MegaShift transmission controller code for the GPIO from B&G. This can control up to 8-speeds and 6 shift solenoids (plus a 16x9 table for controlling a PWM line pressure valve). It has manual and fully automatic modes (16x9 load x speed table), with under and over rev-limit protection, and full data logging of all inputs and outputs (among many other abilities). A TransStim to test your completed board is also available.
tobmag
Posts: 206
Joined: Mon Jan 02, 2012 4:22 am

Re: Speedo out to drive DC motor

Post by tobmag »

Tobmag, the current code is 100% documented. If I get run over by a bus, when the cheering stops users will have access to complete descriptions of all the parameters available on the web and in TunerStudio. This is entirely unlike some efforts, whee the documentation lags months or years behind code releases.

Lance.

Thanks for your reply, this makes me feel much calmer.
Actually it was me and not tmoble playing with the SP1 in PWM mode to run an DC motor for the speedo.
I will attach a log and my .msq when I'm back home

Many thanks Lance
tobmag
Posts: 206
Joined: Mon Jan 02, 2012 4:22 am

Re: Speedo out to drive DC motor

Post by tobmag »

Heres a log and my msq.

BR//Tobmag
Attachments
CurrentTune.msq
(38.66 KiB) Downloaded 510 times
Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: Speedo out to drive DC motor

Post by Bernard Fife »

tobmag,

Thanks, I will have a look. I need to dig into the code on a couple of other fronts, so I will have a look at this too. It should only take a few days at most.

Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw
tobmag
Posts: 206
Joined: Mon Jan 02, 2012 4:22 am

Re: Speedo out to drive DC motor

Post by tobmag »

Well we just got about 40cm of snow so I'm in no hurry really :-)

Also looking at a really nice set of VDO gauges, speedo and tach so I might ditch the DC motor but would anyway be good to have this sorted.

Was thinking of another application that could be fun on a "racing car" that would be a speed sensetive PAS, quite simple to put in a PWM valve between the pump and steering rack. Dont really want to have any glitch in the signal there....

Just for my own understanding, I was looking at the log my self and couldnt see any drops in the pwm signal while shifting gear but the motor is reacting heavily.
(If I now was looking at the right output?)
I assume that what we see is just a calculation of what the ECU is about to send out, its not really any measurement?

If this is so in reallity we only se a calculation of an output rather then the actual value?



BR//Tobmag
Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: Speedo out to drive DC motor

Post by Bernard Fife »

I assume that what we see is just a calculation of what the ECU is about to send out, its not really any measurement?
tobmag,

That's right, the reported value is calculated. It doesn't make a lot of sense to use up an input to monitor an output channel (otherwise we would be cutting the useful I/O in half, and these are already scarce and precious).

The PWM percentage is supposed to be calculated whenever the commanded PWM for the output changes, but there are one or two ways in which this calculation can fail to happen in the code, and I will make sure those are fixed.

Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw
tobmag
Posts: 206
Joined: Mon Jan 02, 2012 4:22 am

Re: Speedo out to drive DC motor

Post by tobmag »

Lance.
That's right, the reported value is calculated. It doesn't make a lot of sense to use up an input to monitor an output channel (otherwise we would be cutting the useful I/O in half, and these are already scarce and precious).
Yes I fully agree but this is just to highlite that what you see in a log might not be the reality, I used to work as a technical trainer for construction equipment and they also have quite a few ECU today and same thing there, diagnostic tools that we used is only showing a calculation not any actuals...

I did some more testing since I was thinking that maybe the small DC motor somehow was disturbing the electronics so I hooked up a normal lightbulb instead.

What I can see is that I cant get any voltage lower then about 3,5V so it jumps from zero to there...
Voltage is very irratic and will jump all over the place making it almost impossible to get a good reading, it will however get better after about 7-8volts.

Frequence, I understood that this would be set by PWM Period under "spare port PWM set up" and frequnce is then fixed and then the pulsewidth will be 0-100%?
Now when starting at about 3,5V I have about 4kH and at 10V I have about 1,5kH
There is no difference when changing PWM period.

The above apply for both DC motor and lightbulb.

BR//Tobmag
Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: Speedo out to drive DC motor

Post by Bernard Fife »

Tobmag,

A voltmeter isn't very useful for measuring the proper operation of PWM, you really need to look at traces on a oscilloscope. I will do that shortly.

Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw
tobmag
Posts: 206
Joined: Mon Jan 02, 2012 4:22 am

Re: Speedo out to drive DC motor

Post by tobmag »

Could be but usually you are able to measure the voltage over the load from a PWM driver

Dont have any oscilloscope (at home) so I'll wait for your findings


BR//Tobmag
Bernard Fife
Posts: 1696
Joined: Fri Apr 04, 2008 1:28 pm

Re: Speedo out to drive DC motor

Post by Bernard Fife »

Tobmag,

Yes, you can certainly measure the voltage. But interpreting that measrement is full of pitfalls, and maybe tell you more about your voltmeter than about the signal or the loads.

Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw
tobmag
Posts: 206
Joined: Mon Jan 02, 2012 4:22 am

Re: Speedo out to drive DC motor

Post by tobmag »

tell you more about your voltmeter than about the signal or the loads.
Thats right, now thinking back what we did during the training sessions was not to measure the voltage ......we measured the pressure from the pwm valves.
Well been a bout 10 years now since I swapped job....

I think an old analog voltmeter would be better than a digital unless you have a USD1000 Fluke...

BR//Tobmag
Post Reply