![]() |
Voltage vs. PercentVbus
Can someone confirm/explain the difference between driving Jaguars via kPercentVbus which is a plain -1 to +1 PWM duty cycle (ie: 0.5 means 50% ON in the forward direction), and kVoltage (ie: 5 means +5V).
I assume the latter means the Jag will output an average of +5V during its PWM cycle irrespective of battery voltage (assuming it is > some minimum above 5V) (what is that minimum delta? maybe 1V?). For the examples above that means, if the Battery is 12V, a kPercentVbus will provide an average V of 6V whereas in the second it will be 5V. This can then be an effective way (easier than PID) to provide a known power input to the motor irrespective of the varying state of the battery. So for example driving the shooter power via kVoltage would be quite predictable after calibration. May even be more predictable than fidling with a PID. Now onto some confusing documentaion: From: http://javadoc.waltonrobotics.org/ed...ControllerRate Quote:
Also: configMaxOutputVoltage Quote:
This implies the output votage from the Jag is analogue not just ON/OFF??? If so then getOutputVoltage() will NOT return the average V of a PWM cycle. |
Re: Voltage vs. PercentVbus
Quote:
The electronics in them do not permit analogue variation. |
Re: Voltage vs. PercentVbus
Like Ether said, the output is always a PWM. However you are correct about the differences between the modes.
Percent VBus drives the output at some percentage of the input voltage. This is the most straightforward of the the various modes. Voltage mode AKA Voltage Compensation mode will try and output a set voltage regardless of the battery voltage. It accomplishes this by varying the output PWM based on what the measured voltage on the input voltage is. For example, if you're telling the Jaguar to output 5 volts, and the battery is at 12V, the output duty cycle of the Jaguar will be ~42%. If the battery droops to 7 volts, the Jaguar will adjust the output duty cycle to ~71% to maintain an average of 5V. -David |
Re: Voltage vs. PercentVbus
Quote:
|
Re: Voltage vs. PercentVbus
Just to make sure we're all seeing things the same way:
When we say output 6 in kVoltage, there will be NO 6V measurable on the output at any point in time. I think we all agree that the output can only be in two possible states, a full ON or full OFF of the H-bridge (Full battery voltage (less MOSfet drop) or 0V). The output will look identical to a 0.5 in kPercentVbus with a battery voltage of 12V. There is no need to ADC the output, just the input Bus Voltage so that the Jag processor can compute the % duty cycle on the output. So it is awfully missleading to read the following method description: configMaxOutputVoltage Quote: public void configMaxOutputVoltage(double voltage)Configure the maximum voltage that the Jaguar will ever output. This can be used to limit the maximum output voltage in all modes so that motors which cannot withstand full bus voltage can be used safely. Parameters: voltage - The maximum voltage output by the Jaguar. -------------------------------------------------------------------------------- |
Re: Voltage vs. PercentVbus
Quote:
If it's connected to a stalled motor with a high inductance and you measure it using the DC setting of a meter which responds to average voltage, you will read 6V. |
Re: Voltage vs. PercentVbus
The PWM cycle is (I believe) 50KHz so a DC meter will read the average and indeed show 6V. But that is not reality. If you use a scope, in "normal" operation, you will see a 50KHz squarewave (ignoring inductance distortion for clarity) with a 50% on/off duty cycle, and the the squarewave will be between 0V and 12V. In a stalled case, depending on fuses, inductances, etc, for a CIM, you will likely see whatever the CIM windings R is over a 12V battery before the fuse blows or the Jag shuts down thermally.
|
Re: Voltage vs. PercentVbus
Quote:
Quote:
Quote:
|
Re: Voltage vs. PercentVbus
Quote:
|
Re: Voltage vs. PercentVbus
OK Ether, you are going to make me work here - last time I did this was 20+yrs ago. But it is all for a great cause!
So on the DC meters - yes there are many types out there, all will generally give some approximation of average voltage. As a rule though a DC meter is not the best tools for time variable signals. An oscilloscope is generally the best tool for analogue time variable signals. All electrical/electronics engineers will use them so they are a great investment to learn to use. They are the eyes into electric circuits. I agree the inductance is huge on a CIM and cannot be ignored. I will try and model it. I couldn't find any charts of stalled CIMs on here... But I will get the kids to play with that in the off-season it will be a great exercise! The main Q I was after is finding out exactly what the Jag APIs do - there are ample horror stories on CD from poor people spending time figuring out their problems and a lot of those can be overcome with proper documentation - which is lacking IMHO. We should be spending time on the robot/game and not on reverse engineering the APIs and tools we use. Specifically if anyone has the full specs on kVoltage, kPercentVbus, getOutputVoltage, configMaxOutputVoltage, and setVoltageRampRate, please post a link. |
Re: Voltage vs. PercentVbus
I am really mostly a mechanical guy so forgive me if this makes no sense.
The output of an unconnected jag would be a PWM square wave. Connect a motor to it, you are essentially throwing a big inductor with a little resistor in the loop? You would then have to look at it as system? Would resistance in the battery become an issue? Do have to admit the whole concept of DC & output of the jag is more of a metaphor that you are using to avoid confusing mechanical types that try to relate electricity to plumbing? After all the rate equations are the same. |
Re: Voltage vs. PercentVbus
Quote:
|
Re: Voltage vs. PercentVbus
Our robot was stripping the timing belt we wanted to use for the drivetrain and at midnight last night we decided to switch to chains... So excuse the lack of progress on the PWM vs analog Voltage. But I did do a quick model in SpiceIV and was surprised how little effect the inductor had (or how determined the battery was!). Today I threw a rig together and put a scope on it - and it too showed very little deviation from a true PWM, even after braking the CIM with my glove to a near stall.
I will do some pics etc and figure out how to post them (after we get the robot working!) The good news is: use kVoltage - you can see (on the scope) the Jag modifying the PWM ratio as you apply load on the motor. The bad news is that the documentation is quite missleading. Especially the decription of the configMaxOutputVoltage method. (see quote in this thread.) If you set kVoltage = 6V there is only Battery voltage or 0V to be seen anywhere - and the square wave is pretty square accross loads - see the pics and further detail I will post soon. Dean |
Re: Voltage vs. PercentVbus
BTW - the kids were excited to see the High duration of the PWM stretch as you apply load to the motor. It was a great oportunity to teach them something - most of them have never played with an oscilosope and see what really is happening in the wires. Just seing the excitement in their eyes makes it all worth while!
|
Re: Voltage vs. PercentVbus
To answer RuffleRidge's Q above:
There is nothing really wrong with the method names - it is the description that needs to reflect reality. Its all pretty simple - The Jag can only output ON or OFF - I even looked at their cirsuit diagram and you can see that the MOSFETS in the H-Bridge are driven by a separate chip and follwing that datasheet it can ONLY drive the H-Bridge with ON/OFF signals. |
Re: Voltage vs. PercentVbus
Dean -
It would be great to see the traces. I think it becomes more apparent if you scope the current through the motor. Also, the output voltage is better described as "effective output voltage". |
Re: Voltage vs. PercentVbus
Quote:
@Dean: while you've got the test setup, could you run locked-rotor traces for some of the other popular motors as well? Nobody seems to have motor inductance specs or data. |
Re: Voltage vs. PercentVbus
OK. Will try.
What I would love to do is to get a few kids excited to do a decent job in characterizing all these motors/Jags/etc. and publish it for the benefit of all. I must say I was surprised at the SpiceIV results (also I don't have a model for the motor so was just playing with H values), so I was really surprized how relatively little effect the motor inductance had in the real test rig. (I hope I wasn't doing something wrong :eek: ) Dean |
Re: Voltage vs. PercentVbus
Here are the tests and results, with scope pictures.
(I am not sue how best to input pictures - my son suggested Imgur - but they say the pics may be deleted if not viewed in 6 months... if anyone knows of a better way to save these let me know) Summary: We tested the behavior of two FIRST motors under idle speed (no load) and stalled condition. The Motors are CIM and Fisher Price. All components are standard FIRST KOP. The setup is a 12V battery, cRio, Jaguar CANbus controlled driven in the kVoltage mode, and first a CIM then FP motor tested at various settings of kVoltage from 6V to 12V. The kVoltage mode behaves as predicted but does not seem to fully compensate for the bus voltage drop (battery input voltage). The inductance of the load has remarkably little effect on the waveforms observed. Some odd effects were observed and we speculate on the reasons. Setup pic: http://imgur.com/aebA6 First Motor - CIM - pic: http://imgur.com/7qELk Scope used: http://imgur.com/VsFVS Test 1 - Idle, kVoltage=6V, I=3.23A Jaguar Current=3.23A -as reported by getOutputCurrent() -This is almost certainly average current. see pic (ignore lines 1 and 3): http://imgur.com/2Qi2I Voltage on jag output is a 12V peak-peak 50% duty cycle PWM. pic: http://imgur.com/Fnpwi Test 2 - Stalled, kVoltage=6, I=55A The PWM duty cycle is now about 55% while the High V is about 10V. Why does the Jag not make the average Vout closer to 6V? Maybe because it measures the input side Voltage which is higher given that we have about 100A flowing during the high cycle. [ToDo next time - look at input side V.] pic: http://imgur.com/0IjKf Test 3 - Idle, kVoltage=9, I=3 pic: http://imgur.com/qmp4w Test 4 - Stalled, kVoltage=9, I=88A pic: http://imgur.com/SAn2Y Jag cut out after a while (thermal cutoff), and restarted a few seconds later. Pretty decent squarewave for 100A chopped through a large inductor! I guess its the battery which is a bigger monster than the CIM <smiley> Our battery measured at 0.02 Ohms internal resistance. Modeling with LTspiceIV confirmed this. Test 5 - Idle, kVoltage=10, I=3A pic: http://imgur.com/oZDfw Test 6 - Stalled, kVoltage=10, I=98A Hm... the Jag kept cutting out before I could snap a pic! Also very curiously, it crashed the cRio!! very consistently. Speculation: noise on the Vcc (power input to the cRio) either the voltage drops too far, or the voltage disturbance goes through the input filters and crashed the cRio. Test 7 & 8 with kVoltage=12 are the same as for 10V. The Current always spikes and settles - it is the settled readings provided here, and there is not much observable diferrence in current between kVoltage of 10 and 12. The Fisher Price motor date will be uploaded tomorrow - this is taking a long time ... |
Re: Voltage vs. PercentVbus
Quote:
I'm a bit disappointed there's no scope traces of current. I was hoping to get some motor inductance data :( |
Re: Voltage vs. PercentVbus
Second part of the FIRST motor tests… (see prior posts for the first part.)
Second Motor: Fisher Price pic: http://imgur.com/J49vW Test 1 - Idle, kVoltage=6V, I=2A http://imgur.com/SPwFd Test 2 - Stalled, kVoltage=6, I=37A http://imgur.com/jrqAM Test 3 - Idle, kVoltage=9, I=1.8A http://imgur.com/9foYn Test 4 - Stalled, kVoltage=9, I=55A http://imgur.com/4xbRV Test 5 - Idle, kVoltage=10, I=1.6A http://imgur.com/4XI29 Test 6 - Stalled, kVoltage=10, I=60A http://imgur.com/a16g6 Test 7 - Idle, kVoltage=11, I=1.5A http://imgur.com/vVA9q Test 8 - Stalled, kVoltage=11, I=60A Jag cutout too soon for pic. Test 9 - Idle, kVoltage=12, I=0.9A http://imgur.com/W0QvH Test 10 - Stalled, kVoltage=12, I=63A Jag cutout too soon for pic. This little motor is much smaller than the CIM but not that much weaker. Stalling the FP never caused the cRio to crash like the CIM did. A curious observation: When the FP stalled (at 11V & 12 V), the Jag would cutout giving a 0V scope trace, then in a few seconds it would go ON showing the expected PWM, but the motor would stay dead for another couple of seconds and then spring to action??? Speculation: The FP has an internal cutoff mechanism. The Jag cuts out first and that somehow(???) causes the motor’s cutout to activate. The motor’s cutout is longer than the Jag’s by a couple of seconds… (this does not seem likely) another possibility is that when warm the motor exhibits a delayed start… Would like to do more tests. On the Current issue – we didn’t measure it with the scope – we could with a 0.01Ohm length of wire (10AWG is 1mOhm/ft) or some Hall Effect sensor. Playing with LTspice and using our test results, it seems a stalled CIM is ballpark 200uH and 80mOhms – not a bad guess Ether! The current is indeed very flat (just a small sinewavelike ripple of around 1A on top of 88A). For further testing: 1. Investigate what causes the cRio to crash upon stall at full PWM (see CIM tests). Have other teams experienced this ? We ended up switching back to Victors again this season for this reason… (I believe we are overpowering the CIMs –you can fry an egg on them! And bypassing the Jag’s safety by going to Victors – hey the kids are the boss!) 2. Investigate the FP weird delayed start (see above). 3. plot the Current alongside the Voltage. 4. Test a representative sample of motors. Another mentor was using CIMs to drain test batteries and found that some CIMs drew more Amps than others at idle! 5. We should be able to get real test and performance data from the manufacturers of these motors. Someone must have done this already? Over and Out – this is hard work! |
Re: Voltage vs. PercentVbus
When you say the cRIO is crashing, can you tell if it is due to low voltage -- the 8 slot needs 19volts? What does the voltage at the cRIO plug look like?
If it isn't voltage, you can also use the netConsole to see if you get any diagnostic. Greg McKaskle |
Re: Voltage vs. PercentVbus
Thanks Greg,
No we did not look at that. Ours is a 8 slot. Our new robot with another old cRIO but a New PDB draws near 200A with Victors without crashing the cRIO, so it is probably not a voltage drop issue. So far no one else has responded that they too had cRIO crashes when CIMs stall, so it may be something with our PDB it is an old war scarred PDB so will do more tests and report back when we recover from the post bagging depression :) |
| All times are GMT -5. The time now is 20:17. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi