Go Back   EcoModder Forum > EcoModding > Fossil Fuel Free
Register Now
 Register Now
 

Reply  Post New Thread
 
Submit Tools LinkBack Thread Tools
Old 03-11-2012, 09:20 PM   #81 (permalink)
Master EcoModder
 
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,488

Ford Prefect - '18 Ford F150 XLT XTR

Tess - '22 Tesla Y LR
Thanks: 749
Thanked 565 Times in 447 Posts
What have I gotten done - update

I purchased 14 surplus meters, tentatively 0 - 50 ua (micro-amp) for 0 - 100% of the display, from an ebay vendor several years ago for another project that did not happen. I tested them last night with a decade resistance box, a digital ammeter, and a 9V battery. 6 of the 7 that were shipped to me without shorting bars have a typical resistance but the meter does not move at all - so they are dead. All 7 that were shipped with a shorting bar installed work fine. I guess I should have checked on them earlier and installed shorting bars. I know for next time - a lesson learned.

The PLC analog outputs are 0 - 10VDC. I thought that they were 4 - 20 milliamp - I got the part number wrong. I can change the whole card from 0 to 10V range or -10V to 10V range. I have a couple of the meters that range from -500 - 500 ua, so I will likely have one card set for 0 - 10V and one set for -10 - 10V. 10V / 50 ua = 200K. Compared to this value, the resistance of the analog meter (around 3K ohms) is rounding error, so I'm going to ignore it.

The method I'm using
- adjust each analog output to maximum
- use the decade box to calibrate maximum deflection, starting at 300K just to be paranoid
- record the required resistance value
- select resistors from the junk box
- install on the meter, verify full scale at 10.0V

A search of my junk box(es) yields a few resistors. These resistors are put in series with the meter. I'm using at least two resistors to make up each value. One on the meter + and one on the meter -. The connections to the meter are covered with electrical tape to prevent unintentional contact. The network cable I'm using (category 6 solid core 24 awg unshielded twisted 4 pair) is crimped and covered with electrical tape (this is temporary, so I'm not using heatshrink). The results are listed for each meter.

DC amperes gauge - use 19K. Gauge uses 500 ua from 0 to full scale, so -10 will give -500, 10V will give 500. 16K7 + 3K3, 16K7 + 3K2

Square gauges - 50 ua to full scale. 181K. No resistors located yet

Small square meter - 50 ua to full scale, 192K. No resistors located yet

The search through the junk box for suitably sized resistors continues ...


Last edited by thingstodo; 03-23-2012 at 01:00 AM.. Reason: spelling fix
  Reply With Quote
Alt Today
Popular topics

Other popular topics in this forum...

   
Old 03-25-2012, 10:38 PM   #82 (permalink)
Master EcoModder
 
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,488

Ford Prefect - '18 Ford F150 XLT XTR

Tess - '22 Tesla Y LR
Thanks: 749
Thanked 565 Times in 447 Posts
Progress

I was out of town for the week. Some programming was typed in, some ideas sketched out, but nothing was tested so .. for now .. that stuff does not exist

What does exist is a bit of resistor investigation

A search of my junk box(es) yields the result that I don't have any junk resistors that will work. So I broke out a pack of purchased resistors and I've come close

Square gauges - 50 ua to full scale. 181K - close as I got was 196K - can't quite get to 100% scale, but it's usable.

Small square meter - 50 ua to full scale, 192K use 196K

Next topic - how to print a new scale for the gauges to show -100 - 100A or 0 - 100%, and get the green/yellow/red scale display idea to work.
  Reply With Quote
Old 03-30-2012, 10:58 AM   #83 (permalink)
Master EcoModder
 
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,488

Ford Prefect - '18 Ford F150 XLT XTR

Tess - '22 Tesla Y LR
Thanks: 749
Thanked 565 Times in 447 Posts
First cut at the DASH, and a picture

Quote:
Originally Posted by thingstodo View Post
Square gauges - 50 ua to full scale. 181K - close as I got was 196K - can't quite get to 100% scale, but it's usable.

Small square meter - 50 ua to full scale, 192K use 196K
It turns out that 196K instead of 192K is workable - it's for STATUS anyway, which does not get to full scale. The scale of 0 - 98% works out to analog output of 220 - 4095

196K instead of 181K is not really workable. I need full scale on VOLTS and Temperature in C .. .likely not for the TACH ... Scale of 0% is 46. 90% or so is 4095 output. That's as high as the output goes. I need a different resistor ... or to combine a couple resistors to get closer to 181K (preferably lower than 181K so that I can limit the output but still reach 100% scale)

The WATT-HOURS gauge travels from -500 through 0 to 500 display with analog output values of 50, 2047, and 4070. It's not really great with reproducibility. 0 display is somewhere between 2040 and 2080 depending on whether it was displaying positive or negative before you go to 0.

The AMPERES gauge has much the same issue. 47, 2060, 4050 for the analog output.

The STATUS is used to show which parameter the gauges are displaying - voltage, current, and temperature the gauges. There are a maximum of 6 displays used for temp, volts and amps. So I set it up for 10 each to leave me some room for expansion. Status of 20 is the first value - battery, 40 is the second - motor, 60 is the third - charger status, 80 is the fourth - vfd status, 100 is the fifth value - ground sensing and ambient temperature, 120 is a bit miscellaneous - split pack voltage difference, secondary current sensor on the battery pack, and future coolant temperature. 140, 160, 1800 and 200 are 'spares' for the three gauges.

Displayed by gauge:

Voltage is planned for:
20 - the battery pack total
40 - the motor voltage (AC output from VFD)
60 - charger voltage
80 - voltage reference to the VFD - please send out this voltage (future)
100 - the ground leakage voltage
120 - the difference between the split pack(to show imbalance)

Current display is planned for
20 - the battery current
40 - motor current
60 - charger current
80 - current limit to the VFD - limit output current to this value (future)
100 - ground leakage current
120 - secondary current for battery

The temperature is planned for
20 - battery temperature
40 - motor temperature
60 - charger temperature
80 - VFD temperature
100 - ambient temperature
120 - coolant temperature (if I go liquid cooled)

The original plan - to cycle through these displays and have them calibrated so that green is 0 - 60%, yellow 60 - 80% and red above 80% - was going to be very different (too different) from what the real dash will be. I left it a bit plain for now ... after all, I'm supposed to be simulating what the dash looks like, not redesigning the dash to look like a cockpit. Real scale values are not on the gauges - I need to experiment a bit and see what I'd like it to look like.

Multiple scales are required on each gauge to show the different ranges. They will (hopefully) be scaled to allow the needles to be between 60% and 80% for 'normal' to keep me from being TOO confused.
Attached Thumbnails
Click image for larger version

Name:	Dash.JPG
Views:	20
Size:	22.0 KB
ID:	10590  
  Reply With Quote
Old 03-30-2012, 11:08 AM   #84 (permalink)
Master EcoModder
 
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,488

Ford Prefect - '18 Ford F150 XLT XTR

Tess - '22 Tesla Y LR
Thanks: 749
Thanked 565 Times in 447 Posts
PLC Analog outputs

Quote:
Originally Posted by thingstodo View Post
It turns out that 196K instead of 192K is workable - it's for STATUS anyway, which does not get to full scale. The scale of 0 - 98% works out to analog output of 220 - 4095
The PLC analog output is a '12 bit' digital to analog converter. You send a number to the analog channel and a proportional voltage is output from the terminals.

Most Allen-Bradley PLC 2, PLC 3 and PLc 5 analog cards are 12 bit. Some of the older ones are 8 bit. 12 bit means there are 4096 different voltages that can show up at the terminals. This corresponds to the numbers from 0 - 4095. If you show that in binary, there are 12 binary digits, or bits.

In the example above, 220 gives an output of 220/4095 * 10V or 0.53V. That puts a small current, about 2.7 micro amps, through the meter and the needle shows at 0 on the scale. No output on the analog shows below 0 on the scale.

So 4095, the high scale, puts out the full 10.01V available and still doesn't quite get to the 100% display value, labeled '200'.
  Reply With Quote
Old 04-02-2012, 11:24 PM   #85 (permalink)
Master EcoModder
 
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,488

Ford Prefect - '18 Ford F150 XLT XTR

Tess - '22 Tesla Y LR
Thanks: 749
Thanked 565 Times in 447 Posts
The beginning of The Simulator

On my week down in Phoenix, I scribbled out a few ideas for testing. I can work a 'simulated' accelerator, brake, ebrake switch, inertia switch, ... etc ... but it is really not reasonable to expect that I will check absolutely EVERYTHING after each small change that I make to the control programming in my PLC5. I take changes seriously, but I am also familiar with unintended side effects ... collateral damage. I test a lot. AND I'm a bit PARANOID.

So after a few ideas, a bit of code, a couple of compromises ... there is a plan.

The inputs to the PLC and the outputs from the PLC are compared to what they were the last time the program executed. Anything that changes is logged. The data is stored in the format:
- YMMDD for the last digit of the year, 2 digit month and 2 digit day
- HHMM for the 24 hour digit hour, MM for the minute
- SSTho for 3 digit seconds and 2 digit hundredths of a second
- LogType, integer - an indication of what type of data has changed
- Number, integer - the value of the data that changed
- Status, integer - future
- Alarm, integer - future
- Value, float - floating point for future use

20401, 17452201, 1, 16, -32768, -32768, -32768, -32768

This logs 2012 04 01, april 1, at the time 17:45:22.01, data type 1 or digital input, value 16 or only input 4 on

The -32768 values are place-holders for 'not used for this line'. 0 is valid data, so I used the most negative (smallest?) number I have as 'no data'.

The logs will keep track of the results (inputs versus control outputs) for my initial tests with potentiometers for accelerator and brake, some switches for selected safety inputs, and a drill for a motor output. When I am happy with those results, the next step begins.

Create a list of things that the truck should do, so that it works as expected. List every boundary condition - transitions from positive to negative and back to positive. Check for impossible inputs, like Park and Reverse and Drive at the same time. The safest one should win - in this case Park. Enforce a sequence, if that's what a normal car does - like pressing on the brake before shifting from Park to Reverse. Check what is done with an Emergency Brake input while driving at 60 mph. Does the brake input always REDUCE the absolute value of the speed, bringing you closer to a stop? How about the inertia switch input?

Define what the truck is expected to do in every case. It should be the safest choice.

Run through the list of test cases and record all of the logs. This will be the standard that will be compared.

Keep the logs for each revision of the PLC program. Compare each revision to the standard. Ensure that the the differences are intended. Update the standard (there is a standard for each non-trivial PLC revision).

As the control system is upgraded, before the truck is running, and even after ... any control program changes MUST pass this safety test, to make sure that I don't hurt myself or anyone else with collateral damage.

The PLC5 programming for the actual control of the truck is not going as quickly as I had hoped. I keep getting side-tracked with these small projects ... but it is good to measure and bench-mark ... and make sure things are right.

Last edited by thingstodo; 04-03-2012 at 11:32 PM.. Reason: spelling
  Reply With Quote
Old 04-06-2012, 12:25 AM   #86 (permalink)
Master EcoModder
 
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,488

Ford Prefect - '18 Ford F150 XLT XTR

Tess - '22 Tesla Y LR
Thanks: 749
Thanked 565 Times in 447 Posts
Simulated motor revisited

Quote:
Originally Posted by thingstodo View Post
First - the simulated truck motor.

The PLC5 will have one output wired to a cordless drill. A calculation based on the VFD speed reference (that won't be connected to anything) will drive the drill. Forward and reverse are ignored. The drill will be wired from 2 12V gel cells in series through a DC output on the PLC that only switches at about 100 Hz. The 32 different patterns should give 32 different no-load speeds. The motor is unloaded and may jerk a bit, but it should turn an arbor that has one encoder mounted on it and the encoder will be wired back to the PLC. That's my drive train simulation.
The first test was done with the drill. The changes in speed are not trivial. The speed for 1 pulse in 32 is like someone hitting the accelerator, then coasting, then hitting the accelerator again ... about once a second.

I tried a few different speeds. At about 4 pulses out of 32, it starts to even out. 8 pulses out of 32 is actually getting to be OK. Then we start running into the uneven spacing between the pulses and get the speed up/slow down cycle until we hit 16 pulses out of 32 or half speed.

I stopped there. There is not much inertia in the drill, so it does not 'average out' the pulses well. The weight of the part that rotates is not very large. The idea was to average the DC and get a fairly consistent rpm.

Next up - try to run the side grinder on 24V DC instead of of 120 VAC. Reduced voltage should reduce the maximum rpm. The current output of 2A maximum for the PLC output should be OK - not a lot of torque required to spin the encoder.
  Reply With Quote
Old 04-07-2012, 02:19 PM   #87 (permalink)
Master EcoModder
 
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,488

Ford Prefect - '18 Ford F150 XLT XTR

Tess - '22 Tesla Y LR
Thanks: 749
Thanked 565 Times in 447 Posts
The new Simulated Truck Motor

To use my 'video game' or test bench simulator in the basement for testing, I need a motor that will spin at different speeds, driven by the PLC, and the speeds will be ... smooth. I need the rpm that the motor turns to change when I change the output voltage, but be within a few rpm after that change. For example, if the output is 25%, I'd like ... maybe 200 rpm, ranging from 195 to 205 rpm. If the output changes to 50%, I'd like more speed, maybe 350 rpm, ranging from 345 to 355.

So I'm back to the side grinder that I used to test out the maximum encoder rpm earlier. I strapped it back onto the shelving that I am using as a work bench. The side grinder had it's screw-on handle run through a hole in the shelf. That keeps the grinder from rotating, should something go horribly wrong. The grinder is leveled with a small piece of scrap lumber. Two wood clamps are used to hold the grinder to the shelf. Check out the first 2 pictures.

My 24V power supply is rated at 2.1A. Hopefully that's high enough. The grinder is rated for 10A.

Connect 120V to the power supply. There is no output voltage. Disconnect the power and check the fuse. The fuse measures as 1.1 ohms. That seems a bit high? A quick check of the meter shows that using only the probes measures 1.0 ohms .... so the fuse is fine.

Check the input wiring. There are a few strands of wire from the 120V cord that are beginning to fray. Pull them out, strip the cable again and put the newly stripped wires into the terminal blocks and tighten. There is still no output from the power supply.

Drill out the rivets that keep the top cover on the power supply and check the circuit board connections. Ah ... the posts that carry 120V from the power supply board to the transformer are fine. The posts on the secondary of the transformer are not fine. The solder connections from the secondary posts to the power supply board broke.

A quick check with power applied shows confusion. There is no power in or out. So I disconnect the power supply and use some fine sand paper to scratch through the corrosion on the connections - all connections seem to do that over time - until I see shiny metal.

Apply power to the power supply and there is now power going in. There is also power coming out. The transformer is fine, there is 21.6 VAC at the secondary of the transformer. The posts are quite large so my soldering iron (meant for precise heat, to work on electronics) does not have enough power to heat up the post and solder things back together.

Check out the 4rth picture. You can see the gap between the transformer post and the circuit board.

I guess I need a different power supply.
Attached Thumbnails
Click image for larger version

Name:	grinder 1.JPG
Views:	17
Size:	62.3 KB
ID:	10610   Click image for larger version

Name:	grinder 2.JPG
Views:	18
Size:	63.2 KB
ID:	10611   Click image for larger version

Name:	24V PS 2.1.JPG
Views:	18
Size:	58.6 KB
ID:	10612   Click image for larger version

Name:	24V PS 2.2.JPG
Views:	17
Size:	53.0 KB
ID:	10613  
  Reply With Quote
Old 04-07-2012, 06:42 PM   #88 (permalink)
Master EcoModder
 
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,488

Ford Prefect - '18 Ford F150 XLT XTR

Tess - '22 Tesla Y LR
Thanks: 749
Thanked 565 Times in 447 Posts
The new Simulated Truck Motor - part 2

Another search of my junk pile results in a larger power supply ... a 24V charger, actually, that is rated for 7 amps at 25.2 VDC output. A quick check at the output connector identifies which pins on the connector are + and -, that there is 20.5VDC coming out, that the on/off switch works ... so far so good.

Use an alligator cord to connect the + on the charger to one side of the grinder's 120V plug and - on the power supply to the other side of the 120V plug. I know that the grinder turns at 10000 rpm from the label on the side. That's faster than the 120 V frequency of 3600 rpm, so I know that the grinder takes the 120 VAC and converts it to DC. And that the motor is actually a DC motor. So it's not a big deal which connection has + and which has -.

Turn on the charger and the grinder spins up. So far so good. The current meter on the charger slowly falls to about 1 amp when the grinder is at a steady state. After turning off the grinder, I add some electrical tape and a small reflector to the grinder disc to make a target. That way, I can use my optical (light) tachometer to check what the speed ends up being. It turns out, the no-load speed is about 3300 rpm.

My clampon meter, set for DC amps, and set to record the peak, shows a peak of 5.5 amps immediately when the charger is turns on. The current stabilizes at between 1.2 and 1.3 amps when the motor is up to speed.

This is very good news. I have the full range of the encoder available, since the encoder card can only keep track of .. was it 2929 rpm? When driving the encoder, I'll be using most of the available DC output of the PLC. The inertia of the grinder motor, gearbox, and rotating disc is likely high enough to average out the DC pulses from the PLC output and give a fairly stable motor speed. That's the theory, I just need to test that.

Next step, connect the charger through the PLC output and see how the averaging of the pulses works out with the grinder speed. The power fed to the PLC output card looks good. The output voltage makes my digital meter bounce a bit, but 4.5 - 4.8 VDC covers most of the values I see. The low is 3.7 and the high was above 5.

At this point, another alligator clip connects the common and the switched PLC output to the grinder. It appears to run OK. After a few seconds, the charger starts to sound bad, like there is a momentary short circuit across the transformer ... the noise that you hear when a welder strikes an arc, shorting out the secondary of the welding transformer. This would be BAD.

Disconnect everything and check out the power supply by itself. It does the same noise, repetitively (not constantly) with no load connected. The sound occurs quickly after power-up and for longer the first time after it has cooled off for a while. The output voltage drops to 0VDC (when I add wires to connect up the meter) and then bounces back up to around 6 VDC. It REALLY sounds BAD. The sound of the transformer 'shorting' appears to happen every 5 - 10 seconds. I think that there may be a self-resetting fuse (like a circuit breaker that resets when it cools off, after a huge amount of current likely goes through it) ... I guess it's time to take apart the charger. The thing about my junk pile ... garage sale stuff, auctions both online and in person ... some of it works for a while, some of it was sold for a reason ... and some of it is pristine and works great.

So no answer on whether the grinder rpm is stable with the PLC output pulses ... until I find another power supply.
  Reply With Quote
Old 04-08-2012, 02:27 AM   #89 (permalink)
Master EcoModder
 
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,488

Ford Prefect - '18 Ford F150 XLT XTR

Tess - '22 Tesla Y LR
Thanks: 749
Thanked 565 Times in 447 Posts
The new Simulated Truck Motor - part 3

As usual, I don't appear to see the forest for the trees. I'm searching for a power supply to run on the bench ... to simulate a 'battery pack' that I already HAVE. My lovely wife ... to the rescue yet again ... after patiently listening to me describe the problems with the 24V power supply, asked me why I wasn't using that 'pack' of batteries in the garage.

- These are a set of 60 old gel-cells (12 'shelves' of 5 batteries each) from an Un-interruptible power supply at work. The batteries failed the automatic battery test about 3 years ago and could not last for the 20 minute minimum required, so they were to be sent to the battery recycler. I intercepted them and said I could use them for a few projects before they eventually made it to the recycler.

My wife continued - 'If you're not going to use them, can we get rid of them?' ... Hmmmm ... They don't have the capacity (7.2 A-h each when new) to use in the truck, but they should be fine for testing. Of the original 60 cells, only 40 will still hold a charge ... the rest DID make it to the recycler. I'm not a battery guy, so if the battery charger I'm using stops charging and goes into 'float', then the battery is likely OK in my books. If the battery charger never 'finishes', the battery goes to the recycler.

Two 12V gel-cells in series is 25.2V - and should work well for supplying the grinder with enough current to drive the encoder. On the plus side, I have incentive to add PLC control of the contactors. In fact, I can go through the pre-charge cycle, activate the contactor to bypass the pre-charge resistor, measure the current going into the grinder (that will require the fabrication of a shunt resistor ...) measure the voltage of the 'battery pack', and the PLC output will 'run down' the batteries in a realistic way. GREAT IDEA!

I still need a 24V battery charger to charge these batteries back up, but they should only need charging once or twice a day. (I could use two 12V chargers if I have to since the batteries are not matched, right?) I have a bunch of the batteries, so I could likely just switch batteries when I'm testing and do the charging offline. I only seem to work on this for an hour at a time anyway.

Well, that's it for today.
  Reply With Quote
Old 04-08-2012, 11:34 PM   #90 (permalink)
Master EcoModder
 
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,488

Ford Prefect - '18 Ford F150 XLT XTR

Tess - '22 Tesla Y LR
Thanks: 749
Thanked 565 Times in 447 Posts
Wiring

So I wired up a push-on, push-off switch to be the RUN signal from the ignition. Another momentary switch stands in for the START signal. The switches are mounted at the top of the box that holds the analog gauges - my 'video game dashboard'

I used relays instead of contactors for the PLC outputs to control the main battery, the pre-charge, and the pre-charge bypass. The wire (some old network cabling that's be repurposed) was stripped and wrapped around the relay coil connections, then covered in one layer of black tape. The relays are not even strapped down yet, but will be strapped down to a piece of scrap lumber in the near future. The 12V and 24V wiring do not go through the relays yet. The click of the relays in sequence will be good enough for now.

The sequence will be RUN turned on, then START and release. The main battery contactor will energizze (relay 1), followed by a short Power On Self Test (not written yet, but each gauge will move 0 - 50% - 100%), the gauges move to correct position, and the pre-charge contactor turns on (relay 2) battery power to the 'VFD'. After a short delay (2 seconds) the pre-charge bypass (relay 3) turns on. I guess there should be an indication that the truck can be driven now.

I have not worked out how to switch on the DC/DC power for the PLC yet. The PLC needs a 5V power supply at about 10 amps. I may need to put in a deep cycle battery for the lights, stereo, and PLC DC/DC that switches on using the RUN switch? But the PLC has to be powered up after the truck is turned off, to supervise the charging. PLC power may require an extra switch, or perhaps the RUN will turn it on and the PLC will turn itself off .... using some rules ... rules that I will come up with ... LATER.

Well, I've skipped the Ebrake input, the Estop input, the inertia switch, etc ... but that will not be part of the hardwired simulation. It will be covered in the simulated inputs.

The wiring of the battery charger:
- I'd like to measure voltage and current to the battery, count Watt-hours, and then track watt-hours out of the batteries and into the motor
- as described below, my hall effect sensors are too large to give good results at 2A

I'll leave this for a bit. If you have suggestions - let me know. The 50 mV range of a normal shunt resistor is too low for my PLC inputs to deal with, but using a shunt that has a higher voltage drop messes up the battery charger cycle.

For now I can start the watt-hours at 4A * 0.25 hours * 12V = 12 Watt-hours and count down from there. It can always be adjusted.

  Reply With Quote
Reply  Post New Thread






Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Content Relevant URLs by vBSEO 3.5.2
All content copyright EcoModder.com