gcebiker wrote:Next version (not available as yet, till testing can be done on the Raspberry Pi Sections SirMike is interested in/requested)
Ver 3.25 has the power to the Arduino fixed, a link/place for putting a switch should you want to leave it connected but turned off.
gcebiker wrote:
- Code: Select all
{
directionPotVal = analogRead(directionPot);
directionPotVal = constrain(directionPotVal, 1, 1023);// Constrain to real numbers. 0 and 1024 are out of range for the controller.
direction = map(directionPotVal, 0, 1024, 1, 1023); //here in case direction is inverted in wiring
if (direction > 312 && direction < 712) // set dead zone of joystick
direction = 512;
}
{
speedPotVal = analogRead(speedPot);
speedPotVal = constrain(speedPotVal, 1, 1023); // Constrain value to real numbers.
speed = map(speedPotVal, 0, 1024, 1023, 1 ); // here in case of speed is inverted in wiring
//speed dead zone mapping
if (speed > 312 && speed < 712) // set dead zone of joystick
speed = 512;
}
{
directionPotVal = analogRead(directionPot);
#define MIN_DIRECTION_POT (1) // '0' is out of controller's range
#define MAX_DIRECTION_POT (1023) // '1024' is out of controller's range
directionPotVal = constrain(directionPotVal, MIN_DIRECTION_POT, MAX_DIRECTION_POT);// Constrain to valid numbers. Others are out of range for the controller.
#define MIN_DIRECTION (0) // minimum value of "direction" variable
#define MAX_DIRECTION (1024) // maximum value of "direction" variable
direction = map(directionPotVal, MIN_DIRECTION, MAX_DIRECTION, MIN_DIRECTION_POT, MAX_DIRECTION_POT); //here in case direction is inverted in wiring
#define DIRECTION_CENTERED ((MAX_DIRECTION - MIN_DIRECTION)/2)
#define DIRECTION_DEADBAND (400) // width of deadband in "direction" units
#define DIRECTION_LOW_DEADBAND (DIRECTION_CENTERED - DIRECTION_DEADBAND/2)
#define DIRECTION_HIGH_DEADBAND (DIRECTION_CENTERED + DIRECTION_DEADBAND/2)
if ( (direction > DIRECTION_LOW_DEADBAND)
&& (direction < DIRECTION_HIGH_DEADBAND) )
direction = DIRECTION_CENTERED; // treat direction as "centered" if within deadband
}
[...]
map(value, minimum_range, maximum_range, minimum_domain, maximum_domain);
map(value, minimum_domain, maximum_domain, minimum_range, maximum_range);
map(value, minimum_range, minimum_domain, maximum_range, maximum_domain);
map(value, maximum_range, minimum_range, maximum_domain, minimum_domain);
[...]
consider surrounding (one or more) mounting holes with "ground" if you want to be able to electrically tie the board's ground to your chassis/enclosure
Scout wrote:gcebiker wrote:Next version (not available as yet, till testing can be done on the Raspberry Pi Sections SirMike is interested in/requested)
Ver 3.25 has the power to the Arduino fixed, a link/place for putting a switch should you want to leave it connected but turned off.
A few constructive criticisms re: layout (none are deal-breakers):
- pick a single orientation for your components (even if it makes the layout a bit harder). I.e., all chips facing the same way, pin 1's always pointed the same way, '+' terminals of polarized components (caps, diodes) facing the same direction
- consider using a square pad to make "pin 1" (or '+', etc.) more readily identifiable
- consider adding reference designators (instead of component part numbers) to the silkscreen. How would you reference the "top diode" if trying to describe something to someone else ("While holding the board with the power connector on the right-hand side, component side exposed, the diode closest to the top edge of the board...")
- add one (or more) tie-points for "ground" to make connecting a 'scope probe (or DMM "common" lead) easier. You can stuff a stiff piece of wire into the pad to make it easier to clip onto during testing
- leave a larger "keep out" zone around mounting holes. Imagine putting metal (conductive) fasteners in/under those holes and wondering if you'll have to ADD an insulating (nylon) washer to prevent unintended shorts
- consider surrounding (one or more) mounting holes with "ground" if you want to be able to electrically tie the board's ground to your chassis/enclosure
- try to run stubs off to individual pads instead of routing a trace "across" a pad (i.e., imagine how you would isolate the - conductor of the eCap from the "ground" signal that runs through that pad vs. how you'd isolate pin 5 of the MAX485 from that same signal
- leave as much space as possible for mounting components (e.g., that resistor near the MAX485 could probably benefit from a wider separation between mounting holes -- unless you want to mount it "on end" <frown>); ditto the two diodes
- traces on the underside of the board are usually easier to follow while troubleshooting a circuit ("Where else does this signal go?")
Keep in mind that the silkscreen is only visible from one side of the board (you can pay for screens on both sides -- or, NONE!). So, when you're soldering -- or PROBING! -- components from the underside of the board, you have to make a special effort to keep track of which specific pin you're looking for (a "convention" makes it easier to avoid mistakes -- esp when you're frustrated trying to trace down a problem). And, if the installed component COVERS the silkscreen legend for that component, its hard to verify that the component is installed properly and sort out which lead is which.
[I have no idea of the purpose for the large "heavily perforated" area to the left side of the board; perhaps a "breadboarding" area?]
gcebiker wrote:Next version...
Its not a commercial board...
The rest of it is for a Pi Hat, someone else designed...I have no idea about Pi's or their Hat's
Please do redesign it in Eagle and share the board,
LROBBINS wrote:I think that Scout's comments are well taken, but would be cautious about one suggestion:consider surrounding (one or more) mounting holes with "ground" if you want to be able to electrically tie the board's ground to your chassis/enclosure
IF the chassis/enclosure is not isolated from the chair framework, you have now created a low-impedance connection between ground and the chair frame. If ground is also B-, that is a direct connection of the battery negative to the frame. That is an absolute NO NO for wheelchairs - unlike a car where the driver can usually run away if there's a fire, a WC user usually cannot.
I would also consider going to an SMD version. I was leery of doing that, but discovered that SMD is actually easier and faster to do than through hole, and it doesn't really take any expensive equipment for small runs. I use: (1) an ordinary toaster-oven and watch with sweep second hand, (2) very fine solder that I flatten and cut into pieces that I stick to the board with good (sticky) flux, and (3) a stereo microscope and fine tweezers for manual pick and place. A good, large magnifying glass or magnifier headset would do as well, but I already had the scope. Placing the components is the trickiest part for my old hands, but once that's done the whole board is reflow soldered in a matter of minutes. Sure, if I had a lot to do a pick-and-place robot, a real reflow oven, stencils and fresh solder paste would make it even easier, but for a few small to medium sized boards at a time, my crude setup works pretty well - once in a while I have to fix a component that "gravestones" during reflow, but I've only once had a solder bridge and only once had a cold joint. I've fu'ed point-to-point wiring a lot more often.
The advantage to grounding the enclosure is that it helps cut down on radiated noise. If you're a manufacturer, you can afford to have PLASTIC enclosures that are coated with conductive paint on the inside.
gcebiker wrote:<photo of powerchair towing boat trailer>
LROBBINS wrote:Maybe I'm just lucky, but I've not had any reliability problems with my SMD boards.
Realterm data capture from RS485
0 This indicates 24v pulse for 300ms +/- 20ms
116 130 140 132 128 130 165 160 128 178 15 Sent start sequence
Initial Controller Reply = 5 128 250 15
Then .........
column number Joystick Sent start with 96 : Controller Replies start with 33
0 1 2 3 4 5 6 7 8 9 : 0 1 2 3 4 5
96 193 192 255 223 128 140 128 180 15 33 128 128 192 158 15
OFF Data 6 = 140 & Reply Data 4 = 158
96 193 192 255 231 128 140 128 172 15 33 128 192 192 222 15
OFF Data 6 = 140 & Reply Data 4 = 222
96 193 192 255 231 128 132 128 180 15 33 128 192 192 222 15
96 193 192 255 223 128 132 128 188 15 33 128 192 192 222 15
96 193 192 255 231 128 132 128 180 15 33 128 192 192 222 15
96 193 192 255 223 128 132 128 188 15 33 128 192 192 222 15
96 193 192 255 223 128 132 128 188 15 33 128 192 192 222 15
96 193 192 255 231 128 132 128 180 15 33 128 192 192 222 15
96 193 192 255 231 128 132 128 180 15 33 128 192 192 222 15
96 193 192 255 230 128 132 128 181 15 33 128 192 192 222 15
8 OFF pulses Data 6 = 132 & Reply Data 4 = 222
96 193 192 255 222 128 132 128 189 15 33 128 128 192 158 15
96 193 192 255 222 128 132 128 189 15 33 128 128 192 158 15
96 193 192 255 222 128 132 128 189 15 33 128 128 192 158 15
96 193 192 255 222 128 132 128 189 15 33 128 128 192 158 15
96 193 192 255 222 128 132 128 189 15 33 128 128 192 158 15
96 193 192 255 222 128 132 128 189 15 33 128 128 192 158 15
96 193 192 255 230 128 132 128 181 15 33 128 128 192 158 15
96 193 192 255 222 128 132 128 189 15 33 128 128 192 158 15
96 193 192 255 230 128 132 128 181 15 33 128 128 192 158 15
96 193 192 255 230 128 132 128 181 15 33 128 128 192 158 15
96 193 192 255 222 128 132 128 189 15 33 128 128 192 158 15
96 193 192 255 222 128 132 128 189 15 33 128 128 192 158 15
96 193 192 255 223 128 132 128 188 15 33 128 128 192 158 15
96 193 192 255 222 128 132 128 189 15 33 128 128 192 158 15
96 193 192 255 223 128 132 128 188 15 33 128 128 192 158 15
96 193 192 255 222 128 132 128 189 15 33 128 128 192 158 15
96 193 192 255 222 128 132 128 189 15 33 128 128 192 158 15
96 193 192 255 223 128 132 128 188 15 33 128 128 192 158 15
96 193 192 255 223 128 132 128 188 15 33 128 128 192 158 15
96 193 192 255 223 128 132 128 188 15 33 128 128 192 158 15
96 193 192 255 223 128 132 128 188 15 33 128 128 192 158 15
21 OFF pulses Data 6 = 132 & Reply Data 4 = 158
96 193 192 255 222 128 132 128 189 15 33 146 128 192 140 15
96 193 192 255 223 128 132 128 188 15 33 146 128 192 140 15
96 193 192 255 223 128 132 128 188 15 33 146 128 192 140 15
96 193 192 255 223 128 132 128 188 15 33 146 128 192 140 15
96 193 192 255 223 128 132 128 188 15 33 146 128 192 140 15
96 193 192 255 223 128 132 128 188 15 33 146 128 192 140 15
96 193 192 255 222 128 132 128 189 15 33 146 128 192 140 15
96 193 192 255 222 128 132 128 189 15 33 146 128 192 140 15
96 193 192 255 222 128 132 128 189 15 33 146 128 192 140 15
Then Data 6 = 132 & Reply Data 4 = 140
300ms Pulse High (of full battery volts, this is not a data pulse but a DG419 (maxim brand) voltage pulse)
- Then data
(your Start up packet you capture)
- a break
Then your joystick data
(if the joystick is not centered it wont start till it is '192')
Column number Joystick Sent start with 96 : Controller Replies start with 33
0 1 2 3 4 5 6 7 8 9 : 0 1 2 3 4 5
96 193 192 255 223 128 140 128 180 15 33 128 128 192 158 15
// If 'off' turn 'on'
// check state, if on/off button is pressed, change state to "ON" and run start up sequence.
else if (onOffVal > 1500 && onOffState == LOW)
{
onOffState = !onOffState; // toggle state to HIGH if in'off mode' and on/off button is pressed
digitalWrite(led, onOffState); // turn on LED pin to get visual indication of on/off state
sharkStartup(); // call function sharkStartup()
}
// If 'off' turn 'on'
// check state, if on/off button is pressed, change state to "ON" and run start up sequence.
else if (onOffVal > 1500 && onOffState == LOW)
{
onOffState = !onOffState; // toggle state to HIGH if in'off mode' and on/off button is pressed
digitalWrite(led, onOffState); // turn on LED pin to get visual indication of on/off state
sharkStartup(); // call function sharkStartup()
fakeData (); // call fake Joystick data packet so that the Power Module arms, to allow for 'dirty pots'
}
Return to Everything Powerchair
Users browsing this forum: daveonwheels and 104 guests