channe wrote:Thanks,
I will go through it again. from the first part of the video I see your joystick is a different model to the older one I have.
What I was looking for was the connection point as such, do you have a three pin charging plug on the front of the joystick that you connect to, or do you break into the data bus at the four pin plug for the data high and data low signals: I also there was an issue with the Max485 and 24 volts that the unit runs on.
Thanks again
channe wrote:Thanks,
I will go through it again. from the first part of the video I see your joystick is a different model to the older one I have.
What I was looking for was the connection point as such, do you have a three pin charging plug on the front of the joystick that you connect to, or do you break into the data bus at the four pin plug for the data high and data low signals: I also there was an issue with the Max485 and 24 volts that the unit runs on.
Thanks again




channe wrote:Tony,
Thanks, I live in Hamilton New Zealand.
I have just pulled a joystick down, looks like the bus is driven by a LM339 and a couple of tranis. The processor is an ATMEGA B 64 pin version so I'm doing a trace at the present to see what is what with it. Hopefully the Lm339 will be feed by one of the ports on the ATMEGA so it will be just a case of trying to work out the data pattern after that.
by the by, I do love the inductor arrangement for the joystick itself, very safe from noise like you would get from a pot ad quite precise in its action.
I will try to draw the circuit out if I can so I can replicate it, but it does look like the joystick I have here is an older version of the one you have, so I suspect the controller is older also.
I will keep you posted as to progress
gcebiker wrote:Anyone with a spare Dynamic Shark Battery to Power Module wiring loom ?
I would settle for just the plug or anyone knowing what plug it is and i can just order one from Element14
vendis wrote:Hi gcebiker.
You could upload the DG419 - MAX485 connection scheme on the shark bus.
Greetings from catalunya.
gcebiker wrote:vendis wrote:Hi gcebiker.
You could upload the DG419 - MAX485 connection scheme on the shark bus.
Greetings from catalunya.
viewtopic.php?f=2&t=6503&start=80#p99378
Thats all i have for now, the fritzing file is there on that thread.
Mike has shown some interest in drawing up an eagle file to make up some PCB's for people. If it pans out i will post info for it.
vendis wrote:The wheelchair is already moving. With ESP8266 (arduino wifi)
Second phase android control app.![]()
gcebiker wrote:vendis wrote:The wheelchair is already moving. With ESP8266 (arduino wifi)
Second phase android control app.![]()
Awesome, please do post up your code for the ESP8266...ive a few here and it was on my to do list but never got past just using the Nano V3.0's
And pictures, we love pictures. Just use the 'Upload attachment' tab at the bottom of the 'post a reply' page.
vendis wrote:First tests ESP8266 and windows app.
https://www.dropbox.com/sh/rmoby8gjx9w1smg/AAB_NuKPrDqCAgElSNtJADK0a?dl=0
Folder "_win_client" app client windows.
oscarMobility.ino: main program arduino.
Folder "docs" aux files arduino.
Folder "_img" Photos and videos.
Saludos desde Catalunya.
package com.knet.oscarmobility;
import android.content.pm.ActivityInfo;
import android.content.res.ColorStateList;
import android.graphics.Color;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.nio.channels.DatagramChannel;
import java.util.Timer;
import java.util.TimerTask;
public class MainActivity extends AppCompatActivity
{
TextView txtSpeedDir;
TextView txtIndMarcha;
ImageView imgTouchPad;
int posx = 0;
int posy = 0;
int forwardRear = 1; // 1: forward -1: rear
int marcha = 1; // 1: lenta .. 4: rapida
@Override
public void onStop()
{
super.onStop();
posx = 0;
posy = 0;
}
private void showMarcha()
{
if (forwardRear == 1)
switch (marcha)
{
case 1 : imgTouchPad.setImageResource(R.drawable.forward_01); break;
case 2 : imgTouchPad.setImageResource(R.drawable.forward_02); break;
case 3 : imgTouchPad.setImageResource(R.drawable.forward_03); break;
case 4 : imgTouchPad.setImageResource(R.drawable.forward_04); break;
}
if (forwardRear == -1)
switch (marcha)
{
case 1 : imgTouchPad.setImageResource(R.drawable.rear_01); break;
case 2 : imgTouchPad.setImageResource(R.drawable.rear_02); break;
case 3 : imgTouchPad.setImageResource(R.drawable.rear_03); break;
case 4 : imgTouchPad.setImageResource(R.drawable.rear_04); break;
}
switch (marcha)
{
case 1 : txtIndMarcha.setText("marxa: molt lenta"); break;
case 2 : txtIndMarcha.setText("marxa: lenta"); break;
case 3 : txtIndMarcha.setText("marxa: ràpida"); break;
case 4 : txtIndMarcha.setText("marxa: molt ràpida"); break;
}
}
public void onClickVelMas (View v)
{
if (marcha < 4) marcha++;
showMarcha();
}
public void onClickVelMenos (View v)
{
if (marcha > 1) marcha--;
showMarcha();
}
public void onClickForward (View v)
{
forwardRear = 1;
showMarcha();
}
public void onClickRear (View v)
{
forwardRear = -1;
showMarcha();
}
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
txtSpeedDir = (TextView)findViewById(R.id.textUser);
txtIndMarcha = (TextView)findViewById(R.id.txtIndMarcha);
imgTouchPad = (ImageView)findViewById(R.id.imageView);
imgTouchPad.setOnTouchListener(new View.OnTouchListener()
{
@Override
public boolean onTouch(View v, MotionEvent event)
{
int touchHeight = v.getHeight();
int touchWidth = v.getWidth();
int touchX = touchWidth / 2;
int touchY = touchHeight;
int eventAction = event.getAction();
switch (eventAction)
{
case MotionEvent.ACTION_UP :
posx = 0;
posy = 0;
txtSpeedDir.setText("cadira parada");
return true;
case MotionEvent.ACTION_DOWN :
case MotionEvent.ACTION_MOVE :
touchX = (int)event.getX() - v.getLeft();
touchY = (int)event.getY() - v.getTop(); // + pb01.getHeight();
break;
}
if (touchX < 0) touchX = 0;
if (touchY < 0) touchY = 0;
if (touchX > touchWidth) touchX = touchWidth;
if (touchY > touchHeight) touchY = touchHeight;
posx = -(((touchWidth - touchX) * 64 / touchWidth) - 32);
posy = ((touchHeight - touchY) * 60 / touchHeight);
if ((posx >= 0) && (posx < 7))
posx = 0;
else
posx -= 7;
if ((posx < 3) && (posx > -3)) posx = 0;
if (posy < 5) posy = 0;
posy = (posy * forwardRear);
posx = (posx * forwardRear);
txtSpeedDir.setText("Vel: " + String.valueOf(posy*100/60) + " Dir: " + String.valueOf(posx));
return true;
}
});
showMarcha();
new UDPSendThread().start();
}
private class UDPSendThread extends Thread
{
private boolean stoped = true;
private byte[] send_data = { (byte)0x60, (byte)0xC0, (byte)0xC0, (byte)0xA0, (byte)0x80, (byte)0x80, (byte)0x84, (byte)0x80, (byte)0x00, (byte)0x0F };
private byte checkSum (byte[] pBuffer, int len)
{
byte result = 0;
for (int id = 0; id < len; id++)
result += pBuffer[id];
return (byte)(~result | (byte)0x80);
}
private void sendMessage()
{
try
{
DatagramSocket dgSocket = new DatagramSocket();
InetAddress sillaIP = InetAddress.getByName("192.168.100.1"); // 192.168.1.7
send_data[1] = (byte) ((byte) 0xFF - (byte) 63 + posy);
send_data[2] = (byte) ((byte) 0xFF - (byte) 63 + posx);
send_data[4] = (byte) ((byte) 0x80 | ((posy & 0x7) << 3) | (posx & 0x7));
switch (marcha)
{
case 1:
send_data[3] = (byte) 0x90;
break;
case 2:
send_data[3] = (byte) 0xA0;
break;
case 3:
send_data[3] = (byte) 0xD0;
break;
case 4:
send_data[3] = (byte) 0xFF;
break;
}
send_data[8] = checkSum(send_data, 8);
DatagramPacket send_packet = new DatagramPacket(send_data, 10, sillaIP, 4100);
dgSocket.send(send_packet);
Thread.sleep(25);
}
catch (Exception e)
{
}
}
public void run()
{
while (true)
{
if ((posx == 0) && (posy == 0))
{
if (stoped == false)
{
for (int id = 0; id < 4; id++)
sendMessage();
stoped = true;
}
}
else
{
stoped = false;
sendMessage();
}
}
}
}
}
Return to Everything Powerchair
Users browsing this forum: Kande_ian, ricardoh, yeshelp and 83 guests