The USB DrDAQ, complete with Buffer and 2200 series scope, represents a miniature, but fully functional electronic lab which allows very fast development of design ideas, as will be shown in the development and simulation of a Wheelchair Speedometer/Recorder. The same equipment and principles can be easily employed in a host of applications using a Hall Effect Motion Sensor.
We wish to measure & record speed of a wheelchair from 0.3 km/h to 12 km/h using a DrDAQ USB Data Acquisition module and a Hall Effect Magnetic Sensor such as Hamlin model 51100.
Five magnets are fitted around the rim of the wheel and the Sensor emits a pulse every time a magnet goes past. The wheel diameter is 420,97 mm, therefore circumference is 1.323 mm. At 4 RPM and at 144 RPM (wheel revolutions per minute) we have a linear speed in m/sec and in km/h as follows:
Using the above expressions it is possible to calculate any speed Vs. RPM.
To calculate Frequency and Period, we must remember that we have 5 magnets, therefore, at 4 RPM and 144 RPM:
Frequency = 4*5/60 = 0,333 Hz....................................Frequency = 144*5/60 = 12,00 Hz
and
Period = 1000/0,333 = 3 seconds (3.000 mS).....................Period = 1000/12 = 0,0833 seconds (83,3 mS)
The Hall sensor has an inner element 7 mm long. Considering a capture length of 5 mm, the capture time (which is the length of the pulse emitted by the sensor) is given by the Ratio Sensor/ Circumference as follows:
RATIO = 5/1.323 = 0,00378 and the pulse duration at 4 and at 144 RPM can be calculated as follows:
On Pulse = 3*0,00378*1000 = 11,342 mS...........................On Pulse = 0,0833*0,00378*1000 = 0,3151 mS
The output of the Hall Sensor is a train of pulses whose time in between (Period) becomes shorter and shorter as wheel rotational speed INCREASES. If we charge a capacitor (with a constant voltage) through a resistor (RC time constant) with these pulses, the higher the speed, the higher the voltage: in fact the voltage (which we call METERING VOLTAGE) is linearly proportional to the rotational speed and hence to the linear speed . Therefore measuring the voltage we measure the frequency and hence the speed. To do this the CHARGE PULSE DURATION MUST BE CONSTANT, only the TIME AMONG PULSES MUST CHANGE.
From what calculated above, going from 0,317 km/h to 11,427 km/h the On Pulse duration UNFORTUNATELY CHANGES from 11,34 to 0,315 mS, therefore we will use the Hall Sensor pulse train to drive a monostable producing a FIXED OUTPUT PULSE OF CONSTANT DURATION. We shall set up the monostable to produce a constant pulse duration approximately 4 times longer than the longest sensor pulse. Since the longest On Pulse is 11,342 mS, we shall use a monostable producing a constant pulse of 50 mS.
2. THE EXCEL SPREADSHEET AND SYSTEM SIMULATION
All above described calculations for any speed are made by the enclosed EXCEL spreadsheet file “Speedometer calc.”. The speedometer system can be simulated by using Picoscope’s 2200 Function Generator as source, feeding an RC cell calculated as shown. The maximum Hall Sensor pulse length occurs at 4 RPM and has a value of 11,342 mS: to avoid excessive ripple at low speed, the RC cell must have a time constant more than four times higher, e.g. 50 mS, which can be implemented with an Rintegrator = 100 KOhm resistor and a Cintegrator = 2 uF tantalum capacitor.
The 2200 Function Generator can be set for any frequency between 0,3 and 14 Hz: it is set as non-symmetrical squarewave, with AMPLITUDE (important!) between 0 and 1 V. Since we have not yet built the monostable, ON time of the squarewave changes with frequency: hence we must manually adjust ON time, every time we change frequency. ON percentage for each frequency is given in column E of the Excel file, while in column F we see the voltage across Cintegrator (blue colour).
The reference diagram is posted, showing the DrDAQ plus the universal buffer. With reference to the simulation diagram, the DrDAQ buffer must be used in order not to load down the RC cell. Also note that a 10:1 probe is necessary to buffer the 2200 scope input, because the 1 MOhm input impedance of the scope is too low and loads the RC cell.DrDAQ Picolog channels must be set up as follows, according to the Excel file calculations.
External 1
Title: Frequency
Channel: External 1
Scale: No sensor V
Meas: Signal c.c. Options
Use parameter formatting: Hz
Min. Value: 0.0
Max. Value: 14.0 Scale
Reference: table
0.033 – 0.0167
0.35 – 7.0
0.70—14.0
External 2
Title: Rotational Speed
Channel: External 2
Scale: No sensor V
Meas: Signal c.c. Options
Use parameter formatting: RPM
Min. Value: 0.0
Max. Value: 180.0 Scale
Reference: table
0.0167 – 4.0
0.35 – 84.0
0.70—170.0
External 3
Title: Wheelchair speed
Channel: External 3
Scale: No sensor V
Meas: Signal c.c. Options
Use parameter formatting: km/h
Min. Value: 0.0
Max. Value: 15.0 Scale
Reference: table
0.0167 – 0.317
0.35 – 6.665
0.70— 13.331
Connect the parts according to the schematic. Do not turn on Picolog yet. Turn Picoscope on and set up Function Generator for ARBITRARY WAVEFORM. Adjust voltage swing from 0 V to 1 V and check Voltages on DVM after setting up any frequency with the associated Simulation Percentages, as shown in the Speedometer calc. file (bue colour). For instance with frequency = 1 Hz and Pulse % = 5%, the DVM will show 50 mV and so on.
Once the voltages are verified, turn on Picolog and the three channels will show and record Frequency, RPM and Speed as shown in the screen photos.
A future instalment will describe the Sensor / DrDAQ interface for speed measurement and recording.
All above described calculations for any speed are made by the enclosed EXCEL spreadsheet file “Speedometer calc.”. The speedometer system can be simulated by using Picoscope’s 2200 Function Generator as source, feeding an RC cell calculated as shown. The maximum Hall Sensor pulse length occurs at 4 RPM and has a value of 11,342 mS: to avoid excessive ripple at low speed, the RC cell must have a time constant more than four times higher, e.g. 50 mS, which can be implemented with an Rintegrator = 100 KOhm resistor and a Cintegrator = 2 uF tantalum capacitor.
Please replace this sentence with:
THE EXCEL SPREADSHEET AND SYSTEM SIMULATION
All above described calculations for any speed are made by the enclosed EXCEL spreadsheet file “Speedometer calc.”. The speedometer system can be simulated by using Picoscope’s 2200 Function Generator as source, feeding an RC cell calculated as shown. The monostable pulse length will be 50 mS: to avoid excessive ripple at low speed, the RC cell must have a time constant more than four times higher, e.g. 200 mS, which can be implemented with an Rintegrator = 100 KOhm resistor and a Cintegrator = 2 uF tantalum capacitor.
3. DrDAQ HALL INTERFACE SCHEMATIC DIAGRAM
The previously described simulation demonstrates the versatility of the DrDAQ / 220 Oscilloscope combination. Of special interest is that these units can generate arbitrary waveforms at a frequency as low as 0.1 Hz (100 mHz) and this feature allowed quick simulation and testing of the very low RPM measuring unit described here.
NOTE: I enclose a PC Screen of the Picoscope Waveform set-up page used for the previous simulation.
First of all it must be understood that while the simulation was done with a 0 – 1 V waveform, the actual speedometer circuit uses a 0 – 5 V waveform (from the DrDAQ supply voltage output) therefore the Integrator output voltage range is 0,0833 – 3,50 V, which is not suitable for the DrDAQ input voltage limit of 2,5 V and it will be reduced as described below.
For the simulation the handy DrDAQ Universal Buffer was used. Now the described interface drives the three DrDAQ inputs directly and the Universal Buffer is no longer needed. A new Excel calculation file (Speedometer values) is enclosed, which is necessary to calculate system characteristics and accommodate the increased 5 V pulse amplitude.
With reference to the schematic, pulses at point “A” drive Pin 2 input of the NE555 through C9. The NE555 triggers on the falling edge of the Hall Sensor generated pulse and its output is a 50 mS (0 to 5 V) pulse at pin 3. Monostable RC constant R11 – C11 calculation is shown in the Excel file. The constant duration 50 mS pulses are integrated by R12-C14, as described in the previous post. The very high impedance integrator output is buffered by IC2A, whose output swing is 0.0833 – 3.5 V. This voltage is halved by R14-R15 and buffered by IC2B. The very low output impedance of IC2B is required to drive to ground the pull-ups of the three DrDAQ inputs.
DrDAQ Picolog channels must be set up as shown below. Alternatively it could be convenient to use a .DDS file
External 1
Title: Frequency
Channel: External 1
Scale: No sensor V
Meas: Signal c.c. Options
Use parameter formatting: Hz
Min. Value: 0.0
Max. Value: 14.0 Scale
Reference: table
0.0417 – 0.333
0.875 – 7.0
1.750—14.0
External 2
Title: Rotational Speed
Channel: External 2
Scale: No sensor V
Meas: Signal c.c. Options
Use parameter formatting: RPM
Min. Value: 0.0
Max. Value: 180.0 Scale
Reference: table
0.0417 – 4.0
0.875 – 84.0
1.750—168.0
External 3
Title: Wheelchair speed
Channel: External 3
Scale: No sensor V
Meas: Signal c.c. Options
Use parameter formatting: km/h
Min. Value: 0.0
Max. Value: 15.0 Scale
Reference: table
0.0417 – 0.317
0.875 – 6.665
1.750— 13.331
A few images of the simulation, prior to building the monostable interface. The PC screen photo shows the arbitrary waveform set-up window, which was impossible to capture with the in-PC screen image capture software.