BVE WorldWide
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Ammeter feedback and auto panto-up

3 posters

Page 1 of 2 1, 2  Next

Go down

Ammeter feedback and auto panto-up Empty Ammeter feedback and auto panto-up

Post by ebennekom Tue Mar 06, 2018 9:26 pm

Hi All

For a locomotive I'm building I've got two questions.

First. The real thing has about 20 power settings. When pulling away from standstill the operator can't just click to the highest position without causing a lot of wheelspin, but also.... having it pull too many amps resulting in blown fuses/breakers crapping out.

So I'd like to mimic the behavior if say the ammeter returns a certain value trigger a couple of events. So I'd need to know how to read the amps consumage into my panel. Any thoughts on how to do this?

Second
This loco would normally use both panto's to pull away from standstill and the operator would lower one of them when a certain speed (40km/h) is reached. I'd like to automate that, so what would be the proper approach to have an animation of a lowering panto triggered externally and a voltmeter to drop to zero in the cabin.

I'm not looking for a 'gimme the codes!' solution here, just a hint in the right direction or a Can't be done, don't waste your time would be appreciated.

ebennekom

Posts : 53
Join date : 2017-12-14
Location : Alicante, Spain

Back to top Go down

Ammeter feedback and auto panto-up Empty Re: Ammeter feedback and auto panto-up

Post by leezer3 Tue Mar 06, 2018 9:42 pm

The sim itself won't do this, but I'm sure it could be done with minimal trouble with a train plugin.

I'll do some twiddling with BVEC_ATS tomorrow & see if I can get something working Smile
Most of the code you want should already be in there, just needs hooking up to some parameters.

leezer3

Posts : 1978
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Ammeter feedback and auto panto-up Empty Re: Ammeter feedback and auto panto-up

Post by leezer3 Wed Mar 07, 2018 3:41 pm

This version is partially what you want:
http://vps.bvecornwall.co.uk/stuff/beta/BVEC_ATS_electric.zip

It requires a relatively recent build of openBVE Smile
Usage:

  • Drop into the train folder & set as the active plugin via ATS.cfg
  • Load a routefile using Route.Change(1) to start with both pantographs lowered.
  • Raise the pantographs with the Pantograph key.
  • Wait for them to rise (Give a few seconds)
  • Press the FillFuel key to toggle the ACB/ VCB on.
  • Accelerate to 40km/h, and the front pantograph should automatically lower.


Valid values for the AutomaticPantographLowerBehaviour value:
0. No action taken.
1. All lowered at the set speed.
2. The front pantograph is lowered if the rear pantograph is on service.
3. The rear pantograph is lowered if the front pantograph is on service.
4. The front pantograph is always lowered if up.
5. The rear pantograph is always lowered if up.

I've setup a basic ammeter in the config file, and the panel indicies for this & other configuration values are documented here:
http://www.bvecornwall.co.uk/wordpress/bvec_ats-configuration/

If that works reasonably OK, it's trivial to hook a second ammeter up to each pantograph and add more complex behaviour, but let's get the basics working first.

leezer3

Posts : 1978
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Ammeter feedback and auto panto-up Empty Re: Ammeter feedback and auto panto-up

Post by ebennekom Wed Mar 07, 2018 4:37 pm

That....... is just stunning

so basically the answer is, yeah..... it can be done Smile

Allright, thanx a lot for all this Chris. I'll be playing around with it and hopefully be able to get it to work. Nice!

ebennekom

Posts : 53
Join date : 2017-12-14
Location : Alicante, Spain

Back to top Go down

Ammeter feedback and auto panto-up Empty Re: Ammeter feedback and auto panto-up

Post by ebennekom Thu Mar 08, 2018 11:41 am

leezer3 wrote:it's trivial to hook a second ammeter up to each pantograph and add more complex behaviour, but let's get the basics working first.

Agreed. After close inspection the 2 ammeters in the loc use a different scale. It seems like instead of measuring amp consumage from a dedicated panto, they're indicating total amp consumage. There's a couple more bits n pieces not clear about the real thing I need to know before getting the most realistic panel animations going.

I've posted a few questions about the correct operation of the loc on several forums, but the information is contradictory. So I've ordered an operators manual.
Hopefully that arrives next week and will probably have me open up another can of worms Smile

For testing purposes I've hooked up the ammeters with some bogus data and am very pleased with the way they're dealing with it. (soft dampened indication)

ebennekom

Posts : 53
Join date : 2017-12-14
Location : Alicante, Spain

Back to top Go down

Ammeter feedback and auto panto-up Empty Re: Ammeter feedback and auto panto-up

Post by Quork Thu Mar 08, 2018 1:48 pm

Don't dampen them too much though. Usually the current metre is far less calm than the force metre, at least here in Germany. A trained eye sees slipping/skidding in the current metre before the force metre has even moved.
Quork
Quork

Posts : 1438
Join date : 2012-05-05
Age : 33
Location : Hofheim a.T., Hessen (Hesse), European Union

Back to top Go down

Ammeter feedback and auto panto-up Empty Re: Ammeter feedback and auto panto-up

Post by ebennekom Fri Mar 09, 2018 9:07 am

Hmmm. Interesting. That never occurred to me. Would you say this behavior is similar for all electric loco's?  Or did you notice different behavior for the different classes you operate?

I'm afraid the manual won't mention specific things like that so a bit of 'artistic interpretation' will be involved Embarassed

ebennekom

Posts : 53
Join date : 2017-12-14
Location : Alicante, Spain

Back to top Go down

Ammeter feedback and auto panto-up Empty Re: Ammeter feedback and auto panto-up

Post by leezer3 Fri Mar 09, 2018 11:40 am

Behaviour will be different depending on the loco and it's exact control setup Smile

More modern locos will be likely to have some sort of computer control system feeding the gauges, which would probably damp out , whereas a 60s machine will just (essentially anyways) have a direct analog tap into the current draw.

Besides that, different classes will have different setups, and can behave in wildly different ways.
Best you can do is an approximation Wink

leezer3

Posts : 1978
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Ammeter feedback and auto panto-up Empty Re: Ammeter feedback and auto panto-up

Post by Quork Fri Mar 09, 2018 2:16 pm

Of course, I can only speak for the classes I know. However, judging by the very generally formulated tips, stories from elder collegues and the few times I've been on other loco classes, this appears to be more or less consistent throughout German electrical locos. The loco classes I know are class 120 (first three-phase-AC loco built in series in the world, starting in 1979) and 101 (starting in 1996); also two (closely related) types of driving cars (or however they're correctly called in British English? "Driving trailer" sounds American to me). The 101, just like all the ICE EMU, doesn't have a dedicated current metre, only gauges on a display, which is virtually unusable; by the time the display gauge has cared to react, any decent driver should already have noticed he's skidding via the ultimate most important metre of any vehicle. However on vehicles with an analogue, dedicated current metre (120, intercity driving cars, from what I've seen during route knowledge drives and back in training also commutator AC classes 110/115, 111, 143/112, 181, driving cars used in regional train services), the current metre seems to be consistently faster to react than the force metre. My guess is, that's because the current is measured and showed rather directly, while the tractive force has to be calculated first from motor current, motor voltage and speed, which inevitably takes some time (fractions of a second only, but still). If my guess is correct, then this should be the same for all vehicles with analogue current metres and force gauges. However, these are definitely (educated, but still) guesses - if you want to be really sure, you'll have no other option than to go to the station and try to ask a driver, whether they've driven the loco class and whether they remember and care to tell you.

Oh, "what's the ultimate most important metre of any vehicle" you ask? Well, that's easy - and yet, I think even Chris won't be able to implement it in OpenBVE anytime soon. We call it the "Popometer" in German, which literally translates to "bummetre". It's all those nerve endings in your hind cheeks, which, when decently trained and experienced, usually notice most irregularities (be it skidding, slipping, wheel damage, rail damage, suspension behaving somewhat off...) long before any technical measurements are able to do the job.
Quork
Quork

Posts : 1438
Join date : 2012-05-05
Age : 33
Location : Hofheim a.T., Hessen (Hesse), European Union

Back to top Go down

Ammeter feedback and auto panto-up Empty Re: Ammeter feedback and auto panto-up

Post by ebennekom Fri Mar 09, 2018 3:22 pm

Gheheheh, Yeah I think I got it. You probably mean what pilots refer to as flying by the seat of their pants (or something like that).

I won't be able to talk to a driver of that particular loc because I live about 2500km from the nearest live example. I did find a few cab ride videos of it online, but of course they never zoomed in on the gauges.

It's an early 50s loc (the dutch class 1200). It comes with analog gauges for voltage and amps. I'm thinking like chris does meaning it's probably plugged into the current so some dampening probably makes sense. But we'll see. I first have to finish the thing (in its 3rd iteration now and still not satisfied). Perhaps once it's out there some insider feedback will allow me to correct assumption mistakes.

Happy with your responses btw.

ebennekom

Posts : 53
Join date : 2017-12-14
Location : Alicante, Spain

Back to top Go down

Ammeter feedback and auto panto-up Empty Re: Ammeter feedback and auto panto-up

Post by Quork Fri Mar 09, 2018 3:30 pm

Oh! From time to time I see some Dutch drivers, here in Frankfurt and in Cologne - they're driving some of the ICE services between Frankfurt and Amsterdam. I could try and ask one of them - given class 1200 has been out of service for twenty years already, I wouldn't rely on them remembering the loco well, but at least they can maybe give some genereal pointers. Or, better yet - write an e-mail to Euro-Express-Treincharter BV, according to Wikipedia they've been using them at least till 2011 (and probably longer). The Dutch are usually very helpful and open people, so I think you could get a helpful answer from them.
Quork
Quork

Posts : 1438
Join date : 2012-05-05
Age : 33
Location : Hofheim a.T., Hessen (Hesse), European Union

Back to top Go down

Ammeter feedback and auto panto-up Empty Re: Ammeter feedback and auto panto-up

Post by ebennekom Fri Mar 09, 2018 9:37 pm

That is correct. EETC did operate (2 me thinks) 1200s. They didn't own them though, but rented them from ACTS (who themselves operated 5 1200s for 10 years after dutch rail wanted to scrap them all). EETC stopped their services because of skyrocketing infrastructure usage costs so they were returned to ACTS. Afaik at least 1 of the 1200s is still in use today now operated by railpro in its ACTS livery but with the railpro logo on the sides.

So yeah, There's probably still drivers out-there, now the trick is to find one who can be bothered to talk about it

> The Dutch are usually very helpful and open people

Not me. Born dutch, but even my wife thinks I'm an asshole Smile

ebennekom

Posts : 53
Join date : 2017-12-14
Location : Alicante, Spain

Back to top Go down

Ammeter feedback and auto panto-up Empty Re: Ammeter feedback and auto panto-up

Post by ebennekom Wed Mar 14, 2018 2:49 pm

A few questions about my setup.

Ive made a couple of animated pantographs for the loc. Still a bit rough, but for now will do the job.

in bvec_atc.cfg i've added just some test data for the ammeter, and set up keyboard button 2 and 3 for raising and lowering the front and rear panto respectively.
Code:

[Electric]
pantographfitted=true
ammeter = 98
ammetervalues = 20,40,60,80,100
powerindicator = 99
pantographindicator_f = 100
pantographindicator_r = 101
breakerindicator = 102
automaticpantographlowerspeed = 40
automaticpantographlowerbehaviour = 2

[KeyAssignments]
frontpantographkey=D
rearpantographkey=E

[Interlocks]
reverserindex=191

Configuration for the exterior in the locs .animated file is (shortened) as such:


Code:
;front panto
[Object]
Position = 0, 4.20, -4.9
States = panto/panto.lowerparts.b3d
RotateXFunction = if[pluginstate[100] == 0, if[value < 0.38, value + delta * 0.135, 0.38], if[value > 0, value - delta * 0.135, 0]]

;rear panto
[Object]
Position = 0, 4.20, 4.1
States = panto/panto.lowerparts.b3d
RotateXFunction = if[pluginstate[101] == 0, if[value < 0.38, value + delta * 0.135, 0.38], if[value > 0, value - delta * 0.135, 0]]

;switch lights on automatically if reverser is set to forward and either one of the pantos is raised.
[Object]
States = null.b3d, lights.b3d
Position= 0, 0.38, -0.9
statefunction = if[pluginstate[191]==1, if[pluginstate[100]==1 | pluginstate[101]==1,1,0], 0]

;sparks to indicated panto is up, reverser is set and breaker is on
[Object]
Position = 1.2, 5.42, -9.3
States = sparks\nothing.csv, sparks\spark.csv
StateFunction= if[    powerNotch>0 & pluginstate[191]!=0 & pluginstate[100]==1 & pluginstate[102]==1,    if[distance[0] > 0.75, 0, value == 0]    ,0]
RefreshRate = 0.03

In the panel I've set up a couple of control lights, plus ammeters.


Code:
;breaker Indicator
[PilotLamp]
Subject = ats102
Location =364, 100
DaytimeImage = Panel\breaker.png
NighttimeImage= Panel\breaker.png
Layer = 6

;panto Indicator front
[PilotLamp]
Subject = ats100
Location =390, 100
DaytimeImage = Panel\pantofront.png
NighttimeImage= Panel\pantofront.png
Layer = 6

;panto Indicator rear
[PilotLamp]
Subject = ats101
Location =416, 100
DaytimeImage = Panel\pantorear.png
NighttimeImage= Panel\pantorear.png
Layer = 6

; amp
[Needle]
Subject = Ats98
Location = 358,497
DaytimeImage = Panel\ampneedle.png
Origin = 16, 369
Layer = 2
Radius = 34
InitialAngle = 270
LastAngle = 360
Minimum = 0
Maximum = 100
NaturalFreq = 10
DampingRatio = 2.6

So what I'd expect to happen is when viewing the loc from the outside:
hitting the 2 button, raise or lower the front pantograph
hitting the 3 button, raise or lower the rear pantograph
flipping the breaker, nothing but will make sparks visible if loc put into motion
set reverser, turn on the lights (front or rear depending on direction chosen)

From the inside:
hitting the 2 button, set/unset the front panto indicator light
hitting the 3 button, set/unset the rear panto indicator light
flipping the breaker, set/unset the breaker indicator light
set reverser and powernotch, put train in motion and ammeters correspond to selected powernotch.

But here's what actually happens:
hitting the 2 button, raise or lower the front pantograph externally, show the front panto light internally. That works just fine.
hitting the 3 button, nothing happens externally, panto stays down, panto front indicator light gets toggled. This is the wrong light for that panto.
breaker works fine
ammeters work fine

And here's the weirdest thing. As soon as I set the brakes to any position using the default '<' and '>' the rear panto will lower or rise, and the rear panto indicator light on the panel will turn on respectively.

Also, if I lower the front panto it cannot be raised by pressing 2. The indicator for it will turn on though if I set the powernotch to neutral, than turn it to a powersetting (any) the panto front light will turn on, and the external animation for it corresponds with that.

Now if i lower it and set the breaker to off, I can re-raise the front panto this way and after waiting a few seconds turn the breaker back on, the train will move again. (sparks can be seen flying of the panto, so power is up). However, now the ammeters don't indicate anything.

The route I've used for testing does not have any security system implemented.

I've tried assigning the panto's to different buttons but the rear panto always seems to be the problem child. It only accepts up and down commands from the brake setting.

Another thing
When starting a ride over the testtrack, whenever I switch to A.I. driver, immediately the power cuts out regardless of the current speed. The event viewer lists this as: 'Power cut off due to no available pantographs' (eventhough the panto front indicator is still on)

Any suggestions?

ebennekom

Posts : 53
Join date : 2017-12-14
Location : Alicante, Spain

Back to top Go down

Ammeter feedback and auto panto-up Empty Re: Ammeter feedback and auto panto-up

Post by leezer3 Wed Mar 14, 2018 4:51 pm

Will do some digging Sad

The two pantographs are obviously interacting somehow, although I can't think of why off the top of my head.....
If the brakes are triggering things to happen (they're not connected to the pantographs in any way, or at least shouldn't be), it makes me wonder if a KeyUp event is going astray somewhere, and things are actually happening on the release of the *next* key.

Will try and get a fixed version up tomorrow.

leezer3

Posts : 1978
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Ammeter feedback and auto panto-up Empty Re: Ammeter feedback and auto panto-up

Post by ebennekom Wed Mar 14, 2018 5:58 pm

Thanx already Chris. Would it be helpful if I packaged the entire loco and send you a link?

ebennekom

Posts : 53
Join date : 2017-12-14
Location : Alicante, Spain

Back to top Go down

Ammeter feedback and auto panto-up Empty Re: Ammeter feedback and auto panto-up

Post by leezer3 Wed Mar 14, 2018 6:02 pm

Nah, my code, my bugs Razz
It's actually easier without the engine at the minute,

Rear pantograph should work (or at least go up and down) in this one, need to take a look at the AI driver & see if anything else funky is going on.....
http://vps.bvecornwall.co.uk/stuff/beta/BVEC_ATS_electric_2.zip

leezer3

Posts : 1978
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Ammeter feedback and auto panto-up Empty Re: Ammeter feedback and auto panto-up

Post by ebennekom Wed Mar 14, 2018 6:07 pm

Allright, I'll have a quick look before the wife calls me for dinner Wink

ebennekom

Posts : 53
Join date : 2017-12-14
Location : Alicante, Spain

Back to top Go down

Ammeter feedback and auto panto-up Empty Re: Ammeter feedback and auto panto-up

Post by leezer3 Wed Mar 14, 2018 6:08 pm

Sorry, MK3:
http://vps.bvecornwall.co.uk/stuff/beta/BVEC_ATS_electric_3.zip

Haven't looked into this code too much lately Sad

leezer3

Posts : 1978
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Ammeter feedback and auto panto-up Empty Re: Ammeter feedback and auto panto-up

Post by ebennekom Wed Mar 14, 2018 6:12 pm

The panto's both work now. Gotta go eat, will get back with the rest asap

ebennekom

Posts : 53
Join date : 2017-12-14
Location : Alicante, Spain

Back to top Go down

Ammeter feedback and auto panto-up Empty Re: Ammeter feedback and auto panto-up

Post by leezer3 Wed Mar 14, 2018 6:22 pm

Fixed the AI now too:
http://vps.bvecornwall.co.uk/stuff/beta/BVEC_ATS_electric_4.zip

Going to do some more digging through the code, will let you know if I find anything else broken Smile

leezer3

Posts : 1978
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Ammeter feedback and auto panto-up Empty Re: Ammeter feedback and auto panto-up

Post by ebennekom Wed Mar 14, 2018 7:59 pm

Almost there Chris, but not quite yet

The front pantograph won't lower automatically eventhough:

automaticpantographlowerspeed = 40
automaticpantographlowerbehaviour = 2

Also, when in service front pantograph can't be lowered manually by pressing its key (2 in my setup), but will lower when reverser in neutral and powernotch=0

Interesting though, AI does attempt to lower the pantograph at 40km/u. But instead of lowering just one, it lowers both.

I'm thinking the plugin hasn't got a clue which panto to lower at the set speed thus arti just lowers both.
Perhaps we need another variable in the plugin which can be set in the config will fix that?

Or maybe even combining lowerspeed with that like:

autopantolowerspeed_f = 40
autopantolowerspeed_r = 0 (default)

Edit: one more oopsie...... The rear pantograph cant be lowered if brake is applied Sad

ebennekom

Posts : 53
Join date : 2017-12-14
Location : Alicante, Spain

Back to top Go down

Ammeter feedback and auto panto-up Empty Re: Ammeter feedback and auto panto-up

Post by leezer3 Sat Mar 17, 2018 2:17 pm

Well, I've found all sorts of messes in there Razz

Never come back to what was iffy code to start with!
http://vps.bvecornwall.co.uk/stuff/beta/BVEC_ATS_electric_5.zip

Fixed and refactored a whole bunch of stuff to somewhat more sensible behaviours (Some unrelated to your stuff...)

Front Pantograph:
Change the indicies you're using to start from 200.
There's some stuff left over from OdakyufanATS used by some of the other bits which starts at index 93 (I'd forgotten about this.....), which I don't particularly want to untangle just at the minute Razz

leezer3

Posts : 1978
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Ammeter feedback and auto panto-up Empty Re: Ammeter feedback and auto panto-up

Post by ebennekom Sun Mar 18, 2018 11:13 am

Good progress. Definitely an improvement. Still some questions.

Panto's work as expected now. Front gets auto-lowered at configured speed, and (even though I never thought of that) auto-raised when powering up again. That in itself made my day.

There's still something b0rked though. AI still insists on tripping the breaker at a station stop? I can live with that cause, well.... plugin trains do come with a warning about artie not always being reliable, but ehm.... it gets worse after the first stop. Artie now really hasn't got a clue what it's doing. For example. If I manually stop the train somewhere in the route, then switch arti on, arti isn't setting powernotch up. And if I hit the key to do so, arti immediately responds with setting it back to 0 again.

I guess arti just doesn't want to drive my train. I get that, it's cramped. But I'll fire him faster than the speed of light if he doesn't start behaving.

Also. Not sure if this is correct, but I assumed you mean front panto is now plugin state 200 and rear panto is 201 right? Therefore the breaker should be 202? or was that a bad assumption?

Edit. After a bit more testing I found something else.
After coming to a complete stop, reverser to neutral, power to 0, lowering pantos' and switching the breaker to off Than doing it all in reverse to get moving again ie, pantos' up, breaker on, reverser to f, power engaged, the train will move again but........ the ammeters won't work anymore.

On a side note (this might be correct behavior though, so not sure if thats really a bug) if setting the breaker to on, raising any panto will switch it back off again Shocked
So if I'd raise the pantos' first, than switch the breaker all is fine but not sure if that particular order of doing things is conform reality therefore okay, or if its a glitch.

ebennekom

Posts : 53
Join date : 2017-12-14
Location : Alicante, Spain

Back to top Go down

Ammeter feedback and auto panto-up Empty Re: Ammeter feedback and auto panto-up

Post by Quork Sun Mar 18, 2018 7:52 pm

You never ever switch the breaker on without stable and nominal OHL voltage.
Quork
Quork

Posts : 1438
Join date : 2012-05-05
Age : 33
Location : Hofheim a.T., Hessen (Hesse), European Union

Back to top Go down

Ammeter feedback and auto panto-up Empty Re: Ammeter feedback and auto panto-up

Post by leezer3 Sun Mar 18, 2018 9:18 pm

Yep Smile

Round here, an older loco would probably physically let you do it, but you'd most likely blow the rectifiers with one heck of an arc (25kv!)
More modern stuff has interlocking to automatically trip the breaker whenever you hit the pan up button if it's not already.

Will take a look at the ammeter, must have done something stupid....

AI:

  • Pan up behaviour, I think is working as designed. To raise the pan, it must first turn off the breaker.
  • Stalling after a manual stop- Will look into. Sounds like the basic logic is working though, as it deliberately won't power up if it thinks no power is available.

leezer3

Posts : 1978
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Ammeter feedback and auto panto-up Empty Re: Ammeter feedback and auto panto-up

Post by Sponsored content


Sponsored content


Back to top Go down

Page 1 of 2 1, 2  Next

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum